Package ca.uqac.lif.cep.fsm
Class ProcessorTransition
java.lang.Object
ca.uqac.lif.cep.fsm.MooreMachine.Transition
ca.uqac.lif.cep.fsm.ProcessorTransition
- All Implemented Interfaces:
ca.uqac.lif.cep.Duplicable
Represents a transition in the Moore machine.
Using this transition actually creates a generalized Moore machine, as
the labels on each
transition are themselves processors: not only can they express
complex conditions on the input event, but they can also have a
state. This was done mainly because it was handy to just use the class
Processor to evaluate conditions (send the event to the processor
and just collect its output), rather than come up with special objects to
do that.
A "classical" Moore machine is a particular case where all processors for expressing the conditions are unary and stateless.
- Author:
- Sylvain Hallé
-
Constructor Summary
ConstructorsConstructorDescriptionProcessorTransition(int destination, ca.uqac.lif.cep.Processor condition) Instantiates a new transitionCreates a new processor transition from another transition.ProcessorTransition(ProcessorTransition pt, boolean with_state) Creates a new processor transition, by copying state from another transition. -
Method Summary
Methods inherited from class ca.uqac.lif.cep.fsm.MooreMachine.Transition
duplicate, modifyContext
-
Constructor Details
-
ProcessorTransition
Creates a new processor transition from another transition.- Parameters:
pt- The transition to copy from
-
ProcessorTransition
Creates a new processor transition, by copying state from another transition.- Parameters:
pt- The transition to copy fromwith_state- The
-
ProcessorTransition
public ProcessorTransition(int destination, ca.uqac.lif.cep.Processor condition) Instantiates a new transition- Parameters:
destination- The state one will be in if the condition evaluates to truecondition- The condition for taking that transition
-
-
Method Details
-
isFired
Description copied from class:MooreMachine.TransitionDetermines if the transition fires for the given input- Overrides:
isFiredin classMooreMachine.Transition- Parameters:
inputs- The input eventscontext- The context for the evaluation- Returns:
trueif the transition fires,falseotherwise
-
getDestination
public int getDestination()Description copied from class:MooreMachine.TransitionGets the destination (i.e. target state) of that transition- Overrides:
getDestinationin classMooreMachine.Transition- Returns:
- The destination state
-
reset
public void reset()Description copied from class:MooreMachine.TransitionResets the state of the transition- Overrides:
resetin classMooreMachine.Transition
-
toString
-
duplicate
- Specified by:
duplicatein interfaceca.uqac.lif.cep.Duplicable- Overrides:
duplicatein classMooreMachine.Transition
-