Class ConstantSpawningMode
java.lang.Object
org.eclipse.mosaic.fed.mapping.ambassador.spawning.flow.AbstractSpawningMode
org.eclipse.mosaic.fed.mapping.ambassador.spawning.flow.ConstantSpawningMode
- All Implemented Interfaces:
SpawningMode
The default mode of spawning vehicles with constant time gaps
based on a given target flow.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.mosaic.fed.mapping.ambassador.spawning.flow.AbstractSpawningMode
AbstractSpawningMode.DecreaseExponential, AbstractSpawningMode.DecreaseLinear, AbstractSpawningMode.IncreaseExponential, AbstractSpawningMode.IncreaseLinear -
Constructor Summary
ConstructorsConstructorDescriptionConstantSpawningMode(RandomNumberGenerator rng, long start, double spawnsPerHour, Long end) Constructor forConstantSpawningMode. -
Method Summary
Modifier and TypeMethodDescriptionlonggetNextSpawningTime(long currentTime) Returns the next spawning time.booleanisSpawningActive(long currentTime) Determines whether the spawning for the given simulation time is still active.toString()Methods inherited from class org.eclipse.mosaic.fed.mapping.ambassador.spawning.flow.AbstractSpawningMode
noise
-
Constructor Details
-
ConstantSpawningMode
Constructor forConstantSpawningMode.- Parameters:
rng- theRandomNumberGeneratorfor the spawnerstart- spawning start time [ns]spawnsPerHour- the target flow of vehicles to be spawned [veh/hour]end- spawning end time [ns]
-
-
Method Details
-
isSpawningActive
public boolean isSpawningActive(long currentTime) Description copied from interface:SpawningModeDetermines whether the spawning for the given simulation time is still active. Depending on the implementation this can be determined by different metrics.- Specified by:
isSpawningActivein interfaceSpawningMode- Overrides:
isSpawningActivein classAbstractSpawningMode- Parameters:
currentTime- the current simulation time (ns)- Returns:
trueif this spawning mode has still vehicles to spawn
-
getNextSpawningTime
public long getNextSpawningTime(long currentTime) Description copied from interface:SpawningModeReturns the next spawning time. Depending on the implementation this will also set the next spawning time.- Specified by:
getNextSpawningTimein interfaceSpawningMode- Overrides:
getNextSpawningTimein classAbstractSpawningMode- Parameters:
currentTime- the current simulation time (ns)- Returns:
- the next time (ns) a vehicle should be spawned
-
toString
-