generator2
Class ExternalObjects

java.lang.Object
  |
  +--generator2.ExternalObjects

public class ExternalObjects
extends java.lang.Object

Container class for all external objects.


Constructor Summary
ExternalObjects(java.util.Properties properties, Time time, ExternalObjectClasses objClasses)
          MovingObjects constructor.
 
Method Summary
protected  void add(ExternalObject obj)
          Adds an external object to the container.
 int computeDecrease(Edge edge)
          Computes the decrease of speed on the given edge by external objects.
 long getNumOfComputedDecreases()
          Returns the number of computed decreases.
 long getNumOfRealDecreases()
          Returns the number of real decreases.
 ExternalObjectClasses getObjectClasses()
          Returns the description of the external object classes.
 Time getTime()
          Returns the time object.
 int getTotalNumOfObjects()
          Returns the total number of created moving objects.
 long getUsedTime()
          Returns the time used for the management of external objects.
 void moveAndResizeAndRemoveObjects(int time, ExternalObjectGenerator gen, Reporter reporter)
          Updates (moves and resizes) all external objects.
 void removeObjects()
          All external objects are removed from the tree into the dead object container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExternalObjects

public ExternalObjects(java.util.Properties properties,
                       Time time,
                       ExternalObjectClasses objClasses)
MovingObjects constructor.

Parameters:
properties - properties of the generator
time - the time object
objClasses - description of the external object classes
Method Detail

add

protected void add(ExternalObject obj)
Adds an external object to the container.

Parameters:
obj - external object

computeDecrease

public int computeDecrease(Edge edge)
Computes the decrease of speed on the given edge by external objects.

Parameters:
edge - the edge
Returns:
decrease in per cent

getNumOfComputedDecreases

public long getNumOfComputedDecreases()
Returns the number of computed decreases.

Returns:
number

getNumOfRealDecreases

public long getNumOfRealDecreases()
Returns the number of real decreases.

Returns:
number

getObjectClasses

public ExternalObjectClasses getObjectClasses()
Returns the description of the external object classes.

Returns:
object classes

getTime

public Time getTime()
Returns the time object.

Returns:
the time object

getTotalNumOfObjects

public int getTotalNumOfObjects()
Returns the total number of created moving objects.

Returns:
total number

getUsedTime

public long getUsedTime()
Returns the time used for the management of external objects.

Returns:
time in msec

moveAndResizeAndRemoveObjects

public void moveAndResizeAndRemoveObjects(int time,
                                          ExternalObjectGenerator gen,
                                          Reporter reporter)
Updates (moves and resizes) all external objects.

Parameters:
time - the current time stamp
gen - the generator of external object classes
reporter - the reporter

removeObjects

public void removeObjects()
All external objects are removed from the tree into the dead object container.