generator2
Class EdgeClasses

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

public class EdgeClasses
extends java.lang.Object

Definition of the properties of the classes of the network edges.


Field Summary
protected  int[] capacity
          Capacity of the classes.
protected  java.awt.Color[] color
          Color of the edge classes.
protected  int[] maxSpeed
          Maximum speed of the classes.
protected  int maxSpeedDivisor
          Initial maximum speed of the classes.
protected  int[] minScale
          Minimum scales for depicting the edge classes.
protected  int num
          Number of edge classes.
protected  java.util.Properties properties
          The properties of the generator.
protected  Time time
          The time object.
 
Constructor Summary
EdgeClasses(java.util.Properties properties)
          EdgeClasses constructor.
 
Method Summary
 void announce(Time time, DataSpace ds, int maxSpeedDivisor)
          Announces the time object, the dataspace and the divisor of maximum speed to the object.
 int deceleratedSpeed(int c, int edgeUsage)
          Computes the decelerated speed of an edge class depending on the usage and the capacity of the edge.
 int getCapacity(int c)
          Returns the capacity of an edge class.
 java.awt.Color getColor(int c)
          Returns the color for depicting an edge class.
 int getMaxSpeed(int c)
          Returns the maximum speed of an edge class.
 int getMaxSpeedDivisor()
          Returns the maximum speed divisor.
 int getMinScale(int c)
          Returns the minimum scale for depicting an edge class.
 int getNumber()
          Returns the number of edge classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

properties

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


time

protected Time time
The time object.


num

protected int num
Number of edge classes.


maxSpeedDivisor

protected int maxSpeedDivisor
Initial maximum speed of the classes.


maxSpeed

protected int[] maxSpeed
Maximum speed of the classes.


capacity

protected int[] capacity
Capacity of the classes.


minScale

protected int[] minScale
Minimum scales for depicting the edge classes.


color

protected java.awt.Color[] color
Color of the edge classes.

Constructor Detail

EdgeClasses

public EdgeClasses(java.util.Properties properties)
EdgeClasses constructor. Is called by the init method of the DataGenerator. Further attributes are announced by the method "announce".

Parameters:
properties - properties of the generator
Method Detail

announce

public void announce(Time time,
                     DataSpace ds,
                     int maxSpeedDivisor)
Announces the time object, the dataspace and the divisor of maximum speed to the object. This method must be called before the function getMaxSpeed is called.

Parameters:
time - the time object
ds - the dataspace
maxSpeedDivisor - divisor of maximum speed (10=fast, 50=middle, 250=slow)

deceleratedSpeed

public int deceleratedSpeed(int c,
                            int edgeUsage)
Computes the decelerated speed of an edge class depending on the usage and the capacity of the edge.

Parameters:
c - edge class
edgeUsage - usage of the edge
Returns:
decelerated speed

getCapacity

public int getCapacity(int c)
Returns the capacity of an edge class.

Parameters:
c - edge class
Returns:
capacity of class c

getColor

public java.awt.Color getColor(int c)
Returns the color for depicting an edge class.

Parameters:
c - edge class
Returns:
color of class c

getMaxSpeed

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

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

getMaxSpeedDivisor

public int getMaxSpeedDivisor()
Returns the maximum speed divisor.

Returns:
maximum speed divisor

getMinScale

public int getMinScale(int c)
Returns the minimum scale for depicting an edge class.

Parameters:
c - edge class
Returns:
scale of class c

getNumber

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

Returns:
number of edge classes