Package nl.tudelft.simulation.dsol.model
Interface DsolModel<T extends Number & Comparable<T>,S extends SimulatorInterface<T>>
- Type Parameters:
T
- the time typeS
- the simulator to use
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractDsolModel
public interface DsolModel<T extends Number & Comparable<T>,S extends SimulatorInterface<T>>
extends Serializable
The model interface defines the model object. Since version 2.1.0 of DSOL, the DsolModel now knows its simulator and can
return it to anyone interested. Through the Simulator, the Replication can be requested and through that the Experiment and
the Treatment under which the simulation is running.
Copyright (c) 2003-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://https://simulation.tudelft.nl/dsol/docs/latest/license.html.
- Author:
- Alexander Verbraeck
-
Method Summary
Modifier and TypeMethodDescriptionvoid
construct a model on a simulator.default StreamInterface
Return the default streams of this model.Get the input parameters for this model.Get the output statistics for this model.Return the simulator for this model.default StreamInterface
Return a specific stream of this model, based on a stream id, or null when the stream could not be found.Return the available streams of the model stored in a StreamInformation object.default Map<String,
StreamInterface> Return the streams of this model, mapping stream ids to streams.default void
Reset the streams to their original seed values.void
setStreamInformation
(StreamInformation streamInformation) Set the initial streams of the model based on a StreamInformation object.
-
Method Details
-
constructModel
construct a model on a simulator.- Throws:
SimRuntimeException
- on model construction failure
-
getSimulator
S getSimulator()Return the simulator for this model.- Returns:
- the simulator for the model
-
getInputParameterMap
InputParameterMap getInputParameterMap()Get the input parameters for this model.- Returns:
- List<InputParameter> the input parameters for this model
-
getOutputStatistics
List<SimulationStatistic<T>> getOutputStatistics()Get the output statistics for this model.- Returns:
- List<StatisticsInterface> the output statistics for this model
-
setStreamInformation
Set the initial streams of the model based on a StreamInformation object. This method can be called right after the construction of the model object, or just before the model is constructed.
Note 1: If a model is run as part of an Experiment, the seeds of the random streams will be reset just before the call to constructModel(), so do not call this method from constructModel(), as it will reset the seeds to their initial values, and undo the seed management of the Experiment.
Note 2: The original streams are copied into the model, so they are not cloned (as the streams do not implement cloneable, and as they have inner state that needs to be preserved). So be careful with manipulating the streams in the streamInformation object afterward.- Parameters:
streamInformation
- StreamInformation; the streams that have been prepared in a StreamInformation class- Throws:
NullPointerException
- when streamInformation is null
-
getStreamInformation
StreamInformation getStreamInformation()Return the available streams of the model stored in a StreamInformation object.- Returns:
- streamInformation StreamInformation; the streams that have been prepared in a StreamInformation class
-
getStreams
Return the streams of this model, mapping stream ids to streams.- Returns:
- Map<String, StreamInterface>; the streams of this model
-
getStream
Return a specific stream of this model, based on a stream id, or null when the stream could not be found.- Parameters:
streamId
- String; the id of the stream to be retrieved- Returns:
- StreamInterface the stream, or null when the stream could not be found
- Throws:
NullPointerException
- when streamId is null
-
getDefaultStream
Return the default streams of this model.- Returns:
- StreamInterface; the default stream of this model
-
resetStreams
default void resetStreams()Reset the streams to their original seed values.
-