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 type
S - 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 Details

    • replicationNr

      final int replicationNr
      the 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 period
      experiment - Experiment; the experiment to which this replication belongs
      replicationNr - int; the replication number within the experiment
      Throws:
      NullPointerException - when id, startTime, warmupPeriod, runLength or experiment is null
      IllegalArgumentException - 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 replication
      experiment - Experiment; the experiment to which this replication belongs
      replicationNr - int; the replication number within the experiment
      Throws:
      NullPointerException - when runControl or experiment is null
  • Method Details

    • getId

      public String 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

      public Experiment<T,S> 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

      public String toString()
      Overrides:
      toString in class Object