Package
Class
Tree
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes
A
C
E
F
G
H
I
L
N
P
R
S
T
U
A
act(List<Animal>)
- Method in class
Animal
Make this animal act - that is: make it do whatever it wants/needs to do.
act(List<Animal>)
- Method in class
Fox
This is what the fox does most of the time: it hunts for rabbits.
act(List<Animal>)
- Method in class
Rabbit
This is what the rabbit does most of the time - it runs around.
adjacentLocations(Location)
- Method in class
Field
Return a shuffled list of locations adjacent to the given one.
Animal
- Class in
<Unnamed>
A class representing shared characteristics of animals.
Animal(Field, Location)
- Constructor for class
Animal
Create a new animal at location in field.
C
clear()
- Method in class
Field
Empty the field.
clear(Location)
- Method in class
Field
Clear the given location.
clearImage()
- Method in class
GraphView.GraphPanel
Clear the image on this panel.
Counter
- Class in
<Unnamed>
Provide a counter for a participant in the simulation.
Counter(String)
- Constructor for class
Counter
Provide a name for one of the simulation types.
countFinished()
- Method in class
FieldStats
Indicate that an animal count has been completed.
E
equals(Object)
- Method in class
Location
Implement content equality.
F
Field
- Class in
<Unnamed>
Represent a rectangular grid of field positions.
Field(int, int)
- Constructor for class
Field
Represent a field of the given dimensions.
FieldStats
- Class in
<Unnamed>
This class collects and provides some statistical data on the state of a field.
FieldStats()
- Constructor for class
FieldStats
Construct a FieldStats object.
Fox
- Class in
<Unnamed>
A simple model of a fox.
Fox(boolean, Field, Location)
- Constructor for class
Fox
Create a fox.
freeAdjacentLocation(Location)
- Method in class
Field
Try to find a free location that is adjacent to the given location.
G
getCol()
- Method in class
Location
getCount()
- Method in class
Counter
getDepth()
- Method in class
Field
Return the depth of the field.
getField()
- Method in class
Animal
Return the animal's field.
getFreeAdjacentLocations(Location)
- Method in class
Field
Get a shuffled list of the free adjacent locations.
getLocation()
- Method in class
Animal
Return the animal's location.
getName()
- Method in class
Counter
getObjectAt(Location)
- Method in class
Field
Return the animal at the given location, if any.
getObjectAt(int, int)
- Method in class
Field
Return the animal at the given location, if any.
getPopulationCount(Field, Class)
- Method in class
FieldStats
Get the number of individuals in the population of a given class.
getPopulationDetails(Field)
- Method in class
FieldStats
Get details of what is in the field.
getPreferredSize()
- Method in class
GraphView.GraphPanel
Tell the layout manager how big we would like to be.
getRandom()
- Static method in class
Randomizer
Provide a random generator.
getRow()
- Method in class
Location
getWidth()
- Method in class
Field
Return the width of the field.
GraphView
- Class in
<Unnamed>
The GraphView provides a view of two populations of actors in the field as a line graph over time.
GraphView(int, int, int)
- Constructor for class
GraphView
Constructor.
GraphView.GraphPanel
- Class in
<Unnamed>
Nested class: a component to display the graph.
GraphView.GraphPanel(int, int, int)
- Constructor for class
GraphView.GraphPanel
Create a new, empty GraphPanel.
GridView
- Class in
<Unnamed>
A graphical view of the simulation grid.
GridView(int, int)
- Constructor for class
GridView
Create a view of the given width and height.
H
hashCode()
- Method in class
Location
Use the top 16 bits for the row value and the bottom for the column.
I
increment()
- Method in class
Counter
Increment the current count by one.
incrementCount(Class)
- Method in class
FieldStats
Increment the count for one class of animal.
isAlive()
- Method in class
Animal
Check whether the animal is alive or not.
isOpaque()
- Method in class
GraphView.GraphPanel
This component is opaque.
isViable(Field)
- Method in class
FieldStats
Determine whether the simulation is still viable.
isViable(Field)
- Method in class
GraphView
Determine whether the simulation should continue to run.
isViable(Field)
- Method in class
GridView
Determine whether the simulation should continue to run.
isViable(Field)
- Method in interface
SimulatorView
Determine whether the simulation should continue to run.
L
Location
- Class in
<Unnamed>
Represent a location in a rectangular grid.
Location(int, int)
- Constructor for class
Location
Represent a row and column.
N
newRun()
- Method in class
GraphView.GraphPanel
Indicate a new simulation run on this panel.
P
paintComponent(Graphics)
- Method in class
GraphView.GraphPanel
This component needs to be redisplayed.
place(Object, int, int)
- Method in class
Field
Place an animal at the given location.
place(Object, Location)
- Method in class
Field
Place an animal at the given location.
R
Rabbit
- Class in
<Unnamed>
A simple model of a rabbit.
Rabbit(boolean, Field, Location)
- Constructor for class
Rabbit
Create a new rabbit.
randomAdjacentLocation(Location)
- Method in class
Field
Generate a random location that is adjacent to the given location, or is the same location.
Randomizer
- Class in
<Unnamed>
Provide control over the randomization of the simulation.
Randomizer()
- Constructor for class
Randomizer
Constructor for objects of class Randomizer
repaintNow()
- Method in class
GraphView.GraphPanel
Cause immediate update of the panel.
reset()
- Method in class
Counter
Reset the current count to zero.
reset()
- Method in class
FieldStats
Invalidate the current set of statistics; reset all counts to zero.
reset()
- Method in class
GraphView
Prepare for a new run.
reset()
- Method in class
GridView
Prepare for a new run.
reset()
- Static method in class
Randomizer
Reset the randomization.
reset()
- Method in class
Simulator
Reset the simulation to a starting position.
reset()
- Method in interface
SimulatorView
Prepare for a new run.
runLongSimulation()
- Method in class
Simulator
Run the simulation from its current state for a reasonably long period, (4000 steps).
S
scaleDown()
- Method in class
GraphView.GraphPanel
Scale the current graph down vertically to make more room at the top.
setColor(Class, Color)
- Method in class
GraphView
Define a color to be used for a given class of animal.
setColor(Class, Color)
- Method in class
GridView
Define a color to be used for a given class of animal.
setColor(Class, Color)
- Method in interface
SimulatorView
Define a color to be used for a given class of animal.
setDead()
- Method in class
Animal
Indicate that the animal is no longer alive.
setLocation(Location)
- Method in class
Animal
Place the animal at the new location in the given field.
showStatus(int, Field)
- Method in class
GraphView
Show the current status of the field.
showStatus(int, Field)
- Method in class
GridView
Show the current status of the field.
showStatus(int, Field)
- Method in interface
SimulatorView
Show the current status of the field.
simulate(int)
- Method in class
Simulator
Run the simulation from its current state for the given number of steps.
simulateOneStep()
- Method in class
Simulator
Run the simulation from its current state for a single step.
Simulator
- Class in
<Unnamed>
A simple predator-prey simulator, based on a rectangular field containing rabbits and foxes.
Simulator()
- Constructor for class
Simulator
Construct a simulation field with default size.
Simulator(int, int)
- Constructor for class
Simulator
Create a simulation field with the given size.
SimulatorView
- Interface in
<Unnamed>
A graphical view of the simulation grid.
T
toString()
- Method in class
Location
Return a string of the form row,column
U
update(int, Field, FieldStats)
- Method in class
GraphView.GraphPanel
Dispay a new point of data.
A
C
E
F
G
H
I
L
N
P
R
S
T
U
Package
Class
Tree
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes