generator2
Class ObjectClasses

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

public class ObjectClasses
extends java.lang.Object

Definition of the properties of the classes of moving objects.


Field Summary
protected  java.awt.Color[] color
          The colors.
protected  double[] maxSpeed
          Maximum speed of the classes.
protected  int num
          The number of classes.
protected  double[] portion
          The portion of the classes (sum = 1 = 100%).
protected  int[] reportProbability
          The report probability of the classes (1000 = 100%).
protected  Time time
          The time object.
 
Constructor Summary
ObjectClasses(java.util.Properties properties, Time time, DataSpace ds, int numOfClasses, int reportProb, int maxSpeedDivisor)
          ObjectClasses constructor.
 
Method Summary
 int computeNewObjectClass(int time)
          Computes the object class of a new moving object.
 java.awt.Color getColor(int c)
          Returns the color of the class.
 double getMaxSpeed(int c)
          Returns the maximum speed of an object class.
 int getNumber()
          Returns the number of object classes.
 int getReportProbability(int c)
          Returns the report probability of an object class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

time

protected Time time
The time object.


num

protected int num
The number of classes.


maxSpeed

protected double[] maxSpeed
Maximum speed of the classes.


portion

protected double[] portion
The portion of the classes (sum = 1 = 100%).


reportProbability

protected int[] reportProbability
The report probability of the classes (1000 = 100%).


color

protected java.awt.Color[] color
The colors.

Constructor Detail

ObjectClasses

public ObjectClasses(java.util.Properties properties,
                     Time time,
                     DataSpace ds,
                     int numOfClasses,
                     int reportProb,
                     int maxSpeedDivisor)
ObjectClasses constructor.

Parameters:
properties - properties of the generator
time - the time object
ds - the data space
numOfClasses - number of object classes
reportProb - report probability (0-1000)
maxSpeedDivisor - maximum speed divisor
Method Detail

computeNewObjectClass

public int computeNewObjectClass(int time)
Computes the object class of a new moving object.

Parameters:
time - current time stamp
Returns:
object class

getColor

public java.awt.Color getColor(int c)
Returns the color of the class.

Parameters:
c - object class
Returns:
color

getMaxSpeed

public double getMaxSpeed(int c)
Returns the maximum speed of an object class.

Parameters:
c - object class
Returns:
maximum speed of class c

getNumber

public int getNumber()
Returns the number of object classes.

Returns:
number of object classes

getReportProbability

public int getReportProbability(int c)
Returns the report probability of an object class.

Parameters:
c - object class
Returns:
report probability (0..1000)