Class SimulationExperiment

    • Constructor Detail

      • SimulationExperiment

        public SimulationExperiment()
    • Method Detail

      • init

        protected void init()
        Description copied from class: Experiment
        This method is called to perform any initializations required before the experiment is run.
        Overrides:
        init in class Experiment
      • initSim

        protected void initSim()
      • createSimComponents

        protected void createSimComponents()
      • performRun

        protected void performRun()
        Description copied from class: Experiment
        Contains the code to actually do something useful. This is the only abstract method that sub-classes are required to implement.
        Specified by:
        performRun in class Experiment
      • toSimTime

        public double toSimTime​(Duration d)
        Converts a given Java Duration (i.e., a time span) to the corresponding (relative) simulation time.
        Specified by:
        toSimTime in interface SimOperations
        Parameters:
        d - The duration to be converted to simulation time.
        Returns:
        The amount of simulation time.
        See Also:
        Simulation.toSimTime(Duration)
      • setSimulationLength

        public void setSimulationLength​(double simulationLength)
        Sets the maximum simulation time. A value of 0.0 means no such limit.
        Parameters:
        simulationLength - Stop simulation at this point in time.
      • getSimulationLength

        public double getSimulationLength()
      • setStatsResetTime

        public void setStatsResetTime​(double statsResetTime)
        Sets the statistics reset time. When this time is reached then the resetStats() methods of all components will be called. Statistics reset methods will also be executed once before the simulation starts (independently from this setting).
        Parameters:
        statsResetTime - The time when to call all statics reset methods.
      • getStatsResetTime

        public double getStatsResetTime()
      • getInitialSimTime

        public double getInitialSimTime()
      • setInitialSimTime

        public void setInitialSimTime​(double initialSimTime)
        Sets the starting time for the simulation clock.
      • addInitAction

        public void addInitAction​(Consumer<Simulation> action)
        Adds a Consumer<Simulation> that is called after creating the simulation components to perform additional initialization tasks.
      • getSimTimeStartInstant

        public Instant getSimTimeStartInstant()
      • setSimTimeStartInstant

        public void setSimTimeStartInstant​(Instant simTimeStartInstant)
      • getSimTimeToMillisFactor

        public long getSimTimeToMillisFactor()
      • setSimTimeToMillisFactor

        public void setSimTimeToMillisFactor​(long simTimeToMillisFactor)
      • setModelRoot

        public void setModelRoot​(SimComponent rootComponent)