vitro
Class RandomAgent<A extends Actor>

java.lang.Object
  extended by vitro.RandomAgent<A>
All Implemented Interfaces:
Agent<A>

public class RandomAgent<A extends Actor>
extends Object
implements Agent<A>

A generic Agent implementation which always chooses randomly from the available options. Frequently useful for debugging.


Constructor Summary
RandomAgent()
           
 
Method Summary
 Action choose(A actor, Set<Action> options)
          Select an action from the available options.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomAgent

public RandomAgent()
Method Detail

choose

public Action choose(A actor,
                     Set<Action> options)
Description copied from interface: Agent
Select an action from the available options.

Specified by:
choose in interface Agent<A extends Actor>
Parameters:
actor - the Actor for whom a decision is being made.
options - the available Actions for the Actor.
Returns:
the Action this Actor will take.