Package
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes
A
C
D
E
F
G
H
I
L
M
N
O
P
R
S
T
V
W
A
attack()
- Method in class
Creature
Attack the creature right in front of you.
attack(Creature)
- Method in class
Simulator
Attack the creature in front of this one.
ATTACK_COST
- Static variable in class
Simulator
C
className
- Variable in class
Observation
If type == CREATURE, this is the classname of that creature.
code
- Variable in class
Simulator.Result
ConvertedError
- Error in
<Unnamed>
Thrown by Simulator when a Creature that has been converted to another species attempts to take an action.
ConvertedError(String)
- Constructor for error
ConvertedError
Creature
- Class in
<Unnamed>
Extend this class to create your own Creature.
Creature()
- Constructor for class
Creature
Subclass constructors must not invoke any of the parent class methods from their constructor.
D
Darwin
- Class in
<Unnamed>
Graphical display of the Darwin Game 2.0 simulator for single matches.
Darwin(boolean, String, String[])
- Constructor for class
Darwin
delay(int)
- Method in class
Creature
Called by creature operations to enforce the time cost of those operations.
delay(int)
- Method in class
Simulator
Wait the delayTime * n.
Direction
- Enum in
<Unnamed>
Cardinal direction on a grid.
direction
- Variable in class
Observation
If type == CREATURE, this is the direction that creature is facing.
distance(Point)
- Method in class
Creature
Returns the manhattan distance from current position to p2.
distance(Point, Point)
- Static method in class
Creature
Returns the manhattan distance between p1 and p2
E
equals(Object)
- Method in class
Creature
Uses the pointer comparision from Object.
equals(Object)
- Method in class
Observation
F
forward(Point)
- Method in enum
Direction
The point one step forward in this direction.
forward(Point, int)
- Method in enum
Direction
The point
n
steps forward in this direction.
fromTo(Point, Point)
- Static method in enum
Direction
Returns the larger direction from a to b, favoring the vertical.
G
getAuthorName()
- Method in class
Creature
Allows GUI browsers to display your name as author of this creature.
getClassName()
- Method in class
Creature
Name of this species of creature.
getCreature(int, int)
- Method in class
Simulator
Returns the creature at x, y on the grid.
getCreatureCount(Class)
- Method in class
Simulator
Returns the number of creatures of this species alive in the map.
getDelayTime()
- Method in class
Simulator
Returns the time of delay(1) in nanoseconds.
getDescription()
- Method in class
Creature
Allows GUI browsers to display information and credits about your creature.
getDimensions()
- Method in class
Simulator
Returns the size of the map.
getDirection()
- Method in class
Creature
Direction this creature is facing.
getDirection(Creature)
- Method in class
Simulator
Throws an exception if the Creature is not in the world.
getGridDrawXY2D()
- Method in class
Simulator
Returns the coordinates at which the 2D grid was last drawn
getIconHeight()
- Method in class
Simulator
getIconHeight()
- Method in class
Tournament
getIconWidth()
- Method in class
Simulator
getIconWidth()
- Method in class
Tournament
getId()
- Method in class
Creature
Each creature has a unique number that it can use to distinguish itself from others.
getImage(Creature, Direction)
- Static method in class
Simulator
getImage(Class, Direction)
- Static method in class
Simulator
Returns the image for this Creature subclass.
getLabel()
- Method in class
Creature
getMapDimensions()
- Method in class
Creature
Returns the size of the map.
getMovePosition(int)
- Method in class
Creature
The coordinates of the next position this Creature will enter if it moves
n
times, regardless of whether that position is currently empty.
getMovePosition()
- Method in class
Creature
Same as
Creature.getMovePosition(int)
with the argument
n = 1
getNumSpeciesLeft()
- Method in class
Simulator
Returns the number of different species left alive, excluding Flytraps.
getPopulationGraph()
- Method in class
Simulator
getPosition()
- Method in class
Creature
Returns the position of this Creature.
getPosition(Creature)
- Method in class
Simulator
Clones the position.
getResult()
- Method in class
Simulator
Returns a description of the final outcome, or null if the game has not yet ended.
getTime()
- Method in class
Creature
Returns the number of time steps since the simulation started.
getTime()
- Method in class
Simulator
Returns the approximate number of time steps that have elapsed since the simulation began.
getTitle()
- Method in class
Simulator
Name of this map
getType()
- Method in class
Creature
getVersion()
- Static method in class
Darwin
Reports the simulator version number.
getVersion()
- Static method in class
Simulator
Reports the version of this simulator.
getView3D()
- Method in class
Simulator
H
hashCode()
- Method in class
Creature
Uses the pointer hashCode from Object.
hashCode()
- Method in class
Observation
I
icon
- Variable in class
Simulator.Result
Image of the winner
id
- Variable in class
Observation
If type == CREATURE, this is the ID of that creature.
isAlive()
- Method in class
Creature
Returns true if this creature is alive.
isAlive(Creature)
- Method in class
Simulator
A creature's thread can't be stopped without potentially releasing locks that it is using for synchronization, so this method tells a creature when it should die.
isEnemy(Observation)
- Method in class
Creature
Returns true if this observation describes a Creature that is not of this species
isHorizontal()
- Method in enum
Direction
True for East and West
isRunning()
- Method in class
Simulator
True while the simulation is running (not stopped).
isVertical()
- Method in enum
Direction
True for North and South
L
left()
- Method in enum
Direction
The direction 90-degrees to the left.
loadClass(String)
- Static method in class
Simulator
Loads a class in its own Sandbox.
look()
- Method in class
Creature
Look forward.
look(Creature)
- Method in class
Simulator
LOOK_COST
- Static variable in class
Simulator
M
main(String[])
- Static method in class
Darwin
main(String[])
- Static method in class
Tournament
makeToggleToolButton(String)
- Static method in class
Darwin
makeToolButton(String)
- Static method in class
Darwin
move(Creature, int)
- Method in class
Simulator
Moves this creature forward if the space in front if it is empty, otherwise does not move.
MOVE_BACKWARD_COST
- Static variable in class
Simulator
Note: at moving backwards 3
MOVE_FORWARD_COST
- Static variable in class
Simulator
moveBackward()
- Method in class
Creature
Call to move your creature backward 1 square without changing its facing direction.
moveForward()
- Method in class
Creature
Call to move your creature forward 1 square.
N
nanoSleep(long)
- Static method in class
Simulator
On some systems, Thread.sleep(long, int) has a minimum sleep time of 1ms.
numTurns(Direction)
- Method in enum
Direction
The number of turns needed to reach direction d from this direction.
O
Observation
- Class in
<Unnamed>
Returned by Creature.look
Observation(int, int, int)
- Constructor for class
Observation
Observation(Point, int)
- Constructor for class
Observation
Observation(Point, Type, int)
- Constructor for class
Observation
Cannot be used to make a creature observation.
Observation(Point, String, int, Direction, int)
- Constructor for class
Observation
observeSelf()
- Method in class
Creature
Create an observation describing this creature
opposite()
- Method in enum
Direction
Returns the direction 180 degrees from this one.
P
paint(Graphics)
- Method in class
Simulator.PopulationGraph
paintIcon(Component, Graphics, int, int)
- Method in class
Simulator
paintIcon(Component, Graphics, int, int)
- Method in class
Tournament
position
- Variable in class
Observation
Point that was observed.
R
random()
- Static method in enum
Direction
Uniformly distributed random direction.
reset(Class[])
- Method in class
Simulator.PopulationGraph
result
- Variable in class
Simulator.Result
right()
- Method in enum
Direction
The direction 90-degrees to the right.
run()
- Method in class
Creature
Override this method to make your creature think and move.
S
SCALE2D
- Static variable in class
Simulator
2D grid size in pixels.
setDelayTime(long)
- Method in class
Simulator
Set the delay time in nanoseconds.
setSelectedCreature(Creature)
- Method in class
Simulator
setView3D(boolean)
- Method in class
Simulator
If true, the view renders in 3D
sharedClasses
- Static variable in class
Simulator
Shared between ClassLoader (Sandbox) instances
Simulator
- Class in
<Unnamed>
Darwin 2.0 simulator.
Simulator(String, Class[])
- Constructor for class
Simulator
Loads the specified map, instantiating each of the creatures for the numbered spots in the map.
Simulator.PopulationGraph
- Class in
<Unnamed>
Graph of population over time for each creature type.
Simulator.PopulationGraph()
- Constructor for class
Simulator.PopulationGraph
Simulator.Result
- Class in
<Unnamed>
Return value of
Simulator.getResult()
Simulator.Result(String, Class, String, Image, int, Simulator.Result.Code)
- Constructor for class
Simulator.Result
species
- Variable in class
Simulator.Result
Winning species, null if timeout or draw.
start(String, Class[])
- Method in class
Simulator
Load a new map and start a simulation.
stop()
- Method in class
Simulator
End simulation, without destroying final state.
SYNTAX_HELP
- Static variable in class
Darwin
T
tick()
- Method in class
Simulator.PopulationGraph
time
- Variable in class
Observation
Value returned from Creature.getTime() when this observation was made.
TIME_STEP_LIMIT
- Static variable in class
Simulator
The game ends after this many time steps, even if no Creature has won.
timeSteps
- Variable in class
Simulator.Result
Number of time steps until the result occured.
toInt()
- Method in enum
Direction
Returns a number between 0 and 3: EAST = 0, NORTH = 1, ...
toString(Point)
- Static method in class
Creature
Prints a point to a string concisely.
toString()
- Method in class
Simulator.Result
toString()
- Method in class
Simulator
Tournament
- Class in
<Unnamed>
TODO: ensure that simulators die when complete Graphical display and management of Darwin Game tournaments.
TURN_COST
- Static variable in class
Simulator
turnLeft()
- Method in class
Creature
Rotate counter-clockwise 90 degrees.
turnLeft(Creature)
- Method in class
Simulator
turnRight()
- Method in class
Creature
Rotate clockwise 90 degrees.
turnRight(Creature)
- Method in class
Simulator
Called by a creature to turn
type
- Variable in class
Observation
Type of object at this location.
Type
- Enum in
<Unnamed>
Types of Entitys that can be in a square.
V
valueOf(String)
- Static method in enum
Direction
Returns the enum constant of this type with the specified name.
valueOf(String)
- Static method in enum
Type
Returns the enum constant of this type with the specified name.
values()
- Static method in enum
Direction
Returns an array containing the constants of this enum type, in the order they're declared.
values()
- Static method in enum
Type
Returns an array containing the constants of this enum type, in the order they're declared.
W
why
- Variable in class
Simulator.Result
Explanation of why the game ended.
A
C
D
E
F
G
H
I
L
M
N
O
P
R
S
T
V
W
Package
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes