|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.agentfactory.cldc.logic.RoleLibrary
public class RoleLibrary
The role library contains the role templates that the agent will instantiate under various circumstances. In AFME, each agent may have several role templates. Additionally, each template may have several instances. The role library contains and manages the hash table of role templates and the hash table of role instances.
| Constructor Summary | |
|---|---|
RoleLibrary()
Creates a new instance of RoleLibrary. |
|
| Method Summary | |
|---|---|
void |
add(FOS identifier,
RoleTemplate rt)
Adds a role template to the role template table using the functor of the specified identifier as the key. |
void |
append(java.lang.StringBuffer buffer)
Appends the role instances to the specified buffer. |
void |
deactivateRole(FOS fos)
Deactivates the role that has the specified identifier. |
void |
enactRole(FOS identifier,
Agent agent)
If there is not already a role instance with the specified identifier, creates a role instance using the appropriate template. |
void |
solve(Agent agent)
Processes the triggers of each of the role templates and executes each of the role instances. |
void |
writeToStream(java.io.DataOutputStream output)
Writes each of the role templates to the the speicifed data output stream. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RoleLibrary()
| Method Detail |
|---|
public void add(FOS identifier,
RoleTemplate rt)
identifier - the identifier for the template.rt - the role template to be added to the role template table.
public void enactRole(FOS identifier,
Agent agent)
throws MalformedLogicException
identifier - the identifier for the role.agent - the agent that adopts the role.
MalformedLogicException - if there is a logic error.public void deactivateRole(FOS fos)
fos - the identifier of the role that is to be deactivated.
public void writeToStream(java.io.DataOutputStream output)
throws java.io.IOException
output - the stream that the templates are written to.
java.io.IOException - if there is an I/O error.
public void solve(Agent agent)
throws MalformedLogicException
agent - the agent that the role library belongs to.
MalformedLogicException - if there is a logic error.public void append(java.lang.StringBuffer buffer)
buffer - the string buffer that role instances are appended to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||