org.jscience.architecture.traffic.infrastructure
Class Node.NodeStatistics

java.lang.Object
  extended by org.jscience.architecture.traffic.infrastructure.Node.NodeStatistics
All Implemented Interfaces:
java.lang.Cloneable, XMLSerializable
Enclosing class:
Node

public class Node.NodeStatistics
extends java.lang.Object
implements java.lang.Cloneable, XMLSerializable

Basic node statistics. Class to maintain statistics for one roaduser type.


Field Summary
protected  float avgWaitingTime
          DOCUMENT ME!
protected  int[] delayTable
          DOCUMENT ME!
protected  java.lang.String parentName
          DOCUMENT ME!
protected  int roadusers
          DOCUMENT ME!
protected  boolean tableFilled
          DOCUMENT ME!
protected  int tableIndex
          DOCUMENT ME!
 
Constructor Summary
Node.NodeStatistics()
          Create an (initially empty) statistics datastructure.
 
Method Summary
 void addRoaduser(int delay)
          Add statistics for one roaduser.
 float getAvgWaitingTime(boolean allTime)
          Returns the average waiting time the roadusers experienced.
 Node.NodeStatistics getClone()
          Returns a clone of this NodeStatistics.
 int getTotalRoadusers()
          Returns the total number of roadusers that crossed/arrived at this node.
 java.lang.String getXMLName()
          DOCUMENT ME!
 void load(XMLElement myElement, XMLLoader loader)
          DOCUMENT ME!
 void saveChilds(XMLSaver saver)
          DOCUMENT ME!
 XMLElement saveSelf()
          DOCUMENT ME!
 void setParentName(java.lang.String parentName)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

roadusers

protected int roadusers
DOCUMENT ME!


tableIndex

protected int tableIndex
DOCUMENT ME!


avgWaitingTime

protected float avgWaitingTime
DOCUMENT ME!


delayTable

protected int[] delayTable
DOCUMENT ME!


tableFilled

protected boolean tableFilled
DOCUMENT ME!


parentName

protected java.lang.String parentName
DOCUMENT ME!

Constructor Detail

Node.NodeStatistics

public Node.NodeStatistics()
Create an (initially empty) statistics datastructure.

Method Detail

getClone

public Node.NodeStatistics getClone()
Returns a clone of this NodeStatistics.

Returns:
DOCUMENT ME!

getTotalRoadusers

public int getTotalRoadusers()
Returns the total number of roadusers that crossed/arrived at this node.

Returns:
DOCUMENT ME!

getAvgWaitingTime

public float getAvgWaitingTime(boolean allTime)
Returns the average waiting time the roadusers experienced.

Parameters:
allTime - Returns an all-time average if true, the average of the last STAT_NUM_DATA roadusers otherwise.
Returns:
DOCUMENT ME!

addRoaduser

public void addRoaduser(int delay)
Add statistics for one roaduser.

Parameters:
delay - The delay of this roaduser to be logged.

load

public void load(XMLElement myElement,
                 XMLLoader loader)
          throws XMLTreeException,
                 java.io.IOException,
                 XMLInvalidInputException
DOCUMENT ME!

Specified by:
load in interface XMLSerializable
Parameters:
myElement - DOCUMENT ME!
loader - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLInvalidInputException - DOCUMENT ME!

saveSelf

public XMLElement saveSelf()
                    throws XMLCannotSaveException
DOCUMENT ME!

Specified by:
saveSelf in interface XMLSerializable
Returns:
DOCUMENT ME!
Throws:
XMLCannotSaveException - DOCUMENT ME!

saveChilds

public void saveChilds(XMLSaver saver)
                throws XMLTreeException,
                       java.io.IOException,
                       XMLCannotSaveException
DOCUMENT ME!

Specified by:
saveChilds in interface XMLSerializable
Parameters:
saver - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!

getXMLName

public java.lang.String getXMLName()
DOCUMENT ME!

Specified by:
getXMLName in interface XMLSerializable
Returns:
DOCUMENT ME!

setParentName

public void setParentName(java.lang.String parentName)
                   throws XMLTreeException
DOCUMENT ME!

Specified by:
setParentName in interface XMLSerializable
Parameters:
parentName - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!