|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.bonn.cs.iv.bonnmotion.App
edu.bonn.cs.iv.bonnmotion.Scenario
public class Scenario
Base class for creating new scenarios.
Field Summary | |
---|---|
protected AttractorField |
aField
|
protected double[] |
aFieldParams
|
protected Building[] |
buildings
Buildings |
protected boolean |
circular
|
protected double |
duration
Duration of scenario [s]. |
protected double |
ignore
Length of initial time span which is to be cut off after scenario generation [s]. |
protected boolean |
isTransition
if true generate() first must do transition |
protected java.lang.String |
modelName
Name of the model |
protected MobileNode[] |
node
Mobile nodes. |
protected Scenario |
predecessorScenario
|
protected java.util.Random |
rand
|
protected long |
randomSeed
Random seed to initialise RNG. |
protected int |
transitionMode
|
protected double |
x
Area x length [m]. |
protected double |
y
Area y length [m]. |
Fields inherited from interface edu.bonn.cs.iv.bonnmotion.ScenarioLink |
---|
LINKMODE_FAST, LINKMODE_MOVE |
Constructor Summary | |
---|---|
Scenario()
|
|
Scenario(int nodes,
double x,
double y,
double duration,
double ignore,
long randomSeed)
|
|
Scenario(java.lang.String basename)
|
|
Scenario(java.lang.String[] args,
Scenario _pre,
java.lang.Integer _transitionMode)
|
Method Summary | |
---|---|
void |
cut(double begin,
double end)
Extract a certain time span from the scenario. |
Building[] |
getBuilding()
|
double |
getDuration()
|
double |
getIgnore()
|
java.lang.String |
getModelName()
|
MobileNode[] |
getNode()
|
MobileNode |
getNode(int n)
|
long |
getRandomSeed()
|
double |
getX()
|
double |
getY()
|
void |
go(java.lang.String[] _args)
Main method from where all the magic starts ... |
int |
nodeCount()
|
void |
paramFromFile(java.lang.String _fn)
Does the same job as paramFronFile but w/o showing warnings. |
void |
paramFromFile(java.lang.String _fn,
boolean _warn)
Reads arguments from specific file. |
protected boolean |
parseArg(char key,
java.lang.String val)
|
protected boolean |
parseArg(java.lang.String key,
java.lang.String val)
|
protected void |
postGeneration()
Called by subclasses after they generate node movements. |
protected void |
preGeneration()
Called by subclasses before they generate node movements. |
static void |
printHelp()
|
protected double |
randomNextDouble()
Returns random double form the RandomSeed. |
protected double |
randomNextGaussian()
Returns random Gaussian form the RandomSeed |
Position |
randomNextPosition()
Helper function for creating scenarios. |
Position |
randomNextPosition(double fx,
double fy)
Helper function for creating scenarios. |
void |
read(java.lang.String basename)
Reads the base information of a scenario from a file. |
void |
setDuration(double _duration)
|
void |
setModelName(java.lang.String _modelName)
|
void |
setNode(MobileNode[] _node)
|
Waypoint |
transition(Scenario _pre,
int _mode,
int _nn)
|
Waypoint |
transitionWaypointFast(Waypoint _w)
|
Waypoint |
transitionWaypointMove(Waypoint _w,
int _nn)
|
void |
write(java.lang.String _name)
|
void |
write(java.lang.String basename,
java.lang.String[] params)
Writes the generated scenario and the scenario parameters to files. |
Methods inherited from class edu.bonn.cs.iv.bonnmotion.App |
---|
exceptionHandler, openPrintWriter, parse, parseArg, parseDoubleArray, parseIntArray, parseStringArray, stringArrayConcat |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected MobileNode[] node
protected double x
protected double y
protected double duration
protected double ignore
protected long randomSeed
protected Building[] buildings
protected java.util.Random rand
protected java.lang.String modelName
protected boolean circular
protected double[] aFieldParams
protected AttractorField aField
protected boolean isTransition
protected int transitionMode
protected Scenario predecessorScenario
Constructor Detail |
---|
public Scenario()
public Scenario(int nodes, double x, double y, double duration, double ignore, long randomSeed)
public Scenario(java.lang.String basename) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public Scenario(java.lang.String[] args, Scenario _pre, java.lang.Integer _transitionMode)
Method Detail |
---|
protected double randomNextDouble()
protected double randomNextGaussian()
protected boolean parseArg(char key, java.lang.String val)
parseArg
in class App
protected boolean parseArg(java.lang.String key, java.lang.String val)
protected void preGeneration()
protected void postGeneration()
public void cut(double begin, double end)
public void go(java.lang.String[] _args)
App
go
in class App
App.go(String[])
public static void printHelp()
public java.lang.String getModelName()
getModelName
in interface Model
public void setModelName(java.lang.String _modelName)
public double getDuration()
public Building[] getBuilding()
public MobileNode[] getNode()
public MobileNode getNode(int n)
public double getX()
public double getY()
public double getIgnore()
public long getRandomSeed()
public void setNode(MobileNode[] _node)
public int nodeCount()
public void paramFromFile(java.lang.String _fn) throws java.io.FileNotFoundException, java.io.IOException
_fn
- Filename
java.io.FileNotFoundException
java.io.IOException
paramFromFile(String _fn)
public void paramFromFile(java.lang.String _fn, boolean _warn) throws java.io.FileNotFoundException, java.io.IOException
_fn
- Filename_warn
- if warnings should be shown during parsing
java.io.FileNotFoundException
java.io.IOException
public void read(java.lang.String basename) throws java.io.FileNotFoundException, java.io.IOException
basename
- Basename of the scenario
java.io.FileNotFoundException
java.io.IOException
public void setDuration(double _duration)
public void write(java.lang.String _name) throws java.io.FileNotFoundException, java.io.IOException
write
in interface Model
java.io.FileNotFoundException
java.io.IOException
public void write(java.lang.String basename, java.lang.String[] params) throws java.io.FileNotFoundException, java.io.IOException
basename
- Basename of the output files
java.io.FileNotFoundException
java.io.IOException
public Position randomNextPosition()
public Position randomNextPosition(double fx, double fy)
public Waypoint transition(Scenario _pre, int _mode, int _nn) throws ScenarioLinkException
transition
in interface ScenarioLink
ScenarioLinkException
public Waypoint transitionWaypointFast(Waypoint _w)
transitionWaypointFast
in interface ScenarioLink
public Waypoint transitionWaypointMove(Waypoint _w, int _nn)
transitionWaypointMove
in interface ScenarioLink
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |