yab.agent
Class Agent

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--yab.agent.Agent
All Implemented Interfaces:
Constants, Runnable
Direct Known Subclasses:
CenterAgent, HumanoidAgent

public abstract class Agent
extends Thread
implements Constants


Nested Class Summary
protected static class Agent.ActionCommandException
          This exception is thrown in order to exit from act method.
 
Field Summary
protected  Property distancePrp
           
protected  Random random
           
protected  DisasterSpace world
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface yab.agent.Constants
EXTINGUISHABLE_DISTANCE, EXTINGUISHABLE_QUANTITY, HEARING_LIMIT_OF_HUMANOID, SIMULATING_TIME, TIME_INITIALIZING_AGENT, TIME_STARTING_ACTION, UTTERANCE_LIMIT
 
Constructor Summary
protected Agent(int agentType, InetAddress kernelAddress, int kernelPort)
           
 
Method Summary
protected abstract  void act()
          This method decides action of the agent at each cycle.
protected abstract  void hear(RealObject sender, String message)
          This method decides reaction to hearing message from sender.
protected abstract  int hearingLimit()
           
protected  void prepareForAct()
           
protected  void rest()
           
 void run()
           
protected  void say(String message)
           
protected  RCRSSProtocolSocket socket()
           
protected  void tell(String message)
           
protected  int time()
           
protected  int utteranceLimit()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

world

protected final DisasterSpace world

random

protected final Random random

distancePrp

protected final Property distancePrp
Constructor Detail

Agent

protected Agent(int agentType,
                InetAddress kernelAddress,
                int kernelPort)
Method Detail

act

protected abstract void act()
                     throws Agent.ActionCommandException
This method decides action of the agent at each cycle.

Agent.ActionCommandException

hear

protected abstract void hear(RealObject sender,
                             String message)
This method decides reaction to hearing message from sender.


prepareForAct

protected void prepareForAct()

utteranceLimit

protected int utteranceLimit()

hearingLimit

protected abstract int hearingLimit()

socket

protected RCRSSProtocolSocket socket()

time

protected int time()

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

rest

protected void rest()
             throws Agent.ActionCommandException
Agent.ActionCommandException

say

protected void say(String message)

tell

protected void tell(String message)