|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectAgent
edu.udo.cs.ie.cowbots.agent.CowbotAgent
public class CowbotAgent
cowbots customisation of jason's agent class. this class integrates the cowbot bdi extensions into jason.
Nested Class Summary | |
---|---|
(package private) class |
CowbotAgent.SimState
|
Field Summary | |
---|---|
(package private) java.lang.String |
agconfBRFCLASS
|
(package private) boolean |
agconfMSGsocAcc
|
(package private) boolean |
agconfNoDelib
|
(package private) java.util.List<java.lang.String> |
agconfNoRevisePrograms
|
(package private) java.util.List<java.lang.String> |
agconfPrograms
|
(package private) java.util.HashMap<java.lang.String,java.lang.String> |
agconfUserPrograms
|
(package private) java.lang.String |
agDir
|
(package private) java.lang.String |
agName
|
(package private) boolean |
agstateReset
|
(package private) java.lang.String |
agTemp
|
(package private) int |
agTime
|
(package private) IActionComponent |
cowAction
|
(package private) DeliberationComponent |
cowDelib
|
(package private) DesireComponent |
cowDesGen
|
(package private) CRevisionComponent |
cowRevision
|
(package private) ICowbotUI |
cowUI
|
(package private) DLV |
dlv
|
(package private) boolean |
fix_GenerateBeliefChangeEvents
|
(package private) boolean |
fix_MessageEvent
|
(package private) boolean |
fix_NoMotivation
|
(package private) boolean |
fix_UseDefaultSelectEvent
|
(package private) boolean |
fix_UseDefaultSelectIntention
|
(package private) boolean |
fix_UseDefaultSelectOption
|
(package private) java.util.List<Literal> |
initalKnowledge
|
(package private) java.util.logging.Logger |
intLog
|
(package private) java.util.logging.Logger |
log
|
(package private) java.lang.String |
logDir
|
(package private) boolean |
loggingEnabled
|
(package private) boolean |
optAllInfo
|
(package private) boolean |
optDelibNoIntentionRestart
|
(package private) boolean |
optProcessMessageInSocAcc
|
(package private) CowbotAgent.SimState |
simstate
|
Constructor Summary | |
---|---|
CowbotAgent()
|
Method Summary | |
---|---|
void |
abolish(Literal bel,
Unifier un)
|
java.util.List<Literal>[] |
brf(Literal beliefToAdd,
Literal beliefToDel,
Intention i)
belief revision function. called by jason for belief addtion or deletion. |
void |
buf(java.util.List<Literal> percepts)
belief update function, called whenever an agent perceives information about its environment. whenever new perceptions are avail, the cowbotrevision fetches the environmental update, and the desire generation is invoked to update an agent's desires. at last, a dummy event is fired to force the jason interpreter to step into the event selection, where deliberation takes place. |
protected Event |
createDummyEvent()
|
void |
eventAdded(Event arg0)
|
IActionComponent |
getActionSelection()
this method returns an instance to the action selection |
DeliberationComponent |
getCowDelib()
|
DesireComponent |
getCowDesires()
returns the desire generator of this cowbot agent |
DLV |
getDLV()
getter to access dlv |
IEpistemicState |
getEpistemicState()
getter to receive epistemic state |
java.lang.String |
getLogDirectory()
returns a path to the agents log directory. |
java.lang.String |
getTemporaryDirectory()
returns a path to an agent's local working directory. the path is absolute and ends with an "/". |
ICowbotUI |
getUI()
this method returns an instance to a cowbot ui |
private void |
initAgFromXML(java.lang.String filename,
java.lang.String agName)
this methods loads an agents configuration from an xml file |
void |
initBDI(Settings stts,
java.lang.String agName)
this method initializes the cowbot extensions. the configuration options are taken from the user settings in the mas2j file. |
void |
intentionAdded(Intention arg0)
|
void |
intentionDropped(Intention arg0)
|
void |
intentionResumed(Intention i)
|
void |
intentionSuspended(Intention i,
java.lang.String reason)
|
protected void |
onNewPercepts(java.util.List<Literal> percepts)
main handler for handling percepts send from an environment |
protected void |
onSimulationEnd(java.util.List<Literal> per)
this method handles end of simulation events. the agent is put into a reset-state and won't accept new messages unless it receives a simulation start event. |
protected void |
onSimulationStart(java.util.List<Literal> percepts)
this method is used to setup an agent for a simulation. during lifetime of an agent, he may assume that each simulation id is unique. so receiving the same simulation multiple times, he should not reinitialize himself again. |
protected void |
runDelib()
|
Event |
selectEvent(java.util.Queue<Event> events)
|
Intention |
selectIntention(java.util.Queue<Intention> intentions)
|
Message |
selectMessage(java.util.Queue<Message> messages)
this method selects a message from an agent's message queue and return it to the transition system. in our implementation. it additionally checks any message if it represents a message with a logical program in that case, the message is handled by the revision system. |
Option |
selectOption(java.util.List<Option> options)
|
boolean |
socAcc(Message m)
this method is used to let an agent decide if it accepts or rejects an incoming message from other agents. in our implementation, we accept all messages by default. if the message contains a specific header (first literal is messagecontent/1), then the message is stored into the elp belief base. otherwise, the message is passed down to jason's interpreter for further processing. |
protected void |
syncJasonBB(boolean createEvents)
this method synchronizes the logical belief set with jason's belief base. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
CRevisionComponent cowRevision
DesireComponent cowDesGen
DeliberationComponent cowDelib
IActionComponent cowAction
ICowbotUI cowUI
java.util.List<Literal> initalKnowledge
DLV dlv
java.lang.String agTemp
java.lang.String agDir
java.lang.String agName
java.util.logging.Logger log
java.util.logging.Logger intLog
java.lang.String logDir
boolean fix_GenerateBeliefChangeEvents
boolean fix_UseDefaultSelectIntention
boolean fix_UseDefaultSelectEvent
boolean fix_UseDefaultSelectOption
boolean fix_MessageEvent
boolean fix_NoMotivation
boolean optProcessMessageInSocAcc
boolean optDelibNoIntentionRestart
boolean optAllInfo
int agTime
boolean loggingEnabled
java.util.List<java.lang.String> agconfPrograms
java.util.List<java.lang.String> agconfNoRevisePrograms
java.util.HashMap<java.lang.String,java.lang.String> agconfUserPrograms
boolean agconfNoDelib
boolean agconfMSGsocAcc
java.lang.String agconfBRFCLASS
boolean agstateReset
CowbotAgent.SimState simstate
Constructor Detail |
---|
public CowbotAgent()
Method Detail |
---|
public void initBDI(Settings stts, java.lang.String agName) throws java.lang.Exception
stts
- user settings
java.lang.Exception
private void initAgFromXML(java.lang.String filename, java.lang.String agName)
string
- agName2
- public void buf(java.util.List<Literal> percepts)
protected void onNewPercepts(java.util.List<Literal> percepts)
percepts
- protected void onSimulationStart(java.util.List<Literal> percepts)
percepts
- protected void onSimulationEnd(java.util.List<Literal> per)
per
- percepts containing the end of simulation datapublic java.util.List<Literal>[] brf(Literal beliefToAdd, Literal beliefToDel, Intention i) throws RevisionFailedException
RevisionFailedException
protected void syncJasonBB(boolean createEvents)
public Event selectEvent(java.util.Queue<Event> events)
public Option selectOption(java.util.List<Option> options)
public Intention selectIntention(java.util.Queue<Intention> intentions)
public IEpistemicState getEpistemicState()
ICowbot
getEpistemicState
in interface ICowbot
public boolean socAcc(Message m)
public Message selectMessage(java.util.Queue<Message> messages)
public DeliberationComponent getCowDelib()
getCowDelib
in interface ICowbot
public DLV getDLV()
ICowbot
getDLV
in interface ICowbot
public IActionComponent getActionSelection()
ICowbot
getActionSelection
in interface ICowbot
public java.lang.String getLogDirectory()
ICowbot
getLogDirectory
in interface ICowbot
public java.lang.String getTemporaryDirectory()
ICowbot
getTemporaryDirectory
in interface ICowbot
public ICowbotUI getUI()
ICowbot
getUI
in interface ICowbot
public void eventAdded(Event arg0)
public void intentionAdded(Intention arg0)
public void intentionSuspended(Intention i, java.lang.String reason)
public void intentionResumed(Intention i)
public void intentionDropped(Intention arg0)
protected void runDelib()
protected Event createDummyEvent()
public void abolish(Literal bel, Unifier un) throws RevisionFailedException
RevisionFailedException
public DesireComponent getCowDesires()
ICowbot
getCowDesires
in interface ICowbot
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |