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 TypeMethodDescriptionlong
getNextSpawningTime
(long currentTime) Returns the next spawning time.boolean
isSpawningActive
(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
- theRandomNumberGenerator
for 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:SpawningMode
Determines whether the spawning for the given simulation time is still active. Depending on the implementation this can be determined by different metrics.- Specified by:
isSpawningActive
in interfaceSpawningMode
- Overrides:
isSpawningActive
in classAbstractSpawningMode
- Parameters:
currentTime
- the current simulation time (ns)- Returns:
true
if this spawning mode has still vehicles to spawn
-
getNextSpawningTime
public long getNextSpawningTime(long currentTime) Description copied from interface:SpawningMode
Returns the next spawning time. Depending on the implementation this will also set the next spawning time.- Specified by:
getNextSpawningTime
in interfaceSpawningMode
- Overrides:
getNextSpawningTime
in classAbstractSpawningMode
- Parameters:
currentTime
- the current simulation time (ns)- Returns:
- the next time (ns) a vehicle should be spawned
-
toString
-