agentland.util.asker
Class MultimodalAskerAgent
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--metaglue.AgentAgent
|
+--agentland.util.GoodAgent
|
+--agentland.resource.ManagedAgent
|
+--agentland.util.asker.MultimodalAskerAgent
- All Implemented Interfaces:
- Agent, BetterAsker, Good, GoodAsker, Managed, MetagluePrimitives, MultimodalAsker, Remote, Serializable, Spy
- public class MultimodalAskerAgent
- extends ManagedAgent
- implements MultimodalAsker
- See Also:
- Serialized Form
Methods inherited from class agentland.resource.ManagedAgent |
connect, getAlert, getNeed, isAvailable, isAvailable, reliesOn, reliesOn, replace, replace, request, request, request, requestAgent, requestAgent, resources, resourcesByAgentID, setNeed, tiedTo, yank, yank, yank |
Methods inherited from class agentland.util.GoodAgent |
addSpy, addSpy, alert, alertString, beep, error, getHistory, getHistoryElement, getPersistentMap, log, notify, removeSpy, removeSpy, resetHistory, safeRely, safeRely, safeRely, setNiceLogName |
Methods inherited from class metaglue.AgentAgent |
addMonitor, alive, buildEHAFor, defrost, defrostAll, defrostBoolean, defrostInt, defrostString, fixAttribute, fixAttribute, freeze, freeze, freeze, freezeAll, freezeVar, getAgentID, getAttribute, getCatalog, getCatalogID, getDesignation, getFrozenVariables, getLogLevel, getMetaglueAgent, getMetaglueAgentID, getOccupation, getOldLogs, getProperties, getProxyHandlerClass, getSociety, installAPH, log, log, lookupClass, reliesOn, reliesOnSynch, removeAPHFromCatalog, removeFrozen, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, startup, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, toString, whereAreYou |
sAsker
protected BetterAsker sAsker
gAsker
protected BetterAsker gAsker
answers
protected Hashtable answers
holders
protected Hashtable holders
MultimodalAskerAgent
public MultimodalAskerAgent()
throws RemoteException
ask
public Question ask(Question q)
throws RemoteException
- Specified by:
ask
in interface BetterAsker
ask
public int ask(String q)
throws RemoteException
- Asks q, looks for a yes/no/maybe/unknown response
- Specified by:
ask
in interface GoodAsker
ask
public int ask(String q,
int timeout)
throws RemoteException
- Specified by:
ask
in interface GoodAsker
- Parameters:
timeout
- number of seconds until it gives up on your sorry
ass.
askFree
public String askFree(String q)
throws RemoteException
- Ask free response question--this is not all that usefull given
the getDictation method of grammars, but it is better form?
Maybe?
- Specified by:
askFree
in interface GoodAsker
askChoice
public Object askChoice(String question,
Vector options)
throws RemoteException
- Asks a question and accepts one of the options as an answer
- Specified by:
askChoice
in interface GoodAsker
- Parameters:
question
- question to askoptions
- Vector of strings -- possible answers- Returns:
- the answer
askChoice
public Object askChoice(String question,
Vector options,
Object defaultAnswer)
throws RemoteException
- As above but includes a default answer
- Specified by:
askChoice
in interface GoodAsker
testAskChoice
public String testAskChoice()
throws RemoteException
- A testing method
- Specified by:
testAskChoice
in interface MultimodalAsker
dispatchQuestion
protected void dispatchQuestion(Question q)
dispatchQuestion
protected void dispatchQuestion(BetterAsker asker,
Question q)
getAnswer
protected Object getAnswer(String q)
isAnswered
protected boolean isAnswered(String sq)
waitForAnswer
protected void waitForAnswer(String q)
- Waits for an answer to the question; when it is woken up, it
checks if the answer has been given to this question. If so, it
returns, otherwise it waits again.
- Parameters:
q
- The question we are waiting on
tell
public void tell(Secret s)
throws RemoteException
- We are listening to the underling askers--when we hear of a response,
we stash it!
- Specified by:
tell
in interface Spy
- Overrides:
tell
in class GoodAgent
- Following copied from interface:
agentland.util.Spy
- Parameters:
secret
- a Secret
value- Throws:
RemoteException
- if an error occurs
verify
protected void verify(Question q)