Class StreamSeedUpdater
- java.lang.Object
-
- nl.tudelft.simulation.dsol.experiment.StreamSeedUpdater
-
- All Implemented Interfaces:
Serializable,StreamUpdater
public class StreamSeedUpdater extends Object implements StreamUpdater
StreamSeedUpdater updates the streams based on a stored map of replication numbers to seed numbers.Copyright (c) 2021-2023 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information DSOL Manual. The DSOL project is distributed under a three-clause BSD-style license, which can be found at DSOL License.
- Author:
- Alexander Verbraeck
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StreamUpdatergetFallbackStreamUpdater()Return the fallback stream updater in case the stream or the replication is not in the seed map.Map<String,Map<Integer,Long>>getStreamSeedMap()Return the available seed maps for all stored streams, mapping stream ids to seed maps.voidsetFallbackStreamUpdater(StreamUpdater fallbackStreamUpdater)Set a new fallback stream updater in case the stream or the replication is not in the seed map.voidupdateSeed(String streamId, StreamInterface stream, int replicationNumber)Update one seed for the given streamId and replication number.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface nl.tudelft.simulation.dsol.experiment.StreamUpdater
updateSeeds
-
-
-
-
Method Detail
-
updateSeed
public void updateSeed(String streamId, StreamInterface stream, int replicationNumber)
Update one seed for the given streamId and replication number. The method should be fully reproducible, and can be based on the previous seed value of the stream, possibly the String representation, and the replication number.- Specified by:
updateSeedin interfaceStreamUpdater- Parameters:
streamId- String; the id of the stream to updatestream- StreamInterface; the stream to update for this replicationreplicationNumber- int; the replication number for which to set the seed value
-
getFallbackStreamUpdater
public StreamUpdater getFallbackStreamUpdater()
Return the fallback stream updater in case the stream or the replication is not in the seed map.- Returns:
- fallbackStreamUpdater StreamUpdater; the fallback stream updater in case the stream or the replication is not in the seed map.
-
setFallbackStreamUpdater
public void setFallbackStreamUpdater(StreamUpdater fallbackStreamUpdater)
Set a new fallback stream updater in case the stream or the replication is not in the seed map.- Parameters:
fallbackStreamUpdater- StreamUpdater; the new fallback stream updater in case the stream or the replication is not in the seed map.- Throws:
NullPointerException- when fallbackStreamUpdater is null
-
-