Class Simulator

  • Direct Known Subclasses:
    SimulatorDistributed, SimulatorProfile

    public class Simulator
    extends AbstractSimulator
    This class represents a parallel DEVS simulator, in xDEVS style. The simulator is responsible for the simulation of a DEVS model, and it is composed of a simulation clock and the model to simulate. The simulator is responsible for the initialization, execution and termination of the simulation.
    • Field Detail

      • model

        protected Atomic model
        The model to simulate.
    • Constructor Detail

      • Simulator

        public Simulator​(SimulationClock clock,
                         Atomic model)
        Creates a new simulator with the given simulation clock and model.
        Parameters:
        clock - the simulation clock of the simulator.
        model - the model to simulate.
    • Method Detail

      • initialize

        public void initialize()
        Description copied from class: AbstractSimulator
        Initializes the simulator and the associated model. This is not part of the DEVS formalism, but it is a necessary step to prepare the simulator for the simulation.
        Specified by:
        initialize in class AbstractSimulator
      • exit

        public void exit()
        Description copied from class: AbstractSimulator
        This is a special function, out of the DEVS formalism, that allows to realize some actions when the simulation ends.
        Specified by:
        exit in class AbstractSimulator
      • ta

        public double ta()
        Description copied from class: AbstractSimulator
        Executes the time advance mechanism of the DEVS simulation.
        Specified by:
        ta in class AbstractSimulator
        Returns:
        the new DEVS sigma.
      • deltfcn

        public void deltfcn()
        Description copied from class: AbstractSimulator
        Executes one of the transition functions of the DEVS simulation, depending on the current state of the model and whether there are new events or not.
        Specified by:
        deltfcn in class AbstractSimulator