|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.lifl.magique.AbstractAgent
fr.lifl.magique.AtomicAgent
fr.lifl.magique.Agent
This class defines particular agent : the Magique agent. They are defined through a refinement of the AtomicAgent simply by changing the skills known at creation. This class allows to create basic agent (specialist) and supervisor (leader of group). Agents are organized via a hierarchic structure: a supervisor manages some other agents (basic or other supervisors - with own team) called its team. A team contains inofrmation about its memeber abilities. Task achievement can require ability/skills that agent does not have. Therefore the agent must ask someone else to achieve it. Then to achieve a task following process is applied :
Agent,
Skill,
MagiqueDefaultSkill,
BossTeamSkill,
Platform,
Request| Field Summary |
| Fields inherited from class fr.lifl.magique.AtomicAgent |
allKnownSkills, monitor, myConcurrencyPolicy, mySkills, unsentRequests |
| Fields inherited from class fr.lifl.magique.AbstractAgent |
questionTable, toDo, verboseLevel |
| Constructor Summary | |
Agent()
|
|
Agent(java.lang.String name)
|
|
| Method Summary | |
void |
addSkill(java.lang.Object newSkill)
Add all the methods of the object newSkill to the agent |
void |
addSkill(java.lang.String n)
Add all the methods of the object newSkill to the agent |
void |
broadcastToAll(Request request)
broadcasts an order (request without answer) to everybody under me. |
void |
broadcastToBasis(Request request)
broadcasts an order (request without answer) to a basic agent of my hierarchy. |
void |
concurrentPerform(Request request)
treat a concurrent request : if the agent knows the method, he applies it, else he sends the request to all those in his team who knows the method, else he sends it to its supervisor |
void |
connectToBoss(java.lang.String bossName)
connect this agent to another one as his boss |
protected java.lang.String |
getMyBoss()
|
protected Team |
getMyTeam()
|
protected MessageList |
getUnsentRequests()
|
protected void |
initBasicSkills()
defines the skills known by the agent at creation. |
protected boolean |
isBasis()
|
protected boolean |
isBigBoss()
|
protected boolean |
isBoss()
|
void |
perform(Request request)
treat a request : if the agent knows the method, he applies it, else if someone in his team knows the method, he sends him the request, else he sends this to its supervisor |
void |
removeSkill(java.lang.String key)
Remove the "key" from the hashtable of skills. |
void |
send(java.lang.String to,
Message msg)
send a request to to through the platform if needed If to is unknown, boss is asked to forward request. |
void |
send(java.lang.String to,
Request request)
|
void |
sendUnsentRequestToBoss()
sends unsent requests to my boss, it is used just after connection to boss has been performed |
protected void |
sendUp(Request request)
sends a request to my boss (supervisor) |
void |
setAction(MagiqueActionSkill action)
changes the action skill that corresponds to the proactive part of the agent |
| Methods inherited from class fr.lifl.magique.AtomicAgent |
addSkill, connectTo, getAllKnownSkills, getPlatform, giveSkillClassNameFromSignature, initialize, interprete, myMethodsNames, processRequest, removeSkillFromClassName, sendMessage, setAction, setConcurrencyPolicy, setPlatform, start, treatUnsentRequests |
| Methods inherited from class fr.lifl.magique.AbstractAgent |
addAgenda, ask, ask, ask, ask, ask, ask, ask, ask, ask, ask, ask, ask, ask, ask, askNow, askNow, askNow, askNow, askNow, askNow, askNow, askNow, askNow, askNow, askNow, askNow, askNow, askNow, concurrentAsk, concurrentAsk, concurrentAsk, concurrentAsk, concurrentAsk, concurrentAsk, concurrentAsk, createOrder, createOrder, createOrder, createOrder, createOrder, createOrder, createQuestion, createQuestion, createQuestion, createQuestion, createQuestion, createQuestion, createQuestion, createQuestion, forgetQuestion, getAgenda, getAnswerer, getListener, getName, getQuestionTable, getToDo, getVerboseLevel, isAnswerReceived, perform, perform, perform, perform, perform, perform, perform, perform, perform, perform, perform, perform, perform, processAnswer, returnAnswer, returnValue, setName, setQuestionTable, setVerboseLevel, stopListener, verbose |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Agent()
public Agent(java.lang.String name)
name - =
shortname : identifier for my name (platform hostname and port
number are added)| Method Detail |
protected MessageList getUnsentRequests()
getUnsentRequests in class AtomicAgent
protected void initBasicSkills()
throws SkillAlreadyAcquiredException
initBasicSkills in class AtomicAgentSkillAlreadyAcquiredException - if agent tries to learn an already known skillprotected boolean isBigBoss()
protected boolean isBoss()
protected boolean isBasis()
protected Team getMyTeam()
protected java.lang.String getMyBoss()
public void addSkill(java.lang.String n)
throws SkillAlreadyAcquiredException
addSkill in class AtomicAgentn - the class used that contains new skills to be added.
SkillAlreadyAcquiredException - if newSkill contains a method with the same
signature as another already known
public void addSkill(java.lang.Object newSkill)
throws SkillAlreadyAcquiredException
AtomicAgent
addSkill in class AtomicAgentnewSkill - the new skills to be added. Each method of the object newSkill,
is added to the agent.
SkillAlreadyAcquiredException - if newSkill contains a method with the same
signature as another already known
public void removeSkill(java.lang.String key)
throws SkillNotKnownException
removeSkill in class AtomicAgentkey - a string representing the method's signature to be removed.
SkillNotKnownException - if key is not a knwon method signaturepublic void connectToBoss(java.lang.String bossName)
bossName - the name of my boss (of the form "name@hostname:rmiport")
public void send(java.lang.String to,
Request request)
send in class AtomicAgent
public void send(java.lang.String to,
Message msg)
send in class AtomicAgentto - name of recipient (name can be short name)Serializableprotected void sendUp(Request request)
request - the request to be sentpublic void sendUnsentRequestToBoss()
public void broadcastToBasis(Request request)
request - the sent requestpublic void broadcastToAll(Request request)
request - the sent requestpublic void perform(Request request)
perform in class AtomicAgentrequest - the request to be treated
public void concurrentPerform(Request request)
concurrentPerform in class AtomicAgentrequest - the request to be treated
public void setAction(MagiqueActionSkill action)
action - the new action skill, it must inherit ActionSkillActionSkill
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||