|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.architecture.traffic.infrastructure.RoaduserFactory
public class RoaduserFactory
This class is used to generate new Roadusers
| Field Summary | |
|---|---|
protected static int[] |
ALL
All roadusers. |
protected static int[] |
AUTOMOBILE
All the roadusers that fit in the Automobile category |
static int |
BICYCLE
All the individual types of each concrete Roaduser |
static int |
BUS
All the individual types of each concrete Roaduser |
static int |
CAR
All the individual types of each concrete Roaduser |
static java.awt.Color[] |
concreteTypeColors
Colors for all concrete Roaduser types, corresponding to the types in concreteTypes. |
static java.lang.String[] |
concreteTypeDescs
Descriptions of all concrete Roaduser types, corresponding to the types in concreteTypes. |
protected static int[] |
concreteTypes
All concrete Roaduser types. |
static float |
PacChance
DOCUMENT ME! |
protected static int[] |
PEDESTRIANS
All the roadusers that move on foot |
protected static java.util.Random |
rnd
DOCUMENT ME! |
static java.lang.String[] |
typeDescs
Descriptions of all possible Roaduser types, corresponding to the types in types. |
static int[] |
types
All possible Roaduser types. |
protected static int[] |
UNMOTORIZED
All the other roadusers that move unmotorized |
static boolean |
UseCustoms
DOCUMENT ME! |
| Method Summary | |
|---|---|
static Roaduser |
genRoaduser(int type)
Generate a new RoadUser |
static Roaduser |
genRoaduser(int type,
Node start,
Node dest,
int pos)
Generate a new RoadUser |
static java.awt.Color |
getColorByType(int type)
Returns the color belonging to the type given. |
static java.lang.String[] |
getConcreteTypeDescs()
Returns descriptions of all concrete types of roadusers. |
static int[] |
getConcreteTypes()
Returns all concrete types of roadusers. |
static java.lang.String |
getDescByConcreteType(int type)
Returns the desc belonging to the concrete type given. |
static java.lang.String |
getDescByStatIndex(int index)
Returns the roaduser description belonging to the given statIndex. |
static java.lang.String |
getDescByType(int type)
Returns the desc belonging to the type given. |
static int |
getNumConcreteTypes()
Returns the number of all concrete types of roadusrs. |
static int |
getNumTypes()
Returns the number of possible types of roadusers. |
static int |
getStatIndexByDesc(java.lang.String desc)
Returns the statIndex belonging to a given roaduser description. |
static int |
getStatIndexByType(int ruType)
DOCUMENT ME! |
protected static int |
getSuperType(int[] types)
DOCUMENT ME! |
static int |
getTypeByDesc(java.lang.String desc)
Seeks the type number of a description of a Roaduser |
static java.lang.String[] |
getTypeDescs()
Returns descriptions of all possible types of roadusers |
static int[] |
getTypes()
Returns all possible types of roadusers |
static int |
ruTypeToStatIndex(int ruType)
Returns the statIndex belonging to a given concrete (!) |
static int |
statArrayLength()
Returns the length a statistics array should have: the number of concrete roadusers plus one (for all roadusers). |
static int |
statIndexToRuType(int index)
Returns the concrete ruType belonging to the given statIndex. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static float PacChance
public static boolean UseCustoms
protected static java.util.Random rnd
public static final int CAR
public static final int BUS
public static final int BICYCLE
protected static final int[] concreteTypes
protected static final int[] ALL
protected static final int[] AUTOMOBILE
protected static final int[] PEDESTRIANS
protected static final int[] UNMOTORIZED
public static final int[] types
public static final java.lang.String[] typeDescs
types.
public static final java.lang.String[] concreteTypeDescs
concreteTypes.
public static final java.awt.Color[] concreteTypeColors
concreteTypes.
| Method Detail |
|---|
public static int[] getTypes()
public static int getNumTypes()
public static java.lang.String[] getTypeDescs()
public static int[] getConcreteTypes()
public static int getNumConcreteTypes()
public static java.lang.String[] getConcreteTypeDescs()
public static Roaduser genRoaduser(int type,
Node start,
Node dest,
int pos)
throws InfraException
type - The type number of the Roaduserstart - The node where the Roadusers should start.dest - The destination node of the Roaduserpos - The position of the Roaduser in its Drivelane
InfraException - If the Roaduser cannot be generated
public static Roaduser genRoaduser(int type)
throws InfraException
type - The type number of the Roaduser
InfraException - If the Roaduser cannot be generatedpublic static int getTypeByDesc(java.lang.String desc)
desc - Description of the Roaduser type.
public static java.lang.String getDescByType(int type)
type - The Roaduser type to return description of.
public static java.lang.String getDescByConcreteType(int type)
type - The Roaduser type to return description of.
public static java.awt.Color getColorByType(int type)
type - DOCUMENT ME!
protected static int getSuperType(int[] types)
types - DOCUMENT ME!
public static int statArrayLength()
public static int getStatIndexByType(int ruType)
ruType - DOCUMENT ME!
public static int ruTypeToStatIndex(int ruType)
ruType - DOCUMENT ME!
public static int statIndexToRuType(int index)
index - DOCUMENT ME!
public static java.lang.String getDescByStatIndex(int index)
index - DOCUMENT ME!
public static int getStatIndexByDesc(java.lang.String desc)
desc - DOCUMENT ME!
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||