Package ca.uqac.lif.cep.fsm
Class FunctionTransition
- java.lang.Object
-
- ca.uqac.lif.cep.fsm.MooreMachine.Transition
-
- ca.uqac.lif.cep.fsm.FunctionTransition
-
- All Implemented Interfaces:
ca.uqac.lif.cep.Duplicable
- Direct Known Subclasses:
TransitionOtherwise
public class FunctionTransition extends MooreMachine.Transition
Transition for a Moore Machine where the guard is a function returning aboolean
, and the context modification is a list ofContextAssignment
s.- Author:
- Sylvain Hallé
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<ca.uqac.lif.cep.functions.ContextAssignment>
m_assignments
protected int
m_destination
protected ca.uqac.lif.cep.functions.Function
m_function
-
Constructor Summary
Constructors Constructor Description FunctionTransition(FunctionTransition t)
FunctionTransition(ca.uqac.lif.cep.functions.Function function, int destination)
FunctionTransition(ca.uqac.lif.cep.functions.Function function, int destination, ca.uqac.lif.cep.functions.ContextAssignment asg)
FunctionTransition(ca.uqac.lif.cep.functions.Function function, int destination, ca.uqac.lif.cep.functions.ContextAssignment... asgs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FunctionTransition
duplicate(boolean with_state)
int
getDestination()
Gets the destination (i.e.boolean
isFired(java.lang.Object[] input, ca.uqac.lif.cep.Context context)
Determines if the transition fires for the given inputvoid
modifyContext(java.lang.Object[] inputs, java.lang.Object[] outputs, MooreMachine machine)
Modifies the context of the state machinejava.lang.String
toString()
-
Methods inherited from class ca.uqac.lif.cep.fsm.MooreMachine.Transition
duplicate, reset
-
-
-
-
Constructor Detail
-
FunctionTransition
public FunctionTransition(FunctionTransition t)
-
FunctionTransition
public FunctionTransition(ca.uqac.lif.cep.functions.Function function, int destination, ca.uqac.lif.cep.functions.ContextAssignment asg)
-
FunctionTransition
public FunctionTransition(ca.uqac.lif.cep.functions.Function function, int destination, ca.uqac.lif.cep.functions.ContextAssignment... asgs)
-
FunctionTransition
public FunctionTransition(ca.uqac.lif.cep.functions.Function function, int destination)
-
-
Method Detail
-
isFired
public boolean isFired(java.lang.Object[] input, ca.uqac.lif.cep.Context context)
Description copied from class:MooreMachine.Transition
Determines if the transition fires for the given input- Overrides:
isFired
in classMooreMachine.Transition
- Parameters:
input
- The input eventscontext
- The context for the evaluation- Returns:
true
if the transition fires,false
otherwise
-
getDestination
public int getDestination()
Description copied from class:MooreMachine.Transition
Gets the destination (i.e. target state) of that transition- Overrides:
getDestination
in classMooreMachine.Transition
- Returns:
- The destination state
-
modifyContext
public void modifyContext(java.lang.Object[] inputs, java.lang.Object[] outputs, MooreMachine machine)
Description copied from class:MooreMachine.Transition
Modifies the context of the state machine- Overrides:
modifyContext
in classMooreMachine.Transition
- Parameters:
inputs
- The input parameters to the context assignmentoutputs
- The output parameters to the context assignmentmachine
- The Moore machine whose context is to be modified
-
duplicate
public FunctionTransition duplicate(boolean with_state)
- Specified by:
duplicate
in interfaceca.uqac.lif.cep.Duplicable
- Overrides:
duplicate
in classMooreMachine.Transition
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-