jade.core.behaviours
Class DistilledStateChartPerformativeTransition

java.lang.Object
  extended by jade.core.behaviours.DistilledStateChartTransition
      extended by jade.core.behaviours.DistilledStateChartPerformativeTransition
All Implemented Interfaces:
java.io.Serializable

public class DistilledStateChartPerformativeTransition
extends DistilledStateChartTransition

DistilledStateChartPerformativeTransition: transition defined to match a specific performative.

Author:
G. Fortino, F. Rango
See Also:
Serialized Form

Field Summary
 
Fields inherited from class jade.core.behaviours.DistilledStateChartTransition
DEEP_HISTORY, NO_HISTORY, SHALLOW_HISTORY
 
Constructor Summary
DistilledStateChartPerformativeTransition(int aPerformative)
          This constructor assumes that the name and target will be set later.
DistilledStateChartPerformativeTransition(java.lang.Integer aPerformative)
          This constructor uses the Integer version of the performative.
DistilledStateChartPerformativeTransition(java.lang.String aName, jade.core.behaviours.Behaviour tgt, int perf)
          Default constructor.
DistilledStateChartPerformativeTransition(java.lang.String aName, jade.core.behaviours.Behaviour tgt, int history, int perf)
          Constructor that sets also the history.
 
Method Summary
 int getPerformative()
          Return the performative associated with this transition.
 void setPerformative(int p)
          Set the associated performative of this transition.
 boolean trigger(jade.core.behaviours.Behaviour source, jade.lang.acl.ACLMessage msg)
          Trigger that watches for specified performative.
 
Methods inherited from class jade.core.behaviours.DistilledStateChartTransition
action, getHistory, getTarget, getTransitionName, setHistory, setTarget, setTransitionName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistilledStateChartPerformativeTransition

public DistilledStateChartPerformativeTransition(java.lang.String aName,
                                                 jade.core.behaviours.Behaviour tgt,
                                                 int perf)
Default constructor.

Parameters:
aName - the name of the transition.
tgt - the target behaviour.
perf - the performative that we will check.
Throws:
java.lang.RuntimeException - if we are adding a behaviour that has not already been assigned to a DSC.

DistilledStateChartPerformativeTransition

public DistilledStateChartPerformativeTransition(java.lang.String aName,
                                                 jade.core.behaviours.Behaviour tgt,
                                                 int history,
                                                 int perf)
Constructor that sets also the history.

Parameters:
aName - a string name of the transition.
tgt - the target behaviour.
history - history type to use for target state.
perf - the performative that we will check.
Throws:
java.lang.RuntimeException - if we are adding a behaviour that has not already been assigned to a DSC or if we set shallow or deep history and target state isn't a DistilledStateChartBehaviour.

DistilledStateChartPerformativeTransition

public DistilledStateChartPerformativeTransition(int aPerformative)
This constructor assumes that the name and target will be set later.

Parameters:
aPerformative - The performative that we will match.

DistilledStateChartPerformativeTransition

public DistilledStateChartPerformativeTransition(java.lang.Integer aPerformative)
This constructor uses the Integer version of the performative.

Parameters:
aPerformative - The performative that we will match.
Method Detail

trigger

public boolean trigger(jade.core.behaviours.Behaviour source,
                       jade.lang.acl.ACLMessage msg)
Trigger that watches for specified performative.

Overrides:
trigger in class DistilledStateChartTransition
Parameters:
source - The behaviour that is the source of the transition.
msg - The ACLMessage that we check to see if it has a performative match.
Returns:
A boolean indicating that the transition is ready to fire.

getPerformative

public int getPerformative()
Return the performative associated with this transition.

Returns:
The performative.

setPerformative

public void setPerformative(int p)
Set the associated performative of this transition.

Parameters:
p - The new performative.