Class EntityState<A extends org.palladiosimulator.pcm.core.entity.Entity>

  • Type Parameters:
    A - the least common parent type of all actions that are to be traversed
    All Implemented Interfaces:
    IEntityState<A>

    public class EntityState<A extends org.palladiosimulator.pcm.core.entity.Entity>
    extends Object
    implements IEntityState<A>
    This abstract class specifies methods for a stack-like data structure that captures the simulation progress (state) of an EventSimEntity. The organisation as a stack takes into account the potentially hierarchical nesting of actions such as Loops and Branches.

    For each level of hierarchy, there is a stack frame, which holds the state information for the respective level of hierarchy. Only state information contained in the topmost frame are accessible.

    • Constructor Detail

      • EntityState

        public EntityState​(EntityState<A> state)
        Copy constructor.
        Parameters:
        state - the state to be copied
      • EntityState

        public EntityState​(de.uka.ipd.sdq.simucomframework.variables.StackContext stoExContext)
    • Method Detail

      • pushStackFrame

        public void pushStackFrame()
        Pushes an emtpy stack frame onto the stack.
      • popStackFrame

        public void popStackFrame()
        Removes the topmost frame from the stack.
      • isEmpty

        public boolean isEmpty()
        Returns whether the stack is empty.
        Returns:
        true, if the stack is empty; false else
      • size

        public int size()
        Returns:
        the number of stack frames contained in this state's stack
      • getCurrentPosition

        public A getCurrentPosition()
        Description copied from interface: IEntityState
        Returns the current position of the traversal.
        Specified by:
        getCurrentPosition in interface IEntityState<A extends org.palladiosimulator.pcm.core.entity.Entity>
        Returns:
        the action that is being traversed currently
      • setCurrentPosition

        public void setCurrentPosition​(A position)
        Sets the current position of the traversal.
        Specified by:
        setCurrentPosition in interface IEntityState<A extends org.palladiosimulator.pcm.core.entity.Entity>
        Parameters:
        position - the action that is being traversed currently
      • getStoExContext

        public de.uka.ipd.sdq.simucomframework.variables.StackContext getStoExContext()
        Returns the context that is used to evaluate stochastic expressions (StoEx). The context comprises a stack that contains the local variables of service calls. While traversing a ResourceDemandingSEFF, the stack content changes according to the traversal progress.
        Returns:
        the evaluation context for stochastic expressions
      • addProperty

        public void addProperty​(String name,
                                Object property)
        Specified by:
        addProperty in interface IEntityState<A extends org.palladiosimulator.pcm.core.entity.Entity>
      • getProperty

        public <T> T getProperty​(String name,
                                 Class<T> type)
        Specified by:
        getProperty in interface IEntityState<A extends org.palladiosimulator.pcm.core.entity.Entity>