edu.bonn.cs.iv.bonnmotion.models
Class ManhattanGrid

java.lang.Object
  extended by edu.bonn.cs.iv.bonnmotion.App
      extended by edu.bonn.cs.iv.bonnmotion.Scenario
          extended by edu.bonn.cs.iv.bonnmotion.models.ManhattanGrid
All Implemented Interfaces:
Model, ScenarioLink

public class ManhattanGrid
extends Scenario

Manhattan Grid mobility scenario.


Field Summary
protected  double maxPause
          Maximum pause time [s].
protected  double meanSpeed
          Mobile's mean speed [m/s].
protected  double minSpeed
          Mobile's minimum speed [m/s].
protected  double pauseProb
          Probability for the mobile to pause (every updateDist m), given it does not change it's speed.
protected  double speedChangeProb
          Probability for the mobile to change its speed (every updateDist m).
protected  double speedStdDev
          Standard deviation of normally distributed random speed [m/s].
protected  double turnProb
          Probability for the mobile to turn at a crossing.
protected  double updateDist
          Distance interval in which to possibly update the mobile's speed [m].
protected  int xblocks
          Number of blocks on x-axis.
protected  double xdim
          Size of a block on x-axis, calculated from xblocks.
protected  int yblocks
          Number of blocks on y-axis.
protected  double ydim
          Size of a block on y-axis, calculated from yblocks.
 
Fields inherited from class edu.bonn.cs.iv.bonnmotion.Scenario
aField, aFieldParams, buildings, circular, duration, ignore, isTransition, modelName, node, predecessorScenario, rand, randomSeed, transitionMode, x, y
 
Fields inherited from interface edu.bonn.cs.iv.bonnmotion.ScenarioLink
LINKMODE_FAST, LINKMODE_MOVE
 
Constructor Summary
ManhattanGrid(int nodes, double x, double y, double duration, double ignore, long randomSeed, int xblocks, int yblocks, double updateDist, double turnProb, double speedChangeProb, double meanSpeed, double minSpeed, double speedStdDev, double pauseProb, double maxPause)
           
ManhattanGrid(java.lang.String[] args)
           
ManhattanGrid(java.lang.String[] args, Scenario _pre, java.lang.Integer _transitionMode)
           
 
Method Summary
 Position alignPos(Position pos)
           
 void generate()
           
 Position getNewPos(Position src, double dist, int dir)
           
 void go(java.lang.String[] args)
          Main method from where all the magic starts ...
protected  boolean mustTurn(Position pos, int dir)
           
 boolean nodeAddErrorHandler(int i, double t, Position dst)
           
 boolean outOfBounds(Position pos)
           
protected  boolean parseArg(char key, java.lang.String val)
           
protected  boolean parseArg(java.lang.String key, java.lang.String value)
           
static void printHelp()
           
 Waypoint transitionWaypointFast(Waypoint _w)
           
 void write(java.lang.String _name)
           
 
Methods inherited from class edu.bonn.cs.iv.bonnmotion.Scenario
cut, getBuilding, getDuration, getIgnore, getModelName, getNode, getNode, getRandomSeed, getX, getY, nodeCount, paramFromFile, paramFromFile, postGeneration, preGeneration, randomNextDouble, randomNextGaussian, randomNextPosition, randomNextPosition, read, setDuration, setModelName, setNode, transition, transitionWaypointMove, write
 
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

xblocks

protected int xblocks
Number of blocks on x-axis.


yblocks

protected int yblocks
Number of blocks on y-axis.


updateDist

protected double updateDist
Distance interval in which to possibly update the mobile's speed [m].


turnProb

protected double turnProb
Probability for the mobile to turn at a crossing.


speedChangeProb

protected double speedChangeProb
Probability for the mobile to change its speed (every updateDist m).


meanSpeed

protected double meanSpeed
Mobile's mean speed [m/s].


minSpeed

protected double minSpeed
Mobile's minimum speed [m/s].


speedStdDev

protected double speedStdDev
Standard deviation of normally distributed random speed [m/s].


pauseProb

protected double pauseProb
Probability for the mobile to pause (every updateDist m), given it does not change it's speed.


maxPause

protected double maxPause
Maximum pause time [s].


xdim

protected double xdim
Size of a block on x-axis, calculated from xblocks.


ydim

protected double ydim
Size of a block on y-axis, calculated from yblocks.

Constructor Detail

ManhattanGrid

public ManhattanGrid(int nodes,
                     double x,
                     double y,
                     double duration,
                     double ignore,
                     long randomSeed,
                     int xblocks,
                     int yblocks,
                     double updateDist,
                     double turnProb,
                     double speedChangeProb,
                     double meanSpeed,
                     double minSpeed,
                     double speedStdDev,
                     double pauseProb,
                     double maxPause)

ManhattanGrid

public ManhattanGrid(java.lang.String[] args)

ManhattanGrid

public ManhattanGrid(java.lang.String[] args,
                     Scenario _pre,
                     java.lang.Integer _transitionMode)
Method Detail

go

public void go(java.lang.String[] args)
Description copied from class: App
Main method from where all the magic starts ...

Overrides:
go in class Scenario
See Also:
App.go(String[])

generate

public void generate()

parseArg

protected boolean parseArg(java.lang.String key,
                           java.lang.String value)
Overrides:
parseArg in class Scenario

outOfBounds

public boolean outOfBounds(Position pos)

mustTurn

protected boolean mustTurn(Position pos,
                           int dir)

alignPos

public Position alignPos(Position pos)

getNewPos

public Position getNewPos(Position src,
                          double dist,
                          int dir)

nodeAddErrorHandler

public boolean nodeAddErrorHandler(int i,
                                   double t,
                                   Position dst)

write

public void write(java.lang.String _name)
           throws java.io.FileNotFoundException,
                  java.io.IOException
Specified by:
write in interface Model
Overrides:
write in class Scenario
Throws:
java.io.FileNotFoundException
java.io.IOException

parseArg

protected boolean parseArg(char key,
                           java.lang.String val)
Overrides:
parseArg in class Scenario

printHelp

public static void printHelp()

transitionWaypointFast

public Waypoint transitionWaypointFast(Waypoint _w)
Specified by:
transitionWaypointFast in interface ScenarioLink
Overrides:
transitionWaypointFast in class Scenario