|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectFitnessEvaluation.SantaFeAntTrail.Trail
FitnessEvaluation.SantaFeAntTrail.SanMateoTrail
public class SanMateoTrail
Taken from lib GE and refactored to java
| Field Summary | |
|---|---|
static int |
GRID_HEIGHT
|
static int |
GRID_WIDTH
|
int |
move
|
int |
trailCnt
|
static java.util.LinkedList<int[][]> |
trails
|
int |
turn
|
| Fields inherited from class FitnessEvaluation.SantaFeAntTrail.Trail |
|---|
_current_X, _current_Y, _energy, _facing_current_X, _facing_current_Y, _picked_up, _trail, _working_trail, ANT, EMPTY, food, FOOD |
| Constructor Summary | |
|---|---|
SanMateoTrail()
Creates a new instance of Trail. |
|
SanMateoTrail(int energy)
Create new instance |
|
| Method Summary | |
|---|---|
int |
food_ahead()
Check if there is food in the square ahead. 0 is false, 1 is true. |
int |
get_Energy()
Get the energy |
boolean |
getTrail(int energy)
Get the trail. |
void |
left()
Turn the ant left |
void |
move()
Move the ant forward Death on the electric fence |
void |
right()
Turn the ant right |
| Methods inherited from class FitnessEvaluation.SantaFeAntTrail.Trail |
|---|
get_Energy_Left, get_Picked_Up, getFitness, getFood |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int GRID_WIDTH
public static final int GRID_HEIGHT
public static java.util.LinkedList<int[][]> trails
public int turn
public int move
public int trailCnt
| Constructor Detail |
|---|
public SanMateoTrail()
public SanMateoTrail(int energy)
energy - ant stamina| Method Detail |
|---|
public boolean getTrail(int energy)
public void right()
Trail
right in class Trailpublic void left()
Trail
left in class Trailpublic int get_Energy()
Trail
get_Energy in class Trailpublic void move()
move in class Trailpublic int food_ahead()
food_ahead in class Trail
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||