public interface TransientAgentInterface extends ProcessInterface, PolicyAgentInterface
Copyright: Copyright 2003-2014, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Modifier and Type | Method and Description |
---|---|
Status |
doAdvertise(URLDescriptor yp,
ServiceDescriptor service)
This method is called when this agent wishes to advertises a service.
|
StatusMLMessageList |
doCDGetHistory_sync(URLDescriptor cdURL)
Retrieves the history list from a cooperation domain.
|
Status |
doCDGetMembers(URLDescriptor cd)
Attempts to retrieve the list of participants in a the specified cooperation domain.
|
Status |
doCDPutData(URLDescriptor cdURL,
DataStorageDescriptor dsd)
Attempts to store data with a Cooperation Domain.
|
StatusURLDescriptorList |
doFindInstances_sync(String pattern) |
Vector |
doGetCooperationDomains(URLDescriptor cds)
Retrieves the list of URLDescriptor's from a cooperation domain server.
|
Status |
doGetOnology(URLDescriptor url,
String GET_PERFORMATIVESorGET_ACTS,
String typeName)
Sends a message to retrieve information about the performatives in the
performative type library of another agent.
|
Status |
doInviteToCD(URLDescriptor agent,
URLDescriptor cd,
boolean sense)
Requests an agent to join a particular cooperation domain.
|
Status |
doJoinCD(URLDescriptor cd)
Join a cooperation domain.
|
URLDescriptor |
doPing_sync(URLDescriptor agent,
long timeout)
Pings another agent synchronously.
|
Status |
doPing(URLDescriptor agent,
long timeout)
Pings another agent.
|
Status |
doRegisterAgentInstance(int lacPort) |
Status |
doRegisterAgentInstance(int port,
RunnableWithParameter<MLMessage> successAction,
RunnableWithParameter<MLMessage> failureAction)
Registers with the LAC that this Agent is running.
|
StatusURLDescriptorList |
doSearchYP(URLDescriptor yp,
ServiceDescriptor service)
Attempts to search a yellow pages service for a agents matching a particular
service descriptor.
|
Status |
doUnadvertise(URLDescriptor yp,
ServiceDescriptor service)
This method is called when this agent wishes to withdraw a previously
advertised service from a yellow pages service.
|
Status |
doUnregisterAgentInstance(boolean request)
Unregisters this Agent from the LAC.
|
Status |
doUnregisterAgentType(int port)
Unregisters this Agent type from the LAC's permanent registry.
|
Status |
doWithdrawCD(URLDescriptor cd,
boolean request)
Withdraw from a cooperation domain.
|
Status |
executeCommand(String command,
AgentUI ui)
Used to execute a command string at runtime.
|
StatusURLDescriptorList |
getInstancesFound() |
Set<URLDescriptor> |
getJoinedCooperationDomains() |
URLDescriptor |
getLACURL()
Returns the URL of the LAC the agent is registered to.
|
Vector<URLDescriptor> |
getMembers(URLDescriptor cd) |
Ontology |
getOntology()
Returns the performatives hierarchy for this agent.
|
ProcessOptions |
getOptions()
Returns a reference to this object's
ProcessOptions object. |
String |
getSerializedOntology()
Returns the String (persistent) representation of the performatives hierarchy
for this agent.
|
JComponent |
getStrategyGUI()
Returns a GUI that can be used to interact with the strategy of this agent.
|
boolean |
hasStrategyGUI()
Used to determine if the agent's strategy has a GUI.
|
boolean |
isAAct(Act a1,
Act a2) |
boolean |
isInitialized() |
boolean |
isRegistered()
If the Agent is registered to a LAC returns true.
|
AgentUI |
makeDefaultInterface(String[] args,
boolean GUI)
Returns a default AgentUI.
|
Status |
putExtendedOntology(String perfHierarchy)
Add the persistent TypeHierarchy data in perfHierarchy to this
agent's performative hierarchy.
|
Status |
putReplacementOntology(String types)
Replace this agent's type performative hierarchy with the persistent
TypeHierarchy data in types.
|
void |
putUI(AgentUI ui)
A creating process should call this to let the agent know of any user interface
it has attached to the agent.
|
PerformDescriptor |
release_get_ontology(MLMessage msg)
Handles get.performative replies from another agent.
|
void |
removeCooperationDomains(URLDescriptor url) |
Status |
requestInstances(String pattern) |
void |
setOptions(ProcessOptions options)
Sets this object's ProcessOptions object.
|
void |
updateOptions()
Save the options to a persistent database.
|
addObserver, addObserver, closePort, deleteObserver, deleteObserver, exit, getAgentName, getName, getNewMessage, getPort, getStrategy, getTrace, getUniqueRequestID, getURL, getUseAckProtocol, hasOpenPort, isA, isAPerformative, isExiting, isLoggingTag, isStoppable, isTracing, println, println, println, realizeAgentBehaviourFromOptions, sendMessage, setTracing, setUseAckProtocol, startTraceMonitor
addObserver, addObserver, countObservers, deleteObservers, hasChanged, notifyObservers, notifyObservers, notifyObserversWithNoArg, notifyObserversWithTop
abclEval, abclEval, abclEval, addTransformation, bump, chooseSC, defer, dequeueEvent, dispatchMsgHandlerMethod, evesdrop, getKnowledgeBase, getName, getSCStore, getSubscribeEvents, getTransformationFor, getUniqueRequestID, getURL, getUseAckProtocol, isA, isA, isA, isA, isAPerformative, isAPerformative, isLoggingTag, notifyObservers, println, println, println, queueEvent, queueEventIf, revTransform, revTransform, sendMessage, transform, transform
Status doRegisterAgentInstance(int port, RunnableWithParameter<MLMessage> successAction, RunnableWithParameter<MLMessage> failureAction)
lac
- URLDescriptor for the LAC to register with.Status doRegisterAgentInstance(int lacPort)
Status doUnregisterAgentInstance(boolean request)
request
- true
if the message will be a request;
false
if it is to be an inform.Status doUnregisterAgentType(int port)
StatusURLDescriptorList doFindInstances_sync(String pattern)
boolean isRegistered()
boolean isInitialized()
Set<URLDescriptor> getJoinedCooperationDomains()
Vector<URLDescriptor> getMembers(URLDescriptor cd)
void removeCooperationDomains(URLDescriptor url)
StatusURLDescriptorList getInstancesFound()
URLDescriptor getLACURL()
Vector doGetCooperationDomains(URLDescriptor cds)
cds
- CDSexception
Status doJoinCD(URLDescriptor cd)
If this agent is already in the cooperation domain, observers are notified of this.
cd
- URLDescriptor of the cooperation domain to joincds
- URLDescriptor of the cooperation domain server to be set as the server for the
URLdesciptor cdStatus doWithdrawCD(URLDescriptor cd, boolean request)
If this agent is already in the cooperation domain, observers are notified of this.
cd
- URLDescriptor of the cooperation domain to joinrequest
- true
if the message will be a request;
false
if it is to be an inform.Status doCDPutData(URLDescriptor cdURL, DataStorageDescriptor dsd)
dsd
- The data descriptor of the data to be storedcd
- The URLDescriptor of the cooperation domain.CDDataException
- If the data cannot be successfully stored with the CD.StatusMLMessageList doCDGetHistory_sync(URLDescriptor cdURL)
getDataCD
.url
- The URLDescriptor of the CD from which to retrieve the history listCDDataException
- If the retrieval failsStatus doCDGetMembers(URLDescriptor cd)
cd
- The URLDescriptor of the CD.CDException
- If the retrieval fails.Status doAdvertise(URLDescriptor yp, ServiceDescriptor service)
yp
- URLDescriptor of the agent advertising the serviceservice
- ServiceDescriptor of the service being advertisedStatus doUnadvertise(URLDescriptor yp, ServiceDescriptor service)
yp
- URLDescriptor of the agent advertising the serviceservice
- ServiceDescriptor of the service being withdrawnStatusURLDescriptorList doSearchYP(URLDescriptor yp, ServiceDescriptor service)
yp
- The URLDescriptor of the YP to searchservice
- A (perhaps partial) ServiceDescriptor description of a
service that the YP should match its advertisements againstYPexception
- If the retrieval fails.AgentUI makeDefaultInterface(String[] args, boolean GUI)
args
- The command line argumentsuserName
- The name of the uservoid putUI(AgentUI ui)
ui
- the user interface to be attached to the agent.Status doInviteToCD(URLDescriptor agent, URLDescriptor cd, boolean sense)
agent
- Agent this agent is requesting the join the CD.cd
- The CD the agent should join.Status doPing(URLDescriptor agent, long timeout)
URLDesciptor
agent by sending a message of the format:
performative | request |
act | ping |
#handleReply_ping(MLMessage)
to do the actual processing of the
returned reply.agent
- URLDescriptor of the agent to pingtimeout
- maxiumum time (in milliseconds) to wait for the ping
responseException
- if there is an error sending the messageURLDescriptor doPing_sync(URLDescriptor agent, long timeout)
URLDesciptor
agent by sending a message of the format:
performative | request |
act | ping |
performative | reply |
act | ping |
agent
- URLDescriptor of the agent to pingtimeout
- maxiumum time (in milliseconds) to wait for the ping
responseException
- if there is an error sending the messageProcessOptions getOptions()
ProcessInterface
ProcessOptions
object.getOptions
in interface PolicyAgentInterface
getOptions
in interface ProcessInterface
ProcessOptions
object.void setOptions(ProcessOptions options)
ProcessInterface
setOptions
in interface ProcessInterface
options
- void updateOptions()
ProcessInterface
updateOptions
in interface ProcessInterface
Status doGetOnology(URLDescriptor url, String GET_PERFORMATIVESorGET_ACTS, String typeName)
performative | request | |
act | get.performatives | |
language | identifier | may be missing if performativeName is null |
content | performativeName | null | blank or missing requests all performative information |
#handleReply_GetPerformatives(MLMessage)
.url
- The URLDescriptor of an agent to request performative information fromGET_PERFORMATIVESorGET_ACTS
- either the act name GET_PERFORMATIVES or GET_ACTStypeName
- the name of the performative, or null to request a complete description of url's performativesPerformDescriptor release_get_ontology(MLMessage msg)
performative | reply |
act | get.performatives |
language | casa.TypeHierarchy |
content | a description of the requested performative(s) conforming to casa.TypeHierarchy |
AbstractProcess.???
??msg
- the incoming get.members request messageString getSerializedOntology()
Ontology getOntology()
getOntology
in interface PolicyAgentInterface
Status putExtendedOntology(String perfHierarchy)
perfHierarchy
- A String containing the persistent for of a TypeHierarchyStatus putReplacementOntology(String types)
types
- A String containing the persistent for of a TypeHierarchyStatus executeCommand(String command, AgentUI ui)
executeCommand
in interface PolicyAgentInterface
command
- a command stringui
- an AgentUI
object (may be null).Status
object with the result of the attempted execution.JComponent getStrategyGUI()
null
value if hasStrategyGUI() returns
false
.JPanel
that is the GUI responsible for interacting
with this agent's strategy.boolean hasStrategyGUI()
boolean isAAct(Act a1, Act a2)
isAAct
in interface PolicyAgentInterface