modelling
Class CommunicatingAgent
java.lang.Object
sema.Element
sema.Agent
modelling.CommunicatingAgent
- All Implemented Interfaces:
- Communicating, java.lang.Comparable
- public class CommunicatingAgent
- extends Agent
- implements Communicating
Agent able to communicate with other agents.
| 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 |
CommunicatingAgent
public CommunicatingAgent(World world,
Area area,
float delay,
java.awt.Image image)
setNextAnswer
protected boolean setNextAnswer(java.lang.String question,
Communicating speaker)
- It computes the answer to give back from the 'question' of the speaker,
if it decides no to answer it return false,
else it return true and preselect the answer to give the next time we open the mouth
( action of the discussion )
getCurrentDiscussion
public Communicating.Discussion getCurrentDiscussion()
- Returns the current discussion.
- Specified by:
getCurrentDiscussion in interface Communicating
setCurrentDiscussion
protected void setCurrentDiscussion(CommunicatingAgent.Discussion speech)
- Allows to set the current discussion.
hear
public boolean hear(java.lang.String speech,
Communicating speaker)
- Receipts the speaker's words. Calls
setNextAnswer to determinate the answer.
Resumes eventually the current discussion.
- Specified by:
hear in interface Communicating