Artificial ant evaluation class (and environment simulator). More...
#include <AntEvalOp.h>
Public Member Functions | |
void | registerParameters (StateP) |
Register evaluator parameters. Called before EvaluateOp::initialize method. | |
FitnessP | evaluate (IndividualP individual) |
Evaluation function, simulates ant movement and counts the eaten food. | |
bool | initialize (StateP) |
Initialize the simulator, read environments from input file. | |
void | turnLeft () |
Turn ant on the left. | |
bool | facingFood () |
Check if there's food in front. | |
void | turnRight () |
Turn ant on the right. | |
void | moveAhead () |
Move ant ahead. | |
Static Public Attributes | |
static bool | trace = false |
trace the ant's movement in the simulator (for visual output) | |
static bool | step = false |
show the ant's movement interactive step by step (no effect if trace is false!) | |
Protected Member Functions | |
void | showStep (string action) |
Show the ant's current action (interactive). | |
Protected Attributes | |
uint | x_ |
uint | y_ |
uint | facing_ |
uint | moves_ |
uint | foodEaten_ |
std::vector< uint > | rowNo |
std::vector< uint > | columnNo |
std::vector< uint > | maxSteps |
std::vector< uint > | foodNo |
std::vector< char * > | board |
uint | tmpRow |
uint | tmpColumn |
uint | tmpMaxSteps |
uint | tmpFoodNo |
uint | boardNo |
uint | boardNo2 |
char * | tmpBoard |
StateP | state_ |
string | currentTree |
Static Protected Attributes | |
static const char | LEFT = '<' |
static const char | RIGHT = '>' |
static const char | UP = '^' |
static const char | DOWN = 'v' |
Friends | |
ostream & | operator<< (ostream &os, AntEvalOp &ant) |
Output the current state of the board (show ant movements). |
Artificial ant evaluation class (and environment simulator).
Definition at line 50 of file AntEvalOp.h.