|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectFitnessEvaluation.SantaFeAntTrail.Trail
public class Trail
Taken from lib GE and refactored to java
Field Summary | |
---|---|
int |
_current_X
|
int |
_current_Y
|
int |
_energy
|
int |
_facing_current_X
|
int |
_facing_current_Y
|
int |
_picked_up
|
int[][] |
_trail
|
int[][] |
_working_trail
|
static int |
ANT
|
static int |
EMPTY
|
int |
food
|
static int |
FOOD
|
static int |
GRID_HEIGHT
|
static int |
GRID_WIDTH
|
Constructor Summary | |
---|---|
Trail()
Creates a new instance of Trail. |
|
Trail(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. |
boolean |
get_Energy_Left()
Get energy left |
int |
get_Energy()
Get the energy |
int |
get_Picked_Up()
get food picked up |
double |
getFitness()
Get fitness. |
int |
getFood()
Get food |
void |
left()
Turn the ant left |
void |
move()
Move the ant forward |
void |
right()
Turn the ant right |
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 final int EMPTY
public static final int FOOD
public static final int ANT
public int _energy
public int _picked_up
public int[][] _trail
public int[][] _working_trail
public int food
public int _current_X
public int _current_Y
public int _facing_current_X
public int _facing_current_Y
Constructor Detail |
---|
public Trail()
public Trail(int energy)
energy
- ant staminaMethod Detail |
---|
public int get_Energy()
public boolean get_Energy_Left()
public int getFood()
public int get_Picked_Up()
public double getFitness()
public void left()
public void right()
public void move()
public int food_ahead()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |