modelling
Class ReceptiveAgent
java.lang.Object
sema.Element
sema.Agent
modelling.ReceptiveAgent
- All Implemented Interfaces:
- java.lang.Comparable, Receptive
- public class ReceptiveAgent
- extends Agent
- implements Receptive
Agent able to receive signals.
|
Field Summary |
protected java.util.TreeMap |
sigToAction
Known signals and actions corresponding. |
|
Constructor Summary |
ReceptiveAgent(World world,
Area area,
float delay,
java.awt.Image image)
Creates a new agent able to catch signals, with the same parameters than agent. |
|
Method Summary |
protected boolean |
canCatch(Signal sig)
Determinates whether the agent is currentyle able to receive this signal. |
void |
receiveSignal(Signal sig)
Receives a signal.
|
protected void |
sigToAction(Signal sig)
Executes the corresponding action.
|
| Methods inherited from class sema.Element |
canTake, compareTo, death, draw, getArea, getDrawingPriority, getHeight, getIcon, getImage, getKind, getName, getProperties, highlight, highlight, isMarked, kill, setDrawingPriority, setHeight, setKind, setMarked, setProperties, toString, union |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
sigToAction
protected java.util.TreeMap sigToAction
- Known signals and actions corresponding.
ReceptiveAgent
public ReceptiveAgent(World world,
Area area,
float delay,
java.awt.Image image)
- Creates a new agent able to catch signals, with the same parameters than agent.
canCatch
protected boolean canCatch(Signal sig)
- Determinates whether the agent is currentyle able to receive this signal.
sigToAction
protected void sigToAction(Signal sig)
- Executes the corresponding action.
If signal is unknown, does nothing.
receiveSignal
public void receiveSignal(Signal sig)
- Receives a signal.
Eventually dismisses it if cannot be catch (canCatch method).
- Specified by:
receiveSignal in interface Receptive