agents

## Class Agent

- java.lang.Object
- - agents.Agent

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  BlackBoxAgent, SystemAgent

    public abstract class Agent
    extends java.lang.Object
    implements java.io.Serializable

The Class Agent.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`Agent()`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`abstract void` `computeAMessage(Message m)` Compute A message.
`void` `die()` Die.
`int` `getID()` Gets the id.
`java.util.Stack<Message>` `getMessages()` Gets the messages.
`java.util.Stack<Message>` `getMessagesBin()` Gets the messages bin.
`java.lang.String` `getName()` Gets the name.
`boolean` `isDying()` Checks if is dying.
`void` `play()` Play one agent step.
`void` `readMessage()` Read message.
`void` `sendExpressMessage(java.lang.Object object, MessageType type, Agent a)` Send express message.
`void` `sendMessage(Message message, Agent a)` Send message.
`void` `sendMessage(java.lang.Object object, MessageType type, Agent a)` Send message.
`void` `setDying(boolean isDying)` Sets the dying.
`void` `setID(int iD)` Sets the id.
`void` `setMessages(java.util.Stack<Message> messages)` Sets the messages.
`void` `setMessagesBin(java.util.Stack<Message> messagesBin)` Sets the messages bin.
`void` `setName(java.lang.String name)` Sets the name.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Agent

    public Agent()

### Method Detail

#### play

    public void play()

Play one agent step.

#### getID

    public int getID()

Gets the id.

Returns:
  the id

#### setID

    public void setID(int iD)

Sets the id.

Parameters:
  `iD` - the new id

#### getName

    public java.lang.String getName()

Gets the name.

Returns:
  the name

#### setName

    public void setName(java.lang.String name)

Sets the name.

Parameters:
  `name` - the new name

#### getMessages

    public java.util.Stack<Message> getMessages()

Gets the messages.

Returns:
  the messages

#### setMessages

    public void setMessages(java.util.Stack<Message> messages)

Sets the messages.

Parameters:
  `messages` - the new messages

#### sendMessage

    public void sendMessage(Message message,
                            Agent a)

Send message.

Parameters:
  `message` - the message
  `a` - the a

#### sendMessage

    public void sendMessage(java.lang.Object object,
                            MessageType type,
                            Agent a)

Send message.

Parameters:
  `object` - the object
  `type` - the type
  `a` - the a

#### sendExpressMessage

    public void sendExpressMessage(java.lang.Object object,
                                   MessageType type,
                                   Agent a)

Send express message.

Parameters:
  `object` - the object
  `type` - the type
  `a` - the a

#### readMessage

    public void readMessage()

Read message.

#### getMessagesBin

    public java.util.Stack<Message> getMessagesBin()

Gets the messages bin.

Returns:
  the messages bin

#### setMessagesBin

    public void setMessagesBin(java.util.Stack<Message> messagesBin)

Sets the messages bin.

Parameters:
  `messagesBin` - the new messages bin

#### computeAMessage

    public abstract void computeAMessage(Message m)

Compute A message.

Parameters:
  `m` - the m

#### die

    public void die()

Die.

#### isDying

    public boolean isDying()

Checks if is dying.

Returns:
  true, if is dying

#### setDying

    public void setDying(boolean isDying)

Sets the dying.

Parameters:
  `isDying` - the new dying