at.borkowski.scovillej.simulation

Interface Simulation

  • All Known Implementing Classes:
    SimulationImpl


    public interface Simulation
    Represents a simulation. A simulation is a series of events, which have a notion of virtual time called ticks. Ticks are separated into phases. Each tick is processed by processing each of its phases. The order of phases is consistent throughout the simulation. The total number of ticks is pre-defined for a simulation (see getTotalTicks()). A simulation has a collection of members, represented by SimulationMember objects, which are called for each phase in each tick. Members may interact by using service objects, however, the services must make sure that no communication is allowed during one phase. Furthermore, a simulation provides its members with a possibility of recording values for profiling, called series. The series results can later be obtained via getSeries(String, Class).
    • Field Detail

      • TICK_PHASE

        static final String TICK_PHASE
        The name of the main phase, the tick phase. Each simulation is guaranteed to have this phase. It is used to denote the "default" phase, ie. the phase where the first-class-citizen members are supposed to perform their action. Members providing services and auxiliary members are encouraged to use their own phases.
        See Also:
        Constant Field Values
    • Method Detail

      • executeToEnd

        void executeToEnd()
        Executes the simulation from the current tick until the total number of ticks defined (see getTotalTicks()).
      • executeCurrentTick

        void executeCurrentTick()
        Executes the current tick. This method may only be called if the simulation has not executed the current tick yet. Otherwise, an IllegalStateException is thrown.
      • executeAndIncreaseTick

        void executeAndIncreaseTick()
        Executes the current tick and advanced to the next tick. This method may only be called if the simulation has not executed the current tick yet. Otherwise, an IllegalStateException is thrown.
      • getCurrentTick

        long getCurrentTick()
        Returns the current tick. This tick is either ready for processing ( executedCurrentTick() is false) or has already been processed ( executedCurrentTick() is true).
        Returns:
        the current tick
      • increaseTick

        void increaseTick()
        Advances to the next tick. This method may only be called if the simulation has already executed the current tick. If this method is called and the simulation has finished processing the last tick, no action is taken. See increaseTickStrictly() for a version where this behavior is different.
      • increaseTickStrictly

        void increaseTickStrictly()
        Advances to the next tick. This method may only be called if the simulation has already executed the current tick. If this method is called and the simulation has finished processing the last tick, IllegalStateException is thrown. See increaseTickStrictly() for a version where this behavior is different.
      • executedCurrentTick

        boolean executedCurrentTick()
        Determines whether the current tick has been prepared (return value is false) or has already been processed (returned value is true).
        Returns:
        whether the current tick has already been processed
      • executeUpToTick

        void executeUpToTick(long tick)
        Executes the simulation up to the given tick, stopping at this tick in a non-processed state (executedCurrentTick() is false).
        Parameters:
        tick - the tick to stop before
      • getTotalTicks

        long getTotalTicks()
        Returns the number of ticks this simulation has been configured to process.
        Returns:
        the total number of ticks for this simulation
      • getSeries

        <T> SeriesResult<T> getSeries(String symbol,                              Class<T> clazz)
        Returns the series result for a given series. Note that while this method may be called mid-simulation and will return correct results for the current tick, advancing by ticks may render the returned object unusable or have it provide invalid results. Generally, the returned object is value only until the next advancing in the simulation. If the symbol is not known of the class does not match the originally created series, null is returned.
        Type Parameters:
        T - the type of series to reutrn
        Parameters:
        symbol - the symbol to return the series result for
        clazz - the class of the series
        Returns:
        the series result
      • getPhases

        List<String> getPhases()
        Returns the phases used in this simulation.
        Returns:
        the phases used in this simulation.

Copyright © 2015. All rights reserved.



NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14