Class StreamSeedUpdater
java.lang.Object
nl.tudelft.simulation.dsol.experiment.StreamSeedUpdater
- All Implemented Interfaces:
Serializable
,StreamUpdater
StreamSeedUpdater updates the streams based on a stored map of replication numbers to seed numbers.
Copyright (c) 2021-2024 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:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the fallback stream updater in case the stream or the replication is not in the seed map.Return the available seed maps for all stored streams, mapping stream ids to seed maps.void
setFallbackStreamUpdater
(StreamUpdater fallbackStreamUpdater) Set a new fallback stream updater in case the stream or the replication is not in the seed map.void
updateSeed
(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
-
Constructor Details
-
StreamSeedUpdater
Construct a new StreamSeedUpdater object an initialize it with the seed map.- Parameters:
streamSeedMap
- Map<String, Map<Integer, Long>>; the stored seed maps
-
-
Method Details
-
updateSeed
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:
updateSeed
in 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
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
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
-
getStreamSeedMap
Return the available seed maps for all stored streams, mapping stream ids to seed maps.- Returns:
- Map<String, Map<Integer, Long>>; the stored seed maps
-