public interface PolicyAgentInterface extends Observer
Modifier and Type | Method and Description |
---|---|
Status |
abclEval(Cons cons,
Map<String,LispObject> lispBindings) |
Status |
abclEval(String c,
Map<String,LispObject> lispBindings) |
Status |
abclEval(String c,
Map<String,LispObject> newEnvBindings,
AgentUI ui) |
void |
addTransformation(Transformation trans) |
void |
bump() |
SocialCommitment |
chooseSC(Collection<SocialCommitment> SocialCommitments) |
void |
defer(Runnable runnable)
Can be used to defer a section of code for later execution during the
agent's idle time.
|
void |
dequeueEvent(Event event)
Remove the event from the agent's event queue
|
PerformDescriptor |
dispatchMsgHandlerMethod(String consider,
Act act,
MLMessage message) |
PerformDescriptor |
evesdrop(MLMessage msg)
This is the catch-all method called when
ProcessOptions.observeMessages
is set true and the handler method (the regular method concatenated with
"_evesdrop") is not found. |
Status |
executeCommand(String command,
AgentUI ui) |
CasaKB |
getKnowledgeBase() |
String |
getName() |
Ontology |
getOntology() |
ProcessOptions |
getOptions() |
SocialCommitmentsStore |
getSCStore() |
Event[] |
getSubscribeEvents(Event event) |
Transformation |
getTransformationFor(Describable d) |
String |
getUniqueRequestID() |
URLDescriptor |
getURL()
Returns the URL of the current process
|
boolean |
getUseAckProtocol()
Retrieves whether this agent will use the the Ack (acknowledge) protocol.
|
boolean |
isA(Act s1,
Act s2) |
boolean |
isA(Act s1,
String s2) |
boolean |
isA(String s1,
Act s2) |
boolean |
isA(String s1,
String s2) |
boolean |
isAAct(Act a1,
Act a2) |
boolean |
isAPerformative(MLMessage msg,
String p2) |
boolean |
isAPerformative(String p1,
String p2) |
boolean |
isLoggingTag(String tag) |
void |
notifyObservers(String string,
Object policy) |
String |
println(String traceTag,
String txt)
Debugging or error method: Uses the
Trace object to log the string
if appropriate (i.e.: the traceTAg matches a tag that's turned on in the
Trace object. |
String |
println(String traceTag,
String txt,
Status tempStatus)
Same as
println(String, String) but appends
tempStatus.getExplanation(). |
String |
println(String traceTag,
String txt,
Throwable ex)
Same as
println(String, String) but appends ex.toString() and
prints a stack trace after. |
void |
queueEvent(Event event)
Put the Event on the agent's event queue.
|
void |
queueEventIf(Event event)
Put the Event on the agent's event queue
iff the event is not already on the queue.
|
Describable |
revTransform(Describable d) |
String |
revTransform(String d) |
Status |
sendMessage(MLMessage message)
Sends the message to the the message.receiver or, if
message.receiver is missing or empty, to message.to.
|
Describable |
transform(Describable d) |
String |
transform(String d) |
Status abclEval(String c, Map<String,LispObject> lispBindings)
Status abclEval(Cons cons, Map<String,LispObject> lispBindings)
ProcessOptions getOptions()
String getUniqueRequestID()
boolean isLoggingTag(String tag)
String getName()
Ontology getOntology()
SocialCommitmentsStore getSCStore()
String println(String traceTag, String txt)
Trace
object to log the string
if appropriate (i.e.: the traceTAg matches a tag that's turned on in the
Trace object.traceTag
- The txt String will be logged if the traceTag
matches a tag that's turned on in the Trace object.txt
- The String to be loggedString println(String traceTag, String txt, Throwable ex)
println(String, String)
but appends ex.toString() and
prints a stack trace after.traceTag
- The txt String will be logged if the traceTag
matches a tag that's turned on in the Trace object.txt
- The String to be loggedex
- An Exception objectString println(String traceTag, String txt, Status tempStatus)
println(String, String)
but appends
tempStatus.getExplanation().traceTag
- The txt String will be logged if the traceTag
matches a tag that's turned on in the Trace object.txt
- The String to be loggedtempStatus
- A Status objectURLDescriptor getURL()
Status sendMessage(MLMessage message)
message
- MLMessage of the message being sent, which
contains the info about the recipient in the receiver
or to fields.boolean getUseAckProtocol()
PerformDescriptor dispatchMsgHandlerMethod(String consider, Act act, MLMessage message)
void defer(Runnable runnable)
x
- some Runnable to executeCasaKB getKnowledgeBase()
PerformDescriptor evesdrop(MLMessage msg)
ProcessOptions.observeMessages
is set true and the handler method (the regular method concatenated with
"_evesdrop") is not found. Subclasses should override this to implement
the desired behaviour. This implementation does nothing but return a
PerformDescriptor
with a #DROP_ACTION
Status, which
indicates no action should be taken.msg
- An incoming message that is not addressed to this agent.void queueEvent(Event event)
event
- The event to queue.void queueEventIf(Event event)
event
- The event to queue.void dequeueEvent(Event event)
event
- The event to dequeue.SocialCommitment chooseSC(Collection<SocialCommitment> SocialCommitments)
unmarked
- a set of SocialCommitments to choose one fromvoid addTransformation(Transformation trans)
Transformation getTransformationFor(Describable d)
Describable transform(Describable d)
Describable revTransform(Describable d)
void bump()