Class MooreMachine.Transition

  • All Implemented Interfaces:
    ca.uqac.lif.cep.Duplicable
    Direct Known Subclasses:
    FunctionTransition, ProcessorTransition
    Enclosing class:
    MooreMachine

    public static class MooreMachine.Transition
    extends java.lang.Object
    implements ca.uqac.lif.cep.Duplicable
    Represents a transition in the Moore machine
    Author:
    Sylvain Hallé
    • Constructor Detail

      • Transition

        public Transition()
        Creates a new transition
      • Transition

        public Transition​(MooreMachine.Transition t)
        Copies a transition from another transition
        Parameters:
        t - The transition to copy from
    • Method Detail

      • isFired

        public boolean isFired​(java.lang.Object[] inputs,
                               ca.uqac.lif.cep.Context context)
        Determines if the transition fires for the given input
        Parameters:
        inputs - The input events
        context - The context for the evaluation
        Returns:
        true if the transition fires, false otherwise
      • reset

        public void reset()
        Resets the state of the transition
      • modifyContext

        public void modifyContext​(java.lang.Object[] inputs,
                                  java.lang.Object[] outputs,
                                  MooreMachine machine)
        Modifies the context of the state machine
        Parameters:
        inputs - The input parameters to the context assignment
        outputs - The output parameters to the context assignment
        machine - The Moore machine whose context is to be modified
      • getDestination

        public int getDestination()
        Gets the destination (i.e. target state) of that transition
        Returns:
        The destination state
      • duplicate

        public final MooreMachine.Transition duplicate()
        Specified by:
        duplicate in interface ca.uqac.lif.cep.Duplicable
      • duplicate

        public MooreMachine.Transition duplicate​(boolean with_state)
        Specified by:
        duplicate in interface ca.uqac.lif.cep.Duplicable