Package nl.tudelft.simulation.dsol.model
Interface DSOLModel<T extends Number & Comparable<T>,S extends SimulatorInterface<T>>
-
- Type Parameters:
T- the extended type itself to be able to implement a comparator on the simulation time.S- 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-2023 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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidconstructModel()construct a model on a simulator.default StreamInterfacegetDefaultStream()Return the default streams of this model.InputParameterMapgetInputParameterMap()Get the input parameters for this model.List<SimulationStatistic<T>>getOutputStatistics()Get the output statistics for this model.SgetSimulator()Return the simulator for this model.default StreamInterfacegetStream(String streamId)Return a specific stream of this model, based on a stream id, or null when the stream could not be found.StreamInformationgetStreamInformation()Return the available streams of the model stored in a StreamInformation object.default Map<String,StreamInterface>getStreams()Return the streams of this model, mapping stream ids to streams.default voidresetStreams()Reset the streams to their original seed values.voidsetStreamInformation(StreamInformation streamInformation)Set the initial streams of the model based on a StreamInformation object.
-
-
-
Method Detail
-
constructModel
void constructModel() throws SimRuntimeExceptionconstruct 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
void setStreamInformation(StreamInformation streamInformation)
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
default Map<String,StreamInterface> getStreams()
Return the streams of this model, mapping stream ids to streams.- Returns:
- Map<String, StreamInterface>; the streams of this model
-
getStream
default StreamInterface getStream(String streamId)
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
default StreamInterface 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.
-
-