ec.teambots
Class TeambotsProblem

java.lang.Object
  |
  +--ec.Problem
        |
        +--ec.teambots.TeambotsProblem
All Implemented Interfaces:
java.lang.Cloneable, Prototype, java.io.Serializable, Setup, SimpleProblemForm
Direct Known Subclasses:
TeambotsExampleProblem

public abstract class TeambotsProblem
extends Problem
implements SimpleProblemForm

TeambotsProblem.java This is a problem for evolving control systems with ECJ for Teambots for multiple robots. In the simulation there can also be other robots that are not evolved.

Parameters
base.input-file
string
(name of the Teambots configuration file)
base.graphics
bool = true or false (default)
(whether evaluations have graphical display or not (no graphics => greater speed)
base.window-width
int >= 0
(wodth of window for graphical display)
base.window-height
int >= 0
(height of window for graphical display)
base.num-bots
int >= 1
(number of robots to evolve behaviors for)

See Also:
Serialized Form

Field Summary
 boolean graphics
          whether the simulation will have graphics displaying or not
static java.lang.String P_GRAPHICS
          Whether the simulation will be displayed or not
static java.lang.String P_INPUTFILE
          The name of the input file for the simulator
static java.lang.String P_NUMBOTS
          the number of control systems to be evolved
static java.lang.String P_WINDOWHEIGHT
          the height of the window of the simulation
static java.lang.String P_WINDOWWIDTH
          the width of the window of the simulation
 ECSimulationCanvas simulator
          the simulator
protected  java.awt.Frame simulatorFrame
           
 
Fields inherited from class ec.Problem
P_PROBLEM
 
Constructor Summary
TeambotsProblem()
           
 
Method Summary
 void evaluate(EvolutionState state, Individual ind, int threadnum)
          Evaluate the individual.
abstract  EvolvedControlSystem getControlSystem(EvolutionState state, Individual ind, int threadnum, int whichBot)
          Get the control system for the nth robot.
 int getNumberEvolvableRobots()
          how many robots are there to be evolved
 void setup(EvolutionState state, Parameter base)
          Sets up the object by reading it from the parameters stored in state, built off of the parameter base base.
 
Methods inherited from class ec.Problem
defaultBase, protoClone, protoCloneSimple
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ec.simple.SimpleProblemForm
describe
 

Field Detail

P_WINDOWWIDTH

public static final java.lang.String P_WINDOWWIDTH
the width of the window of the simulation

P_WINDOWHEIGHT

public static final java.lang.String P_WINDOWHEIGHT
the height of the window of the simulation

P_NUMBOTS

public static final java.lang.String P_NUMBOTS
the number of control systems to be evolved

P_INPUTFILE

public static final java.lang.String P_INPUTFILE
The name of the input file for the simulator

P_GRAPHICS

public static final java.lang.String P_GRAPHICS
Whether the simulation will be displayed or not

simulator

public ECSimulationCanvas simulator
the simulator

graphics

public boolean graphics
whether the simulation will have graphics displaying or not

simulatorFrame

protected java.awt.Frame simulatorFrame
Constructor Detail

TeambotsProblem

public TeambotsProblem()
Method Detail

getNumberEvolvableRobots

public final int getNumberEvolvableRobots()
how many robots are there to be evolved

setup

public void setup(EvolutionState state,
                  Parameter base)
Description copied from interface: Prototype
Sets up the object by reading it from the parameters stored in state, built off of the parameter base base. If an ancestor implements this method, be sure to call super.setup(state,base); before you do anything else.

For prototypes, setup(...) is typically called once for the prototype instance; cloned instances do not receive the setup(...) call. setup(...) may be called more than once; the only guarantee is that it will get called at least once on an instance or some "parent" object from which it was ultimately cloned.

Overrides:
setup in class Problem

evaluate

public void evaluate(EvolutionState state,
                     Individual ind,
                     int threadnum)
Evaluate the individual.
Specified by:
evaluate in interface SimpleProblemForm

getControlSystem

public abstract EvolvedControlSystem getControlSystem(EvolutionState state,
                                                      Individual ind,
                                                      int threadnum,
                                                      int whichBot)
Get the control system for the nth robot.