fr.lifl.jedi.model.interactionDeclaration
Class AbstractInteraction<Targets>

java.lang.Object
  extended by fr.lifl.jedi.model.interactionDeclaration.AbstractInteraction<Targets>
Direct Known Subclasses:
DegenerateInteraction, MultipleTargetInteraction, SingleTargetInteraction

public abstract class AbstractInteraction<Targets>
extends java.lang.Object

The parent class of all interactions in JEDI.

An interaction is a set of action primitives that a source agent may initiate if particular conditions are met. These condition is defined in two parts :

Version:
JEDI V 2.2
Created the 4th may 2009
Author:
Yoann Kubera
SMAC Team (Systèmes Multi-Agents et Comportement)
LIFL (Laboratoire d'Informatique Fondamentale de Lille)
University of Lille, France

Constructor Summary
AbstractInteraction()
           
 
Method Summary
 boolean canPerform(Environment environment, Agent source, Targets target)
          This method returns true if the agent in parameter can perform the interaction, i.e.
abstract  void perform(Environment environment, Agent source, Targets target)
          Describes the action sequence of this interaction.
abstract  boolean preconditions(Environment environment, Agent source, Targets target)
          Physical or logical possibility to perform the interaction.
abstract  boolean trigger(Environment environment, Agent source, Targets target)
          Implicit or explicit motivation to perform the interaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractInteraction

public AbstractInteraction()
Method Detail

trigger

public abstract boolean trigger(Environment environment,
                                Agent source,
                                Targets target)
Implicit or explicit motivation to perform the interaction.

Thus, the actions of the interaction will achieve or reduce this motivation.

For instance "To be hungry" is the trigger of an "Eat" interaction.

Parameters:
environment - The environment where the interaction occurs.
source - The source agent that initiates the interaction.
target - The target agent that undergoes the interaction
Returns:
true if the triggering conditions are met.

preconditions

public abstract boolean preconditions(Environment environment,
                                      Agent source,
                                      Targets target)
Physical or logical possibility to perform the interaction.

For instance : "To have a key" is a precondition of an "Unlock" interaction.

Parameters:
environment - The environment where the interaction occurs.
source - The source agent that initiates the interaction.
target - The target agent that undergoes the interaction
Returns:
true if the conditions are met.

perform

public abstract void perform(Environment environment,
                             Agent source,
                             Targets target)
Describes the action sequence of this interaction.

Parameters:
environment - The environment where the interaction occurs.
source - The source agent that initiates the interaction.
target - The target agent that undergoes the interaction.

canPerform

public boolean canPerform(Environment environment,
                          Agent source,
                          Targets target)
This method returns true if the agent in parameter can perform the interaction, i.e. if condition(environment, source) == true and trigger(environment, source) == true.

Parameters:
environment - The environment where the interaction occurs.
source - The source agent that initiates the interaction.
target - This parameter in not used in degenerate interactions
Returns:
true if the agent in parameter can perform the interaction.