Class Coordinator

    • Constructor Detail

      • Coordinator

        public Coordinator​(SimulationClock clock,
                           Coupled model,
                           boolean flatten)
        Creates a new coordinator with the given simulation clock and model.
        Parameters:
        clock - the simulation clock of the coordinator.
        model - the model to simulate.
        flatten - if true, the model is flattened before simulation.
      • Coordinator

        public Coordinator​(SimulationClock clock,
                           Coupled model)
        Creates a new coordinator with the given simulation clock and model, not flattened.
        Parameters:
        clock - the simulation clock of the coordinator.
        model - the model to simulate.
      • Coordinator

        public Coordinator​(Coupled model,
                           boolean flatten)
        Creates a new coordinator with the given model and whether to flatten it or not.
        Parameters:
        model - the model to simulate.
        flatten - if true, the model is flattened before simulation.
      • Coordinator

        public Coordinator​(Coupled model)
        Creates a new coordinator with the given model, not flattened.
        Parameters:
        model - the model to simulate.
    • Method Detail

      • buildHierarchy

        protected void buildHierarchy()
        Builds the hierarchy of simulators for the model.
      • 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
      • getSimulators

        public Collection<AbstractSimulator> getSimulators()
        Returns the simulators of the components of the model.
        Returns:
        the simulators of the components of the model.
      • 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.
      • propagateOutput

        public void propagateOutput()
        Propagates the output of the model. This method is called after the lambda function of the simulators, and it propagates the output of the models to the input of the components connected to the previuous output ports.
      • 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
      • propagateInput

        public void propagateInput()
        Propagates the input of the model. This method is called before the delta function of the simulators, and it propagates the input of the models to the input of the components connected to the previuous input ports.
      • simInject

        public void simInject​(double e,
                              Port<Object> port,
                              Collection<Object> values)
        Injects a value into the port "port", calling the transition function.
        Parameters:
        e - elapsed time
        port - input port to inject the set of values
        values - set of values to inject
      • simInject

        public void simInject​(Port<Object> port,
                              Collection<Object> values)
        Injects a set of values in the given input port with elapsed time e equal to 0.
        Parameters:
        port - input port to inject the set of values
        values - set of values to inject
      • simInject

        public void simInject​(double e,
                              Port<Object> port,
                              Object value)
        Injects a single value in the given input port with elapsed time e.
        Parameters:
        e - elapsed time
        port - input port to inject the value
        value - value to inject
      • simInject

        public void simInject​(Port<Object> port,
                              Object value)
        Injects a single value in the given input port with elapsed time e equal to 0.
        Parameters:
        port - input port to inject the value
        value - value to inject
      • simulate

        public void simulate​(long numIterations)
        This function is used to simulate the model for a given number of iterations.
        Parameters:
        numIterations - the number of iterations to simulate.
      • simulate

        public void simulate​(double timeInterval)
        This function is used to simulate the model for a given time interval.
        Parameters:
        timeInterval - the time interval to simulate.
      • main

        public static void main​(String[] args)