Artificial ant evaluation class (and environment simulator)
More...
#include <AntEvalOp.h>
|
static bool | trace = false |
| trace the ant's movement in the simulator (for visual output) More...
|
|
static bool | step = false |
| show the ant's movement interactive step by step (no effect if trace is false!) More...
|
|
|
void | showStep (string action) |
| Show the ant's current action (interactive) More...
|
|
|
static const char | LEFT = '<' |
|
static const char | RIGHT = '>' |
|
static const char | UP = '^' |
|
static const char | DOWN = 'v' |
|
Artificial ant evaluation class (and environment simulator)
Definition at line 50 of file AntEvalOp.h.
◆ evaluate()
FitnessP AntEvalOp::evaluate |
( |
IndividualP |
individual | ) |
|
|
virtual |
Evaluation function, simulates ant movement and counts the eaten food.
Implements EvaluateOp.
Definition at line 98 of file AntEvalOp.cpp.
◆ facingFood()
bool AntEvalOp::facingFood |
( |
| ) |
|
◆ initialize()
bool AntEvalOp::initialize |
( |
StateP |
state | ) |
|
|
virtual |
Initialize the simulator, read environments from input file.
Reimplemented from EvaluateOp.
Definition at line 45 of file AntEvalOp.cpp.
◆ moveAhead()
void AntEvalOp::moveAhead |
( |
| ) |
|
◆ registerParameters()
void AntEvalOp::registerParameters |
( |
StateP |
| ) |
|
|
virtual |
◆ showStep()
void AntEvalOp::showStep |
( |
string |
action | ) |
|
|
protected |
Show the ant's current action (interactive)
Definition at line 277 of file AntEvalOp.cpp.
◆ turnLeft()
void AntEvalOp::turnLeft |
( |
| ) |
|
◆ turnRight()
void AntEvalOp::turnRight |
( |
| ) |
|
◆ operator<<
ostream & operator<< |
( |
ostream & |
os, |
|
|
AntEvalOp & |
ant |
|
) |
| |
|
friend |
Output the current state of the board (show ant movements)
Definition at line 23 of file AntEvalOp.cpp.
◆ board
std::vector<char*> AntEvalOp::board |
|
protected |
◆ boardNo
◆ boardNo2
◆ columnNo
std::vector<uint> AntEvalOp::columnNo |
|
protected |
◆ currentTree
string AntEvalOp::currentTree |
|
protected |
◆ DOWN
const char AntEvalOp::DOWN = 'v' |
|
staticprotected |
◆ facing_
◆ foodEaten_
uint AntEvalOp::foodEaten_ |
|
protected |
◆ foodNo
std::vector<uint> AntEvalOp::foodNo |
|
protected |
◆ LEFT
const char AntEvalOp::LEFT = '<' |
|
staticprotected |
◆ maxSteps
std::vector<uint> AntEvalOp::maxSteps |
|
protected |
◆ moves_
◆ RIGHT
const char AntEvalOp::RIGHT = '>' |
|
staticprotected |
◆ rowNo
std::vector<uint> AntEvalOp::rowNo |
|
protected |
◆ state_
◆ step
bool AntEvalOp::step = false |
|
static |
show the ant's movement interactive step by step (no effect if trace is false!)
Definition at line 86 of file AntEvalOp.h.
◆ tmpBoard
char* AntEvalOp::tmpBoard |
|
protected |
◆ tmpColumn
uint AntEvalOp::tmpColumn |
|
protected |
◆ tmpFoodNo
uint AntEvalOp::tmpFoodNo |
|
protected |
◆ tmpMaxSteps
uint AntEvalOp::tmpMaxSteps |
|
protected |
◆ tmpRow
◆ trace
bool AntEvalOp::trace = false |
|
static |
trace the ant's movement in the simulator (for visual output)
Definition at line 85 of file AntEvalOp.h.
◆ UP
const char AntEvalOp::UP = '^' |
|
staticprotected |
◆ x_
◆ y_
The documentation for this class was generated from the following files: