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 Details

    • START_REPLICATION_EVENT

      public static final EventType START_REPLICATION_EVENT
      START_REPLICATION_EVENT is fired when a replication is started.
    • END_REPLICATION_EVENT

      public static final EventType END_REPLICATION_EVENT
      END_REPLICATION_EVENT is fired when a replication is finished.
    • WARMUP_EVENT

      public static final EventType WARMUP_EVENT
      WARMUP_EVENT is fired when the warmup period is over, and statistics have to be reset.
  • Constructor Details

    • Replication

      public Replication(String id, T startTime, T warmupPeriod, T runLength)
      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 null
      IllegalArgumentException - 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

      public Replication(RunControl<T> runControl)
      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

      public RunControl<T> getRunControl()
      Return the RunControl object that contains the treatment information.
      Specified by:
      getRunControl in interface Treatment<T extends Number & Comparable<T>>
      Returns:
      RunControl; the RunControl object that contains the treatment information
    • setContext

      protected void setContext(ContextInterface context)
      Set the context; method is protected so only subclasses can use this setter.
      Parameters:
      context - ContextInterface; set new context
    • getContext

      public ContextInterface getContext()
      Specified by:
      getContext in interface Contextualized