generator2
Class ExternalObjectGenerator

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

public class ExternalObjectGenerator
extends java.lang.Object

Class for creating and modifying external objects.


Field Summary
protected  ExternalObjectClasses classes
          Classes of external objects.
protected static int currId
          The counter for the identifiers.
protected  DataSpace dataspace
          Dataspace of the network.
protected  int numOfExtObjAtBeginning
          Number of external objects at the beginning.
protected  int numOfExtObjPerTime
          Number of generated external objects per time.
protected  java.util.Properties properties
          Properties of the generator.
protected  java.util.Random random
          Random generator.
protected  Time time
          The time object.
 
Constructor Summary
ExternalObjectGenerator(java.util.Properties properties, Time time, DataSpace dataspace, ExternalObjectClasses classes, int numOfExtObjPerTime, int numOfExtObjAtBeginning)
          Constructor.
 
Method Summary
 ExternalObject computeExternalObject(int time)
          Computes a new external object.
 MBR computeNewPositionAndSize(int time, ExternalObject obj)
          Computes the new position and size of an external object.
 boolean externalObjectsExist()
          Returns whether external objects exist or not.
 int numberOfNewObjects(int time)
          Returns the number of new external objects at a time stamp.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currId

protected static int currId
The counter for the identifiers.


properties

protected java.util.Properties properties
Properties of the generator.


time

protected Time time
The time object.


dataspace

protected DataSpace dataspace
Dataspace of the network.


classes

protected ExternalObjectClasses classes
Classes of external objects.


numOfExtObjPerTime

protected int numOfExtObjPerTime
Number of generated external objects per time.


numOfExtObjAtBeginning

protected int numOfExtObjAtBeginning
Number of external objects at the beginning.


random

protected java.util.Random random
Random generator.

Constructor Detail

ExternalObjectGenerator

public ExternalObjectGenerator(java.util.Properties properties,
                               Time time,
                               DataSpace dataspace,
                               ExternalObjectClasses classes,
                               int numOfExtObjPerTime,
                               int numOfExtObjAtBeginning)
Constructor.

Parameters:
properties - properties of the generator
time - the time object
dataspace - the dataspace
classes - the classes of external objects
numOfExtObjPerTime - number of external objects per time
numOfExtObjAtBeginning - number of external objects at the beginning
Method Detail

computeExternalObject

public ExternalObject computeExternalObject(int time)
Computes a new external object.

Parameters:
time - the time stamp
Returns:
the new object

computeNewPositionAndSize

public MBR computeNewPositionAndSize(int time,
                                     ExternalObject obj)
Computes the new position and size of an external object.

Parameters:
time - actual time
obj - the external object
Returns:
the mbr of the external object if no change has occured or a new created rectangle with the new position and/or size

externalObjectsExist

public boolean externalObjectsExist()
Returns whether external objects exist or not.

Returns:
exist?

numberOfNewObjects

public int numberOfNewObjects(int time)
Returns the number of new external objects at a time stamp.

Parameters:
time - the time stamp
Returns:
number of objects