Class ExperimentReplication<T extends Number & Comparable<T>,S extends SimulatorInterface<T>>
java.lang.Object
nl.tudelft.simulation.dsol.experiment.Replication<T>
nl.tudelft.simulation.dsol.experiment.ExperimentReplication<T,S>
- Type Parameters:
T
- the time typeS
- the simulator type
- All Implemented Interfaces:
Serializable
,Treatment<T>
,Contextualized
public class ExperimentReplication<T extends Number & Comparable<T>,S extends SimulatorInterface<T>>
extends Replication<T>
A single replication belonging to 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 TypeFieldDescription(package private) final int
the replication number within the experiment.Fields inherited from class nl.tudelft.simulation.dsol.experiment.Replication
END_REPLICATION_EVENT, START_REPLICATION_EVENT, WARMUP_EVENT
-
Constructor Summary
ConstructorDescriptionExperimentReplication
(String id, T startTime, T warmupPeriod, T runLength, Experiment<T, S> experiment, int replicationNr) Construct a replication to be used in an experiment.ExperimentReplication
(RunControl<T> runControl, Experiment<T, S> experiment, int replicationNr) Construct a replication to be used in an experiment, using a RunControl to store the run information. -
Method Summary
Modifier and TypeMethodDescriptionExperiment<T,
S> Return the experiment to which this replication belongs.getId()
Return the id of this replication.int
Return the replication number within the experiment.void
Remove the entire experiment tree from the context.protected void
Set the context for this replication.toString()
Methods inherited from class nl.tudelft.simulation.dsol.experiment.Replication
getContext, getRunControl, setContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface nl.tudelft.simulation.dsol.experiment.Treatment
getDescription, getEndTime, getRunLength, getStartTime, getWarmupPeriod, getWarmupTime, setDescription
-
Field Details
-
replicationNr
final int replicationNrthe replication number within the experiment.
-
-
Constructor Details
-
ExperimentReplication
public ExperimentReplication(String id, T startTime, T warmupPeriod, T runLength, Experiment<T, S> experiment, int replicationNr) Construct a replication to be used in an experiment.- 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 periodexperiment
- Experiment; the experiment to which this replication belongsreplicationNr
- int; the replication number within the experiment- Throws:
NullPointerException
- when id, startTime, warmupPeriod, runLength or experiment is nullIllegalArgumentException
- when warmup period is negative, or run length is zero or negative, or when the warmup time is longer than or equal to the runlength, or when a context for the replication cannot be created
-
ExperimentReplication
public ExperimentReplication(RunControl<T> runControl, Experiment<T, S> experiment, int replicationNr) Construct a replication to be used in an experiment, using a RunControl to store the run information.- Parameters:
runControl
- RunControlInterface; the run control for the replicationexperiment
- Experiment; the experiment to which this replication belongsreplicationNr
- int; the replication number within the experiment- Throws:
NullPointerException
- when runControl or experiment is null
-
-
Method Details
-
getId
Return the id of this replication.- Returns:
- String; the id of this replication
-
setContext
protected void setContext()Set the context for this replication.- Throws:
IllegalArgumentException
- in case a context for the replication cannot be created
-
removeFromContext
public void removeFromContext()Remove the entire experiment tree from the context. -
getExperiment
Return the experiment to which this replication belongs.- Returns:
- experiment Experiment; experiment to which this replication belongs.
-
getReplicationNr
public int getReplicationNr()Return the replication number within the experiment.- Returns:
- replicationNr int; the replication number within the experiment
-
toString
-