Class Slot

java.lang.Object
  |
  +--Slot
All Implemented Interfaces:
java.io.Serializable

public class Slot
extends java.lang.Object
implements java.io.Serializable

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

Since:
JDK 1.3
See Also:
Serialized Form

Field Summary
private  int address
          the address of an agent in the address book
private  Agent agent
          an agent
private  int exchangeCounter
          the counter keeping track of the exchange occuring with one agent
private  XClassifier exchangedCl
           
private  int initExVal
          The number of runs without answer allowed to an agent in the address book before to delete it
private  int timeAB
          Counts the time an agent stays in an address book. reflects the stability of the relationship
 
Constructor Summary
Slot()
          The constructor for a slot that will be inserted in an address book.
 
Method Summary
 void actualizeCounter()
          Actualize the indicator of inputs.
 void actualizeTime()
          Counts the time spent in the address book by an agent
 int getAddress()
          Returns the name of an agent stored at a given place in the address book
 XClassifier getAnswer()
          Returns the classifier passed from one agent to another.
 int getExchangeCounter()
          Returns the exchange counter
 int getTime()
          Returns the time spent by an agent in an address book.
 void setAddress(int name)
          Sets the name of an agent in a slot when it is introduced in the address book.
 XClassifier trackExchange(XClassifier cl)
          Returns the classifier passed from one agent to another.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

address

private int address
the address of an agent in the address book


exchangedCl

private XClassifier exchangedCl

exchangeCounter

private int exchangeCounter
the counter keeping track of the exchange occuring with one agent


timeAB

private int timeAB
Counts the time an agent stays in an address book. reflects the stability of the relationship


initExVal

private int initExVal
The number of runs without answer allowed to an agent in the address book before to delete it


agent

private Agent agent
an agent

Constructor Detail

Slot

public Slot()
The constructor for a slot that will be inserted in an address book. it contains the name of the agent, the value of its exchange counter (indicator of the imputs provided by this agent) and a counter of the time this agent last in the address book.

Method Detail

actualizeCounter

public void actualizeCounter()
Actualize the indicator of inputs. Decreased by one each time an agent does not answer when sollicited


actualizeTime

public void actualizeTime()
Counts the time spent in the address book by an agent


getExchangeCounter

public int getExchangeCounter()
Returns the exchange counter


setAddress

public void setAddress(int name)
Sets the name of an agent in a slot when it is introduced in the address book.

Parameters:
name - The name of the inserted agent

getAddress

public int getAddress()
Returns the name of an agent stored at a given place in the address book


getTime

public int getTime()
Returns the time spent by an agent in an address book.


trackExchange

public XClassifier trackExchange(XClassifier cl)
Returns the classifier passed from one agent to another. Mostly used for debugging.

Parameters:
cl - The exchanged classifier

getAnswer

public XClassifier getAnswer()
Returns the classifier passed from one agent to another. Used for debugging.