es.upv.dsic.gti_ia.core
Class SingleAgent
java.lang.Object
es.upv.dsic.gti_ia.core.BaseAgent
es.upv.dsic.gti_ia.core.SingleAgent
- All Implemented Interfaces:
- Runnable
public abstract class SingleAgent
- extends BaseAgent
This class defines an new agents template, extending of BaseAgent.
- Author:
- Ricard Lopez Fogues, Sergio Pajares Ferrando, Joan Bellver Faus
| Methods inherited from class es.upv.dsic.gti_ia.core.BaseAgent |
activateTraceService, changeIdentity, deactivateTraceService, execute, finalize, getAid, getName, init, onTraceEvent, run, send, sendTraceEvent, start, terminate |
SingleAgent
public SingleAgent(AgentID aid)
throws Exception
- Creates a new SingleAgent
- Parameters:
aid - Agent Idconnection - Connection the agent will use
- Throws:
Exception - if agent id already exists on the platform
receiveACLMessage
public final ACLMessage receiveACLMessage()
throws InterruptedException
- Receives a AclMessage taking into account a blocking reception
- Returns:
- an ACLMessage
- Throws:
InterruptedException
Exception
onMessage
public void onMessage(ACLMessage msg)
- Every message received will be queued. This method is called automatically by the base class,
which is BaseAgent.
- Overrides:
onMessage in class BaseAgent
- Parameters:
msg - Message received
Copyright © 2012 GTI-IA. All Rights Reserved.