edu.sc.ants
Class Message

java.lang.Object
  |
  +--edu.sc.ants.Message

public class Message
extends java.lang.Object

The Message object is sent back and forth between the agents and includes all the information they send to each other.


Field Summary
(package private)  double distance
          If the message is a "bid" then the distance is like the bid amount or utility the receiver expects.
(package private)  long expiresAt
          Time at which the message is supposed to expire
(package private)  Map map
          Agents can give each other maps of what they believe is out there.
(package private)  java.lang.String performative
          The performative of the message.
(package private)  long receivedAt
          Time at which the message was received, to be set by recipient if it wants.
(package private)  int receiver
          The ID of the agent who is meant to receive this message.
(package private)  int sender
          ID of the sender
(package private)  long sentAt
          Time at which the message was sent
 
Constructor Summary
Message(java.lang.String p, int s, int r, Map m)
          A constructor with a lot of arguments
Message(java.lang.String p, int s, int r, Map m, double d)
          Build a messeage with a map and a distance(bid).
 
Method Summary
 double getDistance()
          Get the value of distance.
 long getExpiresAt()
          Get the value of expiresAt.
 Map getMap()
          Get the value of map.
 java.lang.String getPerformative()
          Get the value of performative.
 long getReceivedAt()
          Get the value of receivedAt.
 int getReceiver()
          Get the value of receiver.
 int getSender()
          Get the value of sender.
 long getSentAt()
          Get the value of sentAt.
 void setDistance(double v)
          Set the value of distance.
 void setExpiresAt(long v)
          Set the value of expiresAt.
 void setMap(Map v)
          Set the value of map.
 void setPerformative(java.lang.String v)
          Set the value of performative.
 void setReceivedAt(long v)
          Set the value of receivedAt.
 void setReceiver(int v)
          Set the value of receiver.
 void setSender(int v)
          Set the value of sender.
 void setSentAt(long v)
          Set the value of sentAt.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

performative

java.lang.String performative
The performative of the message.

map

Map map
Agents can give each other maps of what they believe is out there.

sender

int sender
ID of the sender

receiver

int receiver
The ID of the agent who is meant to receive this message. A value of -1 indicates that this message is a broadcast.

sentAt

long sentAt
Time at which the message was sent

expiresAt

long expiresAt
Time at which the message is supposed to expire

receivedAt

long receivedAt
Time at which the message was received, to be set by recipient if it wants.

distance

double distance
If the message is a "bid" then the distance is like the bid amount or utility the receiver expects.
Constructor Detail

Message

public Message(java.lang.String p,
               int s,
               int r,
               Map m)
A constructor with a lot of arguments

Message

public Message(java.lang.String p,
               int s,
               int r,
               Map m,
               double d)
Build a messeage with a map and a distance(bid).
Method Detail

getPerformative

public java.lang.String getPerformative()
Get the value of performative.
Returns:
Value of performative.

setPerformative

public void setPerformative(java.lang.String v)
Set the value of performative.
Parameters:
v - Value to assign to performative.

getMap

public Map getMap()
Get the value of map.
Returns:
Value of map.

setMap

public void setMap(Map v)
Set the value of map.
Parameters:
v - Value to assign to map.

getSender

public int getSender()
Get the value of sender.
Returns:
Value of sender.

setSender

public void setSender(int v)
Set the value of sender.
Parameters:
v - Value to assign to sender.

getReceiver

public int getReceiver()
Get the value of receiver.
Returns:
Value of receiver.

setReceiver

public void setReceiver(int v)
Set the value of receiver.
Parameters:
v - Value to assign to receiver.

getSentAt

public long getSentAt()
Get the value of sentAt.
Returns:
Value of sentAt.

setSentAt

public void setSentAt(long v)
Set the value of sentAt.
Parameters:
v - Value to assign to sentAt.

getExpiresAt

public long getExpiresAt()
Get the value of expiresAt.
Returns:
Value of expiresAt.

setExpiresAt

public void setExpiresAt(long v)
Set the value of expiresAt.
Parameters:
v - Value to assign to expiresAt.

getReceivedAt

public long getReceivedAt()
Get the value of receivedAt.
Returns:
Value of receivedAt.

setReceivedAt

public void setReceivedAt(long v)
Set the value of receivedAt.
Parameters:
v - Value to assign to receivedAt.

getDistance

public double getDistance()
Get the value of distance.
Returns:
Value of distance.

setDistance

public void setDistance(double v)
Set the value of distance.
Parameters:
v - Value to assign to distance.