Class Replication<T extends Number & Comparable<T>>
java.lang.Object
nl.tudelft.simulation.dsol.experiment.Replication<T>
- Type Parameters:
T
- the time type
- All Implemented Interfaces:
Serializable
,Treatment<T>
,Contextualized
- Direct Known Subclasses:
ExperimentReplication
,SingleReplication
public abstract class Replication<T extends Number & Comparable<T>>
extends Object
implements Contextualized, Treatment<T>, Serializable
The base class for a single replication of an Experiment.
Copyright (c) 2002-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 relative types are the same.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final EventType
END_REPLICATION_EVENT is fired when a replication is finished.static final EventType
START_REPLICATION_EVENT is fired when a replication is started.static final EventType
WARMUP_EVENT is fired when the warmup period is over, and statistics have to be reset. -
Constructor Summary
ConstructorDescriptionReplication
(String id, T startTime, T warmupPeriod, T runLength) Construct a stand-alone replication.Replication
(RunControl<T> runControl) Construct a stand-alone replication using a RunControl to store the run information. -
Method Summary
Modifier and TypeMethodDescriptionReturn the RunControl object that contains the treatment information.protected void
setContext
(ContextInterface context) Set the context; method is protected so only subclasses can use this setter.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.Treatment
getDescription, getEndTime, getId, getRunLength, getStartTime, getWarmupPeriod, getWarmupTime, setDescription
-
Field Details
-
START_REPLICATION_EVENT
START_REPLICATION_EVENT is fired when a replication is started. -
END_REPLICATION_EVENT
END_REPLICATION_EVENT is fired when a replication is finished. -
WARMUP_EVENT
WARMUP_EVENT is fired when the warmup period is over, and statistics have to be reset.
-
-
Constructor Details
-
Replication
Construct a stand-alone replication. Checking the validity of the arguments is left to the RunControl object.- Parameters:
id
- String; the id of the replication; should be unique within the experiment.startTime
- T; the start time of the simulation.warmupPeriod
- T; the warmup period, included in the runlength (!)runLength
- T; the total length of the run, including the warm-up period.- Throws:
NullPointerException
- when id, startTime, warmupPeriod or runLength is nullIllegalArgumentException
- when warmup period is negative, or run length is zero or negative, or when a context for the replication cannot be created, or when the warmup time is longer than or equal to the runlength
-
Replication
Construct a stand-alone replication using a RunControl to store the run information.- Parameters:
runControl
- RunControlInterface; the run control for the replication- Throws:
NullPointerException
- when runControl is null
-
-
Method Details
-
getRunControl
Return the RunControl object that contains the treatment information.- Specified by:
getRunControl
in interfaceTreatment<T extends Number & Comparable<T>>
- Returns:
- RunControl; the RunControl object that contains the treatment information
-
setContext
Set the context; method is protected so only subclasses can use this setter.- Parameters:
context
- ContextInterface; set new context
-
getContext
- Specified by:
getContext
in interfaceContextualized
-