jade.core.behaviours
Class DistilledStateChartTemplateTransition

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

public class DistilledStateChartTemplateTransition
extends DistilledStateChartTransition

DistilledStateChartTemplateTransition: transition defined to match a specific MessageTemplate.

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
DistilledStateChartTemplateTransition(java.lang.String aName, jade.core.behaviours.Behaviour tgt, int history, jade.lang.acl.MessageTemplate aTemplate)
          Constructor that sets also the history.
DistilledStateChartTemplateTransition(java.lang.String aName, jade.core.behaviours.Behaviour tgt, jade.lang.acl.MessageTemplate aTemplate)
          Default constructor.
 
Method Summary
 boolean trigger(jade.core.behaviours.Behaviour source, jade.lang.acl.ACLMessage msg)
          Trigger that watches for specified MessageTemplate.
 
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

DistilledStateChartTemplateTransition

public DistilledStateChartTemplateTransition(java.lang.String aName,
                                             jade.core.behaviours.Behaviour tgt,
                                             jade.lang.acl.MessageTemplate aTemplate)
Default constructor. The code requires that the behaviour that you are adding has already been added as a state in the parent DistilledStateChartBehaviour. It will throw a runtime exception if you have not done this.

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

DistilledStateChartTemplateTransition

public DistilledStateChartTemplateTransition(java.lang.String aName,
                                             jade.core.behaviours.Behaviour tgt,
                                             int history,
                                             jade.lang.acl.MessageTemplate aTemplate)
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
aTemplate - the MessageTemplate
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
Method Detail

trigger

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

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 matches.
Returns:
A boolean indicating that the transition is ready to fire.