|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--Book
This class is the address book an agent maintains in order to communicate and build its "community. It stores the name of agents it communicates with, a counter that keeps track of the story of the interactions, methods to add to and delete agents from the address book.
| Field Summary | |
private Slot[] |
addressSet
The array of addresses, each slot containing the name of an agent and its exchange activity record. |
private int |
addressSetSize
The size of the address book |
private Slot |
slot
A slot of the address book |
| Constructor Summary | |
Book(AgentsPopulations population)
Construct an address book |
|
| Method Summary | |
void |
addToAddressBook(Agent agent)
Add an agent to the address book if it participates in the communication |
boolean |
deleteAddress(Slot slot)
Delete an agent from the address book if it has not exchanged initExVal times in a raw. |
int |
getAddBookSize()
Return the size of the address book |
Slot[] |
getAddressSet()
Return the set of agents in the address book |
Slot[] |
ordering()
Classes the address Book by decreasing time of presence in the address book. |
void |
transferAddressBook(Agent agent)
If an agent receives an answer from another agent, then in turn it transfers to this agent the highest part of its address book, i.e. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private Slot slot
private Slot[] addressSet
private int addressSetSize
| Constructor Detail |
public Book(AgentsPopulations population)
population - The whole population of agents involved in the experiment| Method Detail |
public int getAddBookSize()
public Slot[] getAddressSet()
public boolean deleteAddress(Slot slot)
slot - The position of the agent to be deleted from the address book
in the array storing the addresses of agentspublic void addToAddressBook(Agent agent)
agent - The to be added agentpublic void transferAddressBook(Agent agent)
agent - The agent to whom the addresses are passed toordering()public Slot[] ordering()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||