first commit

This commit is contained in:
Boris
2024-01-15 20:14:10 +00:00
commit 8c81ee28b7
3106 changed files with 474415 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#BlueJ class context
comment0.params=field\ location
comment0.target=Animal(Field,\ Location)
comment0.text=\n\ Create\ a\ new\ animal\ at\ location\ in\ field.\n\ \n\ @param\ field\ The\ field\ currently\ occupied.\n\ @param\ location\ The\ location\ within\ the\ field.\n
comment1.params=newAnimals
comment1.target=void\ act(java.util.List)
comment1.text=\n\ Make\ this\ animal\ act\ -\ that\ is\:\ make\ it\ do\n\ whatever\ it\ wants/needs\ to\ do.\n\ @param\ newAnimals\ A\ list\ to\ receive\ newly\ born\ animals.\n
comment2.params=
comment2.target=boolean\ isAlive()
comment2.text=\n\ Check\ whether\ the\ animal\ is\ alive\ or\ not.\n\ @return\ true\ if\ the\ animal\ is\ still\ alive.\n
comment3.params=
comment3.target=void\ setDead()
comment3.text=\n\ Indicate\ that\ the\ animal\ is\ no\ longer\ alive.\n\ It\ is\ removed\ from\ the\ field.\n
comment4.params=
comment4.target=Location\ getLocation()
comment4.text=\n\ Return\ the\ animal's\ location.\n\ @return\ The\ animal's\ location.\n
comment5.params=newLocation
comment5.target=void\ setLocation(Location)
comment5.text=\n\ Place\ the\ animal\ at\ the\ new\ location\ in\ the\ given\ field.\n\ @param\ newLocation\ The\ animal's\ new\ location.\n
comment6.params=
comment6.target=Field\ getField()
comment6.text=\n\ Return\ the\ animal's\ field.\n\ @return\ The\ animal's\ field.\n
numComments=7

View File

@@ -0,0 +1,91 @@
import java.util.List;
/**
* A class representing shared characteristics of animals.
*
* @author David J. Barnes and Michael Kölling
* @version 2016.03.18
*/
public abstract class Animal
{
// Whether the animal is alive or not.
private boolean alive;
// The animal's field.
private Field field;
// The animal's position in the field.
private Location location;
/**
* Create a new animal at location in field.
*
* @param field The field currently occupied.
* @param location The location within the field.
*/
public Animal(Field field, Location location)
{
alive = true;
this.field = field;
setLocation(location);
}
/**
* Make this animal act - that is: make it do
* whatever it wants/needs to do.
* @param newAnimals A list to receive newly born animals.
*/
abstract public void act(List<Animal> newAnimals);
/**
* Check whether the animal is alive or not.
* @return true if the animal is still alive.
*/
protected boolean isAlive()
{
return alive;
}
/**
* Indicate that the animal is no longer alive.
* It is removed from the field.
*/
protected void setDead()
{
alive = false;
if(location != null) {
field.clear(location);
location = null;
field = null;
}
}
/**
* Return the animal's location.
* @return The animal's location.
*/
protected Location getLocation()
{
return location;
}
/**
* Place the animal at the new location in the given field.
* @param newLocation The animal's new location.
*/
protected void setLocation(Location newLocation)
{
if(location != null) {
field.clear(location);
}
location = newLocation;
field.place(this, newLocation);
}
/**
* Return the animal's field.
* @return The animal's field.
*/
protected Field getField()
{
return field;
}
}

View File

@@ -0,0 +1,17 @@
#BlueJ class context
comment0.params=name
comment0.target=Counter(java.lang.String)
comment0.text=\n\ Provide\ a\ name\ for\ one\ of\ the\ simulation\ types.\n\ @param\ name\ \ A\ name,\ e.g.\ "Fox".\n
comment1.params=
comment1.target=java.lang.String\ getName()
comment1.text=\n\ @return\ The\ short\ description\ of\ this\ type.\n
comment2.params=
comment2.target=int\ getCount()
comment2.text=\n\ @return\ The\ current\ count\ for\ this\ type.\n
comment3.params=
comment3.target=void\ increment()
comment3.text=\n\ Increment\ the\ current\ count\ by\ one.\n
comment4.params=
comment4.target=void\ reset()
comment4.text=\n\ Reset\ the\ current\ count\ to\ zero.\n
numComments=5

View File

@@ -0,0 +1,60 @@
import java.awt.Color;
/**
* Provide a counter for a participant in the simulation.
* This includes an identifying string and a count of how
* many participants of this type currently exist within
* the simulation.
*
* @author Michael Kölling and David J. Barnes
* @version 2016.02.29
*/
public class Counter
{
// A name for this type of simulation participant
private String name;
// How many of this type exist in the simulation.
private int count;
/**
* Provide a name for one of the simulation types.
* @param name A name, e.g. "Fox".
*/
public Counter(String name)
{
this.name = name;
count = 0;
}
/**
* @return The short description of this type.
*/
public String getName()
{
return name;
}
/**
* @return The current count for this type.
*/
public int getCount()
{
return count;
}
/**
* Increment the current count by one.
*/
public void increment()
{
count++;
}
/**
* Reset the current count to zero.
*/
public void reset()
{
count = 0;
}
}

View File

@@ -0,0 +1,41 @@
#BlueJ class context
comment0.params=depth\ width
comment0.target=Field(int,\ int)
comment0.text=\n\ Represent\ a\ field\ of\ the\ given\ dimensions.\n\ @param\ depth\ The\ depth\ of\ the\ field.\n\ @param\ width\ The\ width\ of\ the\ field.\n
comment1.params=
comment1.target=void\ clear()
comment1.text=\n\ Empty\ the\ field.\n
comment10.params=location
comment10.target=java.util.List\ adjacentLocations(Location)
comment10.text=\n\ Return\ a\ shuffled\ list\ of\ locations\ adjacent\ to\ the\ given\ one.\n\ The\ list\ will\ not\ include\ the\ location\ itself.\n\ All\ locations\ will\ lie\ within\ the\ grid.\n\ @param\ location\ The\ location\ from\ which\ to\ generate\ adjacencies.\n\ @return\ A\ list\ of\ locations\ adjacent\ to\ that\ given.\n
comment11.params=
comment11.target=int\ getDepth()
comment11.text=\n\ Return\ the\ depth\ of\ the\ field.\n\ @return\ The\ depth\ of\ the\ field.\n
comment12.params=
comment12.target=int\ getWidth()
comment12.text=\n\ Return\ the\ width\ of\ the\ field.\n\ @return\ The\ width\ of\ the\ field.\n
comment2.params=location
comment2.target=void\ clear(Location)
comment2.text=\n\ Clear\ the\ given\ location.\n\ @param\ location\ The\ location\ to\ clear.\n
comment3.params=animal\ row\ col
comment3.target=void\ place(java.lang.Object,\ int,\ int)
comment3.text=\n\ Place\ an\ animal\ at\ the\ given\ location.\n\ If\ there\ is\ already\ an\ animal\ at\ the\ location\ it\ will\n\ be\ lost.\n\ @param\ animal\ The\ animal\ to\ be\ placed.\n\ @param\ row\ Row\ coordinate\ of\ the\ location.\n\ @param\ col\ Column\ coordinate\ of\ the\ location.\n
comment4.params=animal\ location
comment4.target=void\ place(java.lang.Object,\ Location)
comment4.text=\n\ Place\ an\ animal\ at\ the\ given\ location.\n\ If\ there\ is\ already\ an\ animal\ at\ the\ location\ it\ will\n\ be\ lost.\n\ @param\ animal\ The\ animal\ to\ be\ placed.\n\ @param\ location\ Where\ to\ place\ the\ animal.\n
comment5.params=location
comment5.target=java.lang.Object\ getObjectAt(Location)
comment5.text=\n\ Return\ the\ animal\ at\ the\ given\ location,\ if\ any.\n\ @param\ location\ Where\ in\ the\ field.\n\ @return\ The\ animal\ at\ the\ given\ location,\ or\ null\ if\ there\ is\ none.\n
comment6.params=row\ col
comment6.target=java.lang.Object\ getObjectAt(int,\ int)
comment6.text=\n\ Return\ the\ animal\ at\ the\ given\ location,\ if\ any.\n\ @param\ row\ The\ desired\ row.\n\ @param\ col\ The\ desired\ column.\n\ @return\ The\ animal\ at\ the\ given\ location,\ or\ null\ if\ there\ is\ none.\n
comment7.params=location
comment7.target=Location\ randomAdjacentLocation(Location)
comment7.text=\n\ Generate\ a\ random\ location\ that\ is\ adjacent\ to\ the\n\ given\ location,\ or\ is\ the\ same\ location.\n\ The\ returned\ location\ will\ be\ within\ the\ valid\ bounds\n\ of\ the\ field.\n\ @param\ location\ The\ location\ from\ which\ to\ generate\ an\ adjacency.\n\ @return\ A\ valid\ location\ within\ the\ grid\ area.\n
comment8.params=location
comment8.target=java.util.List\ getFreeAdjacentLocations(Location)
comment8.text=\n\ Get\ a\ shuffled\ list\ of\ the\ free\ adjacent\ locations.\n\ @param\ location\ Get\ locations\ adjacent\ to\ this.\n\ @return\ A\ list\ of\ free\ adjacent\ locations.\n
comment9.params=location
comment9.target=Location\ freeAdjacentLocation(Location)
comment9.text=\n\ Try\ to\ find\ a\ free\ location\ that\ is\ adjacent\ to\ the\n\ given\ location.\ If\ there\ is\ none,\ return\ null.\n\ The\ returned\ location\ will\ be\ within\ the\ valid\ bounds\n\ of\ the\ field.\n\ @param\ location\ The\ location\ from\ which\ to\ generate\ an\ adjacency.\n\ @return\ A\ valid\ location\ within\ the\ grid\ area.\n
numComments=13

View File

@@ -0,0 +1,206 @@
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
/**
* Represent a rectangular grid of field positions.
* Each position is able to store a single animal.
*
* @author David J. Barnes and Michael Kölling
* @version 2016.02.29
*/
public class Field
{
// A random number generator for providing random locations.
private static final Random rand = Randomizer.getRandom();
// The depth and width of the field.
private int depth, width;
// Storage for the animals.
private Object[][] field;
/**
* Represent a field of the given dimensions.
* @param depth The depth of the field.
* @param width The width of the field.
*/
public Field(int depth, int width)
{
this.depth = depth;
this.width = width;
field = new Object[depth][width];
}
/**
* Empty the field.
*/
public void clear()
{
for(int row = 0; row < depth; row++) {
for(int col = 0; col < width; col++) {
field[row][col] = null;
}
}
}
/**
* Clear the given location.
* @param location The location to clear.
*/
public void clear(Location location)
{
field[location.getRow()][location.getCol()] = null;
}
/**
* Place an animal at the given location.
* If there is already an animal at the location it will
* be lost.
* @param animal The animal to be placed.
* @param row Row coordinate of the location.
* @param col Column coordinate of the location.
*/
public void place(Object animal, int row, int col)
{
place(animal, new Location(row, col));
}
/**
* Place an animal at the given location.
* If there is already an animal at the location it will
* be lost.
* @param animal The animal to be placed.
* @param location Where to place the animal.
*/
public void place(Object animal, Location location)
{
field[location.getRow()][location.getCol()] = animal;
}
/**
* Return the animal at the given location, if any.
* @param location Where in the field.
* @return The animal at the given location, or null if there is none.
*/
public Object getObjectAt(Location location)
{
return getObjectAt(location.getRow(), location.getCol());
}
/**
* Return the animal at the given location, if any.
* @param row The desired row.
* @param col The desired column.
* @return The animal at the given location, or null if there is none.
*/
public Object getObjectAt(int row, int col)
{
return field[row][col];
}
/**
* Generate a random location that is adjacent to the
* given location, or is the same location.
* The returned location will be within the valid bounds
* of the field.
* @param location The location from which to generate an adjacency.
* @return A valid location within the grid area.
*/
public Location randomAdjacentLocation(Location location)
{
List<Location> adjacent = adjacentLocations(location);
return adjacent.get(0);
}
/**
* Get a shuffled list of the free adjacent locations.
* @param location Get locations adjacent to this.
* @return A list of free adjacent locations.
*/
public List<Location> getFreeAdjacentLocations(Location location)
{
List<Location> free = new LinkedList<>();
List<Location> adjacent = adjacentLocations(location);
for(Location next : adjacent) {
if(getObjectAt(next) == null) {
free.add(next);
}
}
return free;
}
/**
* Try to find a free location that is adjacent to the
* given location. If there is none, return null.
* The returned location will be within the valid bounds
* of the field.
* @param location The location from which to generate an adjacency.
* @return A valid location within the grid area.
*/
public Location freeAdjacentLocation(Location location)
{
// The available free ones.
List<Location> free = getFreeAdjacentLocations(location);
if(free.size() > 0) {
return free.get(0);
}
else {
return null;
}
}
/**
* Return a shuffled list of locations adjacent to the given one.
* The list will not include the location itself.
* All locations will lie within the grid.
* @param location The location from which to generate adjacencies.
* @return A list of locations adjacent to that given.
*/
public List<Location> adjacentLocations(Location location)
{
assert location != null : "Null location passed to adjacentLocations";
// The list of locations to be returned.
List<Location> locations = new LinkedList<>();
if(location != null) {
int row = location.getRow();
int col = location.getCol();
for(int roffset = -1; roffset <= 1; roffset++) {
int nextRow = row + roffset;
if(nextRow >= 0 && nextRow < depth) {
for(int coffset = -1; coffset <= 1; coffset++) {
int nextCol = col + coffset;
// Exclude invalid locations and the original location.
if(nextCol >= 0 && nextCol < width && (roffset != 0 || coffset != 0)) {
locations.add(new Location(nextRow, nextCol));
}
}
}
}
// Shuffle the list. Several other methods rely on the list
// being in a random order.
Collections.shuffle(locations, rand);
}
return locations;
}
/**
* Return the depth of the field.
* @return The depth of the field.
*/
public int getDepth()
{
return depth;
}
/**
* Return the width of the field.
* @return The width of the field.
*/
public int getWidth()
{
return width;
}
}

View File

@@ -0,0 +1,26 @@
#BlueJ class context
comment0.params=
comment0.target=FieldStats()
comment0.text=\n\ Construct\ a\ FieldStats\ object.\n
comment1.params=field
comment1.target=java.lang.String\ getPopulationDetails(Field)
comment1.text=\n\ Get\ details\ of\ what\ is\ in\ the\ field.\n\ @return\ A\ string\ describing\ what\ is\ in\ the\ field.\n
comment2.params=field\ key
comment2.target=int\ getPopulationCount(Field,\ java.lang.Class)
comment2.text=\n\ Get\ the\ number\ of\ individuals\ in\ the\ population\ of\ a\ given\ class.\n\ @return\ \ An\ int\ with\ the\ number\ for\ this\ class.\n
comment3.params=
comment3.target=void\ reset()
comment3.text=\n\ Invalidate\ the\ current\ set\ of\ statistics;\ reset\ all\ \n\ counts\ to\ zero.\n
comment4.params=animalClass
comment4.target=void\ incrementCount(java.lang.Class)
comment4.text=\n\ Increment\ the\ count\ for\ one\ class\ of\ animal.\n\ @param\ animalClass\ The\ class\ of\ animal\ to\ increment.\n
comment5.params=
comment5.target=void\ countFinished()
comment5.text=\n\ Indicate\ that\ an\ animal\ count\ has\ been\ completed.\n
comment6.params=field
comment6.target=boolean\ isViable(Field)
comment6.text=\n\ Determine\ whether\ the\ simulation\ is\ still\ viable.\n\ I.e.,\ should\ it\ continue\ to\ run.\n\ @return\ true\ If\ there\ is\ more\ than\ one\ species\ alive.\n
comment7.params=field
comment7.target=void\ generateCounts(Field)
comment7.text=\n\ Generate\ counts\ of\ the\ number\ of\ foxes\ and\ rabbits.\n\ These\ are\ not\ kept\ up\ to\ date\ as\ foxes\ and\ rabbits\n\ are\ placed\ in\ the\ field,\ but\ only\ when\ a\ request\n\ is\ made\ for\ the\ information.\n\ @param\ field\ The\ field\ to\ generate\ the\ stats\ for.\n
numComments=8

View File

@@ -0,0 +1,142 @@
import java.awt.Color;
import java.util.HashMap;
/**
* This class collects and provides some statistical data on the state
* of a field. It is flexible: it will create and maintain a counter
* for any class of object that is found within the field.
*
* @author David J. Barnes and Michael Kölling
* @version 2016.02.29
*/
public class FieldStats
{
// Counters for each type of entity (fox, rabbit, etc.) in the simulation.
private HashMap<Class, Counter> counters;
// Whether the counters are currently up to date.
private boolean countsValid;
/**
* Construct a FieldStats object.
*/
public FieldStats()
{
// Set up a collection for counters for each type of animal that
// we might find
counters = new HashMap<>();
countsValid = false;
}
/**
* Get details of what is in the field.
* @return A string describing what is in the field.
*/
public String getPopulationDetails(Field field)
{
StringBuffer buffer = new StringBuffer();
if(!countsValid) {
generateCounts(field);
}
for(Class key : counters.keySet()) {
Counter info = counters.get(key);
buffer.append(info.getName());
buffer.append(": ");
buffer.append(info.getCount());
buffer.append(' ');
}
return buffer.toString();
}
/**
* Get the number of individuals in the population of a given class.
* @return An int with the number for this class.
*/
public int getPopulationCount(Field field, Class key)
{
if(!countsValid) {
generateCounts(field);
}
Counter counter = counters.get(key);
return counter.getCount();
}
/**
* Invalidate the current set of statistics; reset all
* counts to zero.
*/
public void reset()
{
countsValid = false;
for(Class key : counters.keySet()) {
Counter count = counters.get(key);
count.reset();
}
}
/**
* Increment the count for one class of animal.
* @param animalClass The class of animal to increment.
*/
public void incrementCount(Class animalClass)
{
Counter count = counters.get(animalClass);
if(count == null) {
// We do not have a counter for this species yet.
// Create one.
count = new Counter(animalClass.getName());
counters.put(animalClass, count);
}
count.increment();
}
/**
* Indicate that an animal count has been completed.
*/
public void countFinished()
{
countsValid = true;
}
/**
* Determine whether the simulation is still viable.
* I.e., should it continue to run.
* @return true If there is more than one species alive.
*/
public boolean isViable(Field field)
{
// How many counts are non-zero.
int nonZero = 0;
if(!countsValid) {
generateCounts(field);
}
for(Class key : counters.keySet()) {
Counter info = counters.get(key);
if(info.getCount() > 0) {
nonZero++;
}
}
return nonZero > 1;
}
/**
* Generate counts of the number of foxes and rabbits.
* These are not kept up to date as foxes and rabbits
* are placed in the field, but only when a request
* is made for the information.
* @param field The field to generate the stats for.
*/
private void generateCounts(Field field)
{
reset();
for(int row = 0; row < field.getDepth(); row++) {
for(int col = 0; col < field.getWidth(); col++) {
Object animal = field.getObjectAt(row, col);
if(animal != null) {
incrementCount(animal.getClass());
}
}
}
countsValid = true;
}
}

View File

@@ -0,0 +1,26 @@
#BlueJ class context
comment0.params=randomAge\ field\ location
comment0.target=Fox(boolean,\ Field,\ Location)
comment0.text=\n\ Create\ a\ fox.\ A\ fox\ can\ be\ created\ as\ a\ new\ born\ (age\ zero\n\ and\ not\ hungry)\ or\ with\ a\ random\ age\ and\ food\ level.\n\ \n\ @param\ randomAge\ If\ true,\ the\ fox\ will\ have\ random\ age\ and\ hunger\ level.\n\ @param\ field\ The\ field\ currently\ occupied.\n\ @param\ location\ The\ location\ within\ the\ field.\n
comment1.params=newFoxes
comment1.target=void\ act(java.util.List)
comment1.text=\n\ This\ is\ what\ the\ fox\ does\ most\ of\ the\ time\:\ it\ hunts\ for\n\ rabbits.\ In\ the\ process,\ it\ might\ breed,\ die\ of\ hunger,\n\ or\ die\ of\ old\ age.\n\ @param\ field\ The\ field\ currently\ occupied.\n\ @param\ newFoxes\ A\ list\ to\ return\ newly\ born\ foxes.\n
comment2.params=
comment2.target=void\ incrementAge()
comment2.text=\n\ Increase\ the\ age.\ This\ could\ result\ in\ the\ fox's\ death.\n
comment3.params=
comment3.target=void\ incrementHunger()
comment3.text=\n\ Make\ this\ fox\ more\ hungry.\ This\ could\ result\ in\ the\ fox's\ death.\n
comment4.params=
comment4.target=Location\ findFood()
comment4.text=\n\ Look\ for\ rabbits\ adjacent\ to\ the\ current\ location.\n\ Only\ the\ first\ live\ rabbit\ is\ eaten.\n\ @return\ Where\ food\ was\ found,\ or\ null\ if\ it\ wasn't.\n
comment5.params=newFoxes
comment5.target=void\ giveBirth(java.util.List)
comment5.text=\n\ Check\ whether\ or\ not\ this\ fox\ is\ to\ give\ birth\ at\ this\ step.\n\ New\ births\ will\ be\ made\ into\ free\ adjacent\ locations.\n\ @param\ newFoxes\ A\ list\ to\ return\ newly\ born\ foxes.\n
comment6.params=
comment6.target=int\ breed()
comment6.text=\n\ Generate\ a\ number\ representing\ the\ number\ of\ births,\n\ if\ it\ can\ breed.\n\ @return\ The\ number\ of\ births\ (may\ be\ zero).\n
comment7.params=
comment7.target=boolean\ canBreed()
comment7.text=\n\ A\ fox\ can\ breed\ if\ it\ has\ reached\ the\ breeding\ age.\n
numComments=8

View File

@@ -0,0 +1,174 @@
import java.util.List;
import java.util.Iterator;
import java.util.Random;
/**
* A simple model of a fox.
* Foxes age, move, eat rabbits, and die.
*
* @author David J. Barnes and Michael Kölling
* @version 2016.03.18
*/
public class Fox extends Animal
{
// Characteristics shared by all foxes (class variables).
// The age at which a fox can start to breed.
private static final int BREEDING_AGE = 15;
// The age to which a fox can live.
private static final int MAX_AGE = 150;
// The likelihood of a fox breeding.
private static final double BREEDING_PROBABILITY = 0.08;
// The maximum number of births.
private static final int MAX_LITTER_SIZE = 2;
// The food value of a single rabbit. In effect, this is the
// number of steps a fox can go before it has to eat again.
private static final int RABBIT_FOOD_VALUE = 9;
// A shared random number generator to control breeding.
private static final Random rand = Randomizer.getRandom();
// Individual characteristics (instance fields).
// The fox's age.
private int age;
// The fox's food level, which is increased by eating rabbits.
private int foodLevel;
/**
* Create a fox. A fox can be created as a new born (age zero
* and not hungry) or with a random age and food level.
*
* @param randomAge If true, the fox will have random age and hunger level.
* @param field The field currently occupied.
* @param location The location within the field.
*/
public Fox(boolean randomAge, Field field, Location location)
{
super(field, location);
if(randomAge) {
age = rand.nextInt(MAX_AGE);
foodLevel = rand.nextInt(RABBIT_FOOD_VALUE);
}
else {
age = 0;
foodLevel = RABBIT_FOOD_VALUE;
}
}
/**
* This is what the fox does most of the time: it hunts for
* rabbits. In the process, it might breed, die of hunger,
* or die of old age.
* @param field The field currently occupied.
* @param newFoxes A list to return newly born foxes.
*/
public void act(List<Animal> newFoxes)
{
incrementAge();
incrementHunger();
if(isAlive()) {
giveBirth(newFoxes);
// Move towards a source of food if found.
Location newLocation = findFood();
if(newLocation == null) {
// No food found - try to move to a free location.
newLocation = getField().freeAdjacentLocation(getLocation());
}
// See if it was possible to move.
if(newLocation != null) {
setLocation(newLocation);
}
else {
// Overcrowding.
setDead();
}
}
}
/**
* Increase the age. This could result in the fox's death.
*/
private void incrementAge()
{
age++;
if(age > MAX_AGE) {
setDead();
}
}
/**
* Make this fox more hungry. This could result in the fox's death.
*/
private void incrementHunger()
{
foodLevel--;
if(foodLevel <= 0) {
setDead();
}
}
/**
* Look for rabbits adjacent to the current location.
* Only the first live rabbit is eaten.
* @return Where food was found, or null if it wasn't.
*/
private Location findFood()
{
Field field = getField();
List<Location> adjacent = field.adjacentLocations(getLocation());
Iterator<Location> it = adjacent.iterator();
while(it.hasNext()) {
Location where = it.next();
Object animal = field.getObjectAt(where);
if(animal instanceof Rabbit) {
Rabbit rabbit = (Rabbit) animal;
if(rabbit.isAlive()) {
rabbit.setDead();
foodLevel = RABBIT_FOOD_VALUE;
return where;
}
}
}
return null;
}
/**
* Check whether or not this fox is to give birth at this step.
* New births will be made into free adjacent locations.
* @param newFoxes A list to return newly born foxes.
*/
private void giveBirth(List<Animal> newFoxes)
{
// New foxes are born into adjacent locations.
// Get a list of adjacent free locations.
Field field = getField();
List<Location> free = field.getFreeAdjacentLocations(getLocation());
int births = breed();
for(int b = 0; b < births && free.size() > 0; b++) {
Location loc = free.remove(0);
Fox young = new Fox(false, field, loc);
newFoxes.add(young);
}
}
/**
* Generate a number representing the number of births,
* if it can breed.
* @return The number of births (may be zero).
*/
private int breed()
{
int births = 0;
if(canBreed() && rand.nextDouble() <= BREEDING_PROBABILITY) {
births = rand.nextInt(MAX_LITTER_SIZE) + 1;
}
return births;
}
/**
* A fox can breed if it has reached the breeding age.
*/
private boolean canBreed()
{
return age >= BREEDING_AGE;
}
}

View File

@@ -0,0 +1,20 @@
#BlueJ class context
comment0.params=width\ height\ startMax
comment0.target=GraphView(int,\ int,\ int)
comment0.text=\n\ Constructor.\n\ \n\ @param\ width\ The\ width\ of\ the\ plotter\ window\ (in\ pixels).\n\ @param\ height\ The\ height\ of\ the\ plotter\ window\ (in\ pixels).\n\ @param\ startMax\ The\ initial\ maximum\ value\ for\ the\ y\ axis.\n
comment1.params=animalClass\ color
comment1.target=void\ setColor(java.lang.Class,\ java.awt.Color)
comment1.text=\n\ Define\ a\ color\ to\ be\ used\ for\ a\ given\ class\ of\ animal.\n\ @param\ animalClass\ The\ animal's\ Class\ object.\n\ @param\ color\ The\ color\ to\ be\ used\ for\ the\ given\ class.\n
comment2.params=step\ field
comment2.target=void\ showStatus(int,\ Field)
comment2.text=\n\ Show\ the\ current\ status\ of\ the\ field.\ The\ status\ is\ shown\ by\ displaying\ a\ line\ graph\ for\n\ two\ classes\ in\ the\ field.\ This\ view\ currently\ does\ not\ work\ for\ more\ (or\ fewer)\ than\ exactly\n\ two\ classes.\ If\ the\ field\ contains\ more\ than\ two\ different\ types\ of\ animal,\ only\ two\ of\ the\ classes\n\ will\ be\ plotted.\n\ \n\ @param\ step\ Which\ iteration\ step\ it\ is.\n\ @param\ field\ The\ field\ whose\ status\ is\ to\ be\ displayed.\n
comment3.params=field
comment3.target=boolean\ isViable(Field)
comment3.text=\n\ Determine\ whether\ the\ simulation\ should\ continue\ to\ run.\n\ @return\ true\ If\ there\ is\ more\ than\ one\ species\ alive.\n
comment4.params=
comment4.target=void\ reset()
comment4.text=\n\ Prepare\ for\ a\ new\ run.\n
comment5.params=width\ height\ startMax
comment5.target=javax.swing.JFrame\ makeFrame(int,\ int,\ int)
comment5.text=\n\ Prepare\ the\ frame\ for\ the\ graph\ display.\n
numComments=6

View File

@@ -0,0 +1,298 @@
import java.awt.*;
import java.awt.image.*;
import javax.swing.*;
import java.util.*;
/**
* The GraphView provides a view of two populations of actors in the field as a line graph
* over time. In its current version, it can only plot exactly two different classes of
* animals. If further animals are introduced, they will not currently be displayed.
*
* @author Michael Kölling and David J. Barnes
* @version 2016.03.18
*/
public class GraphView implements SimulatorView
{
private static final Color LIGHT_GRAY = new Color(0, 0, 0, 40);
private static JFrame frame;
private static GraphPanel graph;
private static JLabel stepLabel;
private static JLabel countLabel;
// The classes being tracked by this view
private Set<Class<?>> classes;
// A map for storing colors for participants in the simulation
private Map<Class<?>, Color> colors;
// A statistics object computing and storing simulation information
private FieldStats stats;
/**
* Constructor.
*
* @param width The width of the plotter window (in pixels).
* @param height The height of the plotter window (in pixels).
* @param startMax The initial maximum value for the y axis.
*/
public GraphView(int width, int height, int startMax)
{
stats = new FieldStats();
classes = new HashSet<>();
colors = new HashMap<>();
if (frame == null) {
frame = makeFrame(width, height, startMax);
}
else {
graph.newRun();
}
//showStatus(0, null);
}
/**
* Define a color to be used for a given class of animal.
* @param animalClass The animal's Class object.
* @param color The color to be used for the given class.
*/
public void setColor(Class<?> animalClass, Color color)
{
colors.put(animalClass, color);
classes = colors.keySet();
}
/**
* Show the current status of the field. The status is shown by displaying a line graph for
* two classes in the field. This view currently does not work for more (or fewer) than exactly
* two classes. If the field contains more than two different types of animal, only two of the classes
* will be plotted.
*
* @param step Which iteration step it is.
* @param field The field whose status is to be displayed.
*/
public void showStatus(int step, Field field)
{
graph.update(step, field, stats);
}
/**
* Determine whether the simulation should continue to run.
* @return true If there is more than one species alive.
*/
public boolean isViable(Field field)
{
return stats.isViable(field);
}
/**
* Prepare for a new run.
*/
public void reset()
{
stats.reset();
graph.newRun();
}
/**
* Prepare the frame for the graph display.
*/
private JFrame makeFrame(int width, int height, int startMax)
{
JFrame frame = new JFrame("Graph View");
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
Container contentPane = frame.getContentPane();
graph = new GraphPanel(width, height, startMax);
contentPane.add(graph, BorderLayout.CENTER);
JPanel bottom = new JPanel();
bottom.add(new JLabel("Step:"));
stepLabel = new JLabel("");
bottom.add(stepLabel);
countLabel = new JLabel(" ");
bottom.add(countLabel);
contentPane.add(bottom, BorderLayout.SOUTH);
frame.pack();
frame.setLocation(20, 600);
frame.setVisible(true);
return frame;
}
// ============================================================================
/**
* Nested class: a component to display the graph.
*/
class GraphPanel extends JComponent
{
private static final double SCALE_FACTOR = 0.8;
// An internal image buffer that is used for painting. For
// actual display, this image buffer is then copied to screen.
private BufferedImage graphImage;
private int lastVal1, lastVal2;
private int yMax;
/**
* Create a new, empty GraphPanel.
*/
public GraphPanel(int width, int height, int startMax)
{
graphImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
clearImage();
lastVal1 = height;
lastVal2 = height;
yMax = startMax;
}
/**
* Indicate a new simulation run on this panel.
*/
public void newRun()
{
int height = graphImage.getHeight();
int width = graphImage.getWidth();
Graphics g = graphImage.getGraphics();
g.copyArea(4, 0, width-4, height, -4, 0);
g.setColor(Color.BLACK);
g.drawLine(width-4, 0, width-4, height);
g.drawLine(width-2, 0, width-2, height);
lastVal1 = height;
lastVal2 = height;
repaint();
}
/**
* Dispay a new point of data.
*/
public void update(int step, Field field, FieldStats stats)
{
if (classes.size() >= 2) {
Iterator<Class<?>> it = classes.iterator();
Class<?> class1 = it.next();
Class<?> class2 = it.next();
stats.reset();
int count1 = stats.getPopulationCount(field, class1);
int count2 = stats.getPopulationCount(field, class2);
Graphics g = graphImage.getGraphics();
int height = graphImage.getHeight();
int width = graphImage.getWidth();
// move graph one pixel to left
g.copyArea(1, 0, width-1, height, -1, 0);
// calculate y, check whether it's out of screen. scale down if necessary.
int y = height - ((height * count1) / yMax) - 1;
while (y<0) {
scaleDown();
y = height - ((height * count1) / yMax) - 1;
}
g.setColor(LIGHT_GRAY);
g.drawLine(width-2, y, width-2, height);
g.setColor(colors.get(class1));
g.drawLine(width-3, lastVal1, width-2, y);
lastVal1 = y;
y = height - ((height * count2) / yMax) - 1;
while (y<0) {
scaleDown();
y = height - ((height * count2) / yMax) - 1;
}
g.setColor(LIGHT_GRAY);
g.drawLine(width-2, y, width-2, height);
g.setColor(colors.get(class2));
g.drawLine(width-3, lastVal2, width-2, y);
lastVal2 = y;
repaint();
stepLabel.setText("" + step);
countLabel.setText(stats.getPopulationDetails(field));
}
}
/**
* Scale the current graph down vertically to make more room at the top.
*/
public void scaleDown()
{
Graphics g = graphImage.getGraphics();
int height = graphImage.getHeight();
int width = graphImage.getWidth();
BufferedImage tmpImage = new BufferedImage(width, (int)(height*SCALE_FACTOR),
BufferedImage.TYPE_INT_RGB);
Graphics2D gtmp = (Graphics2D) tmpImage.getGraphics();
gtmp.scale(1.0, SCALE_FACTOR);
gtmp.drawImage(graphImage, 0, 0, null);
int oldTop = (int) (height * (1.0-SCALE_FACTOR));
g.setColor(Color.WHITE);
g.fillRect(0, 0, width, oldTop);
g.drawImage(tmpImage, 0, oldTop, null);
yMax = (int) (yMax / SCALE_FACTOR);
lastVal1 = oldTop + (int) (lastVal1 * SCALE_FACTOR);
lastVal2 = oldTop + (int) (lastVal2 * SCALE_FACTOR);
repaint();
}
/**
* Clear the image on this panel.
*/
final public void clearImage()
{
Graphics g = graphImage.getGraphics();
g.setColor(Color.WHITE);
g.fillRect(0, 0, graphImage.getWidth(), graphImage.getHeight());
repaint();
}
// The following methods are redefinitions of methods
// inherited from superclasses.
/**
* Tell the layout manager how big we would like to be.
* (This method gets called by layout managers for placing
* the components.)
*
* @return The preferred dimension for this component.
*/
public Dimension getPreferredSize()
{
return new Dimension(graphImage.getWidth(), graphImage.getHeight());
}
/**
* This component is opaque.
*/
public boolean isOpaque()
{
return true;
}
/**
* This component needs to be redisplayed. Copy the internal image
* to screen. (This method gets called by the Swing screen painter
* every time it want this component displayed.)
*
* @param g The graphics context that can be used to draw on this component.
*/
public void paintComponent(Graphics g)
{
if(graphImage != null) {
g.drawImage(graphImage, 0, 0, null);
}
}
}
}

View File

@@ -0,0 +1,20 @@
#BlueJ class context
comment0.params=height\ width
comment0.target=GridView(int,\ int)
comment0.text=\n\ Create\ a\ view\ of\ the\ given\ width\ and\ height.\n\ @param\ height\ The\ simulation's\ height.\n\ @param\ width\ \ The\ simulation's\ width.\n
comment1.params=animalClass\ color
comment1.target=void\ setColor(java.lang.Class,\ java.awt.Color)
comment1.text=\n\ Define\ a\ color\ to\ be\ used\ for\ a\ given\ class\ of\ animal.\n\ @param\ animalClass\ The\ animal's\ Class\ object.\n\ @param\ color\ The\ color\ to\ be\ used\ for\ the\ given\ class.\n
comment2.params=animalClass
comment2.target=java.awt.Color\ getColor(java.lang.Class)
comment2.text=\n\ @return\ The\ color\ to\ be\ used\ for\ a\ given\ class\ of\ animal.\n
comment3.params=step\ field
comment3.target=void\ showStatus(int,\ Field)
comment3.text=\n\ Show\ the\ current\ status\ of\ the\ field.\n\ @param\ step\ Which\ iteration\ step\ it\ is.\n\ @param\ field\ The\ field\ whose\ status\ is\ to\ be\ displayed.\n
comment4.params=field
comment4.target=boolean\ isViable(Field)
comment4.text=\n\ Determine\ whether\ the\ simulation\ should\ continue\ to\ run.\n\ @return\ true\ If\ there\ is\ more\ than\ one\ species\ alive.\n
comment5.params=
comment5.target=void\ reset()
comment5.text=\n\ Prepare\ for\ a\ new\ run.\n
numComments=6

View File

@@ -0,0 +1,222 @@
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.HashMap;
import java.util.Map;
/**
* A graphical view of the simulation grid.
* The view displays a colored rectangle for each location representing its contents.
* Colors for each type of species can be defined using the setColor method.
*
* @author Michael Kölling and David J. Barnes
* @version 2016.03.18
*/
public class GridView extends JFrame implements SimulatorView
{
// Colors used for empty locations.
private static final Color EMPTY_COLOR = Color.white;
// Color used for objects that have no defined color.
private static final Color UNKNOWN_COLOR = Color.gray;
private final String STEP_PREFIX = "Step: ";
private final String POPULATION_PREFIX = "Population: ";
private JLabel stepLabel, population;
private FieldView fieldView;
// A map for storing colors for participants in the simulation
private Map<Class<?>, Color> colors;
// A statistics object computing and storing simulation information
private FieldStats stats;
/**
* Create a view of the given width and height.
* @param height The simulation's height.
* @param width The simulation's width.
*/
public GridView(int height, int width)
{
stats = new FieldStats();
colors = new HashMap<>();
setTitle("Fox and Rabbit Simulation");
stepLabel = new JLabel(STEP_PREFIX, JLabel.CENTER);
population = new JLabel(POPULATION_PREFIX, JLabel.CENTER);
setLocation(20, 50);
fieldView = new FieldView(height, width);
Container contents = getContentPane();
contents.add(stepLabel, BorderLayout.NORTH);
contents.add(fieldView, BorderLayout.CENTER);
contents.add(population, BorderLayout.SOUTH);
pack();
setVisible(true);
}
/**
* Define a color to be used for a given class of animal.
* @param animalClass The animal's Class object.
* @param color The color to be used for the given class.
*/
public void setColor(Class<?> animalClass, Color color)
{
colors.put(animalClass, color);
}
/**
* @return The color to be used for a given class of animal.
*/
private Color getColor(Class<?> animalClass)
{
Color col = colors.get(animalClass);
if(col == null) {
// no color defined for this class
return UNKNOWN_COLOR;
}
else {
return col;
}
}
/**
* Show the current status of the field.
* @param step Which iteration step it is.
* @param field The field whose status is to be displayed.
*/
public void showStatus(int step, Field field)
{
if(!isVisible()) {
setVisible(true);
}
stepLabel.setText(STEP_PREFIX + step);
stats.reset();
fieldView.preparePaint();
for(int row = 0; row < field.getDepth(); row++) {
for(int col = 0; col < field.getWidth(); col++) {
Object animal = field.getObjectAt(row, col);
if(animal != null) {
Class<?> cls = animal.getClass();
stats.incrementCount(cls);
fieldView.drawMark(col, row, getColor(cls));
}
else {
fieldView.drawMark(col, row, EMPTY_COLOR);
}
}
}
stats.countFinished();
population.setText(POPULATION_PREFIX + stats.getPopulationDetails(field));
fieldView.repaint();
}
/**
* Determine whether the simulation should continue to run.
* @return true If there is more than one species alive.
*/
public boolean isViable(Field field)
{
return stats.isViable(field);
}
/**
* Prepare for a new run.
*/
public void reset()
{
stats.reset();
}
/**
* Provide a graphical view of a rectangular field. This is
* a nested class (a class defined inside a class) which
* defines a custom component for the user interface. This
* component displays the field.
* This is rather advanced GUI stuff - you can ignore this
* for your project if you like.
*/
private class FieldView extends JPanel
{
private final int GRID_VIEW_SCALING_FACTOR = 6;
private int gridWidth, gridHeight;
private int xScale, yScale;
Dimension size;
private Graphics g;
private Image fieldImage;
/**
* Create a new FieldView component.
*/
public FieldView(int height, int width)
{
gridHeight = height;
gridWidth = width;
size = new Dimension(0, 0);
}
/**
* Tell the GUI manager how big we would like to be.
*/
public Dimension getPreferredSize()
{
return new Dimension(gridWidth * GRID_VIEW_SCALING_FACTOR,
gridHeight * GRID_VIEW_SCALING_FACTOR);
}
/**
* Prepare for a new round of painting. Since the component
* may be resized, compute the scaling factor again.
*/
public void preparePaint()
{
if(! size.equals(getSize())) { // if the size has changed...
size = getSize();
fieldImage = fieldView.createImage(size.width, size.height);
g = fieldImage.getGraphics();
xScale = size.width / gridWidth;
if(xScale < 1) {
xScale = GRID_VIEW_SCALING_FACTOR;
}
yScale = size.height / gridHeight;
if(yScale < 1) {
yScale = GRID_VIEW_SCALING_FACTOR;
}
}
}
/**
* Paint on grid location on this field in a given color.
*/
public void drawMark(int x, int y, Color color)
{
g.setColor(color);
g.fillRect(x * xScale, y * yScale, xScale-1, yScale-1);
}
/**
* The field view component needs to be redisplayed. Copy the
* internal image to screen.
*/
public void paintComponent(Graphics g)
{
if(fieldImage != null) {
Dimension currentSize = getSize();
if(size.equals(currentSize)) {
g.drawImage(fieldImage, 0, 0, null);
}
else {
// Rescale the previous image.
g.drawImage(fieldImage, 0, 0, currentSize.width, currentSize.height, null);
}
}
}
}
}

View File

@@ -0,0 +1,20 @@
#BlueJ class context
comment0.params=row\ col
comment0.target=Location(int,\ int)
comment0.text=\n\ Represent\ a\ row\ and\ column.\n\ @param\ row\ The\ row.\n\ @param\ col\ The\ column.\n
comment1.params=obj
comment1.target=boolean\ equals(java.lang.Object)
comment1.text=\n\ Implement\ content\ equality.\n
comment2.params=
comment2.target=java.lang.String\ toString()
comment2.text=\n\ Return\ a\ string\ of\ the\ form\ row,column\n\ @return\ A\ string\ representation\ of\ the\ location.\n
comment3.params=
comment3.target=int\ hashCode()
comment3.text=\n\ Use\ the\ top\ 16\ bits\ for\ the\ row\ value\ and\ the\ bottom\ for\n\ the\ column.\ Except\ for\ very\ big\ grids,\ this\ should\ give\ a\n\ unique\ hash\ code\ for\ each\ (row,\ col)\ pair.\n\ @return\ A\ hashcode\ for\ the\ location.\n
comment4.params=
comment4.target=int\ getRow()
comment4.text=\n\ @return\ The\ row.\n
comment5.params=
comment5.target=int\ getCol()
comment5.text=\n\ @return\ The\ column.\n
numComments=6

View File

@@ -0,0 +1,73 @@
/**
* Represent a location in a rectangular grid.
*
* @author David J. Barnes and Michael Kölling
* @version 2016.02.29
*/
public class Location
{
// Row and column positions.
private int row;
private int col;
/**
* Represent a row and column.
* @param row The row.
* @param col The column.
*/
public Location(int row, int col)
{
this.row = row;
this.col = col;
}
/**
* Implement content equality.
*/
public boolean equals(Object obj)
{
if(obj instanceof Location) {
Location other = (Location) obj;
return row == other.getRow() && col == other.getCol();
}
else {
return false;
}
}
/**
* Return a string of the form row,column
* @return A string representation of the location.
*/
public String toString()
{
return row + "," + col;
}
/**
* Use the top 16 bits for the row value and the bottom for
* the column. Except for very big grids, this should give a
* unique hash code for each (row, col) pair.
* @return A hashcode for the location.
*/
public int hashCode()
{
return (row << 16) + col;
}
/**
* @return The row.
*/
public int getRow()
{
return row;
}
/**
* @return The column.
*/
public int getCol()
{
return col;
}
}

View File

@@ -0,0 +1,22 @@
Project: foxes-and-rabbits-graph
Authors: Michael Kölling and David J. Barnes
This project is part of the material for chapter 10 of the book
Objects First with Java - A Practical Introduction using BlueJ
Sixth edition
David J. Barnes and Michael Kölling
Pearson Education, 2016
A predator-prey simulation involving foxes and rabbits in
an enclosed rectangular field.
This is the first version of the simulation. This version
does not use inheritance.
How to start:
Create a Simulator object.
Then call one of:
+ simulateOneStep - for a single step.
+ simulate - and supply a number (say 10) for that many steps.
+ runLongSimulation - for a simulation of 500 steps.

View File

@@ -0,0 +1,20 @@
#BlueJ class context
comment0.params=randomAge\ field\ location
comment0.target=Rabbit(boolean,\ Field,\ Location)
comment0.text=\n\ Create\ a\ new\ rabbit.\ A\ rabbit\ may\ be\ created\ with\ age\n\ zero\ (a\ new\ born)\ or\ with\ a\ random\ age.\n\ \n\ @param\ randomAge\ If\ true,\ the\ rabbit\ will\ have\ a\ random\ age.\n\ @param\ field\ The\ field\ currently\ occupied.\n\ @param\ location\ The\ location\ within\ the\ field.\n
comment1.params=newRabbits
comment1.target=void\ act(java.util.List)
comment1.text=\n\ This\ is\ what\ the\ rabbit\ does\ most\ of\ the\ time\ -\ it\ runs\ \n\ around.\ Sometimes\ it\ will\ breed\ or\ die\ of\ old\ age.\n\ @param\ newRabbits\ A\ list\ to\ return\ newly\ born\ rabbits.\n
comment2.params=
comment2.target=void\ incrementAge()
comment2.text=\n\ Increase\ the\ age.\n\ This\ could\ result\ in\ the\ rabbit's\ death.\n
comment3.params=newRabbits
comment3.target=void\ giveBirth(java.util.List)
comment3.text=\n\ Check\ whether\ or\ not\ this\ rabbit\ is\ to\ give\ birth\ at\ this\ step.\n\ New\ births\ will\ be\ made\ into\ free\ adjacent\ locations.\n\ @param\ newRabbits\ A\ list\ to\ return\ newly\ born\ rabbits.\n
comment4.params=
comment4.target=int\ breed()
comment4.text=\n\ Generate\ a\ number\ representing\ the\ number\ of\ births,\n\ if\ it\ can\ breed.\n\ @return\ The\ number\ of\ births\ (may\ be\ zero).\n
comment5.params=
comment5.target=boolean\ canBreed()
comment5.text=\n\ A\ rabbit\ can\ breed\ if\ it\ has\ reached\ the\ breeding\ age.\n\ @return\ true\ if\ the\ rabbit\ can\ breed,\ false\ otherwise.\n
numComments=6

View File

@@ -0,0 +1,123 @@
import java.util.List;
import java.util.Random;
/**
* A simple model of a rabbit.
* Rabbits age, move, breed, and die.
*
* @author David J. Barnes and Michael Kölling
* @version 2016.03.18
*/
public class Rabbit extends Animal
{
// Characteristics shared by all rabbits (class variables).
// The age at which a rabbit can start to breed.
private static final int BREEDING_AGE = 5;
// The age to which a rabbit can live.
private static final int MAX_AGE = 40;
// The likelihood of a rabbit breeding.
private static final double BREEDING_PROBABILITY = 0.12;
// The maximum number of births.
private static final int MAX_LITTER_SIZE = 4;
// A shared random number generator to control breeding.
private static final Random rand = Randomizer.getRandom();
// Individual characteristics (instance fields).
// The rabbit's age.
private int age;
/**
* Create a new rabbit. A rabbit may be created with age
* zero (a new born) or with a random age.
*
* @param randomAge If true, the rabbit will have a random age.
* @param field The field currently occupied.
* @param location The location within the field.
*/
public Rabbit(boolean randomAge, Field field, Location location)
{
super(field, location);
age = 0;
if(randomAge) {
age = rand.nextInt(MAX_AGE);
}
}
/**
* This is what the rabbit does most of the time - it runs
* around. Sometimes it will breed or die of old age.
* @param newRabbits A list to return newly born rabbits.
*/
public void act(List<Animal> newRabbits)
{
incrementAge();
if(isAlive()) {
giveBirth(newRabbits);
// Try to move into a free location.
Location newLocation = getField().freeAdjacentLocation(getLocation());
if(newLocation != null) {
setLocation(newLocation);
}
else {
// Overcrowding.
setDead();
}
}
}
/**
* Increase the age.
* This could result in the rabbit's death.
*/
private void incrementAge()
{
age++;
if(age > MAX_AGE) {
setDead();
}
}
/**
* Check whether or not this rabbit is to give birth at this step.
* New births will be made into free adjacent locations.
* @param newRabbits A list to return newly born rabbits.
*/
private void giveBirth(List<Animal> newRabbits)
{
// New rabbits are born into adjacent locations.
// Get a list of adjacent free locations.
Field field = getField();
List<Location> free = field.getFreeAdjacentLocations(getLocation());
int births = breed();
for(int b = 0; b < births && free.size() > 0; b++) {
Location loc = free.remove(0);
Rabbit young = new Rabbit(false, field, loc);
newRabbits.add(young);
}
}
/**
* Generate a number representing the number of births,
* if it can breed.
* @return The number of births (may be zero).
*/
private int breed()
{
int births = 0;
if(canBreed() && rand.nextDouble() <= BREEDING_PROBABILITY) {
births = rand.nextInt(MAX_LITTER_SIZE) + 1;
}
return births;
}
/**
* A rabbit can breed if it has reached the breeding age.
* @return true if the rabbit can breed, false otherwise.
*/
private boolean canBreed()
{
return age >= BREEDING_AGE;
}
}

View File

@@ -0,0 +1,11 @@
#BlueJ class context
comment0.params=
comment0.target=Randomizer()
comment0.text=\n\ Constructor\ for\ objects\ of\ class\ Randomizer\n
comment1.params=
comment1.target=java.util.Random\ getRandom()
comment1.text=\n\ Provide\ a\ random\ generator.\n\ @return\ A\ random\ object.\n
comment2.params=
comment2.target=void\ reset()
comment2.text=\n\ Reset\ the\ randomization.\n\ This\ will\ have\ no\ effect\ if\ randomization\ is\ not\ through\n\ a\ shared\ Random\ generator.\n
numComments=3

View File

@@ -0,0 +1,52 @@
import java.util.Random;
/**
* Provide control over the randomization of the simulation. By using the shared, fixed-seed
* randomizer, repeated runs will perform exactly the same (which helps with testing). Set
* 'useShared' to false to get different random behaviour every time.
*
* @author David J. Barnes and Michael Kölling
* @version 2016.02.29
*/
public class Randomizer
{
// The default seed for control of randomization.
private static final int SEED = 1111;
// A shared Random object, if required.
private static final Random rand = new Random(SEED);
// Determine whether a shared random generator is to be provided.
private static final boolean useShared = true;
/**
* Constructor for objects of class Randomizer
*/
public Randomizer()
{
}
/**
* Provide a random generator.
* @return A random object.
*/
public static Random getRandom()
{
if(useShared) {
return rand;
}
else {
return new Random();
}
}
/**
* Reset the randomization.
* This will have no effect if randomization is not through
* a shared Random generator.
*/
public static void reset()
{
if(useShared) {
rand.setSeed(SEED);
}
}
}

View File

@@ -0,0 +1,29 @@
#BlueJ class context
comment0.params=
comment0.target=Simulator()
comment0.text=\n\ Construct\ a\ simulation\ field\ with\ default\ size.\n
comment1.params=depth\ width
comment1.target=Simulator(int,\ int)
comment1.text=\n\ Create\ a\ simulation\ field\ with\ the\ given\ size.\n\ @param\ depth\ Depth\ of\ the\ field.\ Must\ be\ greater\ than\ zero.\n\ @param\ width\ Width\ of\ the\ field.\ Must\ be\ greater\ than\ zero.\n
comment2.params=
comment2.target=void\ runLongSimulation()
comment2.text=\n\ Run\ the\ simulation\ from\ its\ current\ state\ for\ a\ reasonably\ long\ period,\n\ (4000\ steps).\n
comment3.params=numSteps
comment3.target=void\ simulate(int)
comment3.text=\n\ Run\ the\ simulation\ from\ its\ current\ state\ for\ the\ given\ number\ of\ steps.\n\ Stop\ before\ the\ given\ number\ of\ steps\ if\ it\ ceases\ to\ be\ viable.\n\ @param\ numSteps\ The\ number\ of\ steps\ to\ run\ for.\n
comment4.params=
comment4.target=void\ simulateOneStep()
comment4.text=\n\ Run\ the\ simulation\ from\ its\ current\ state\ for\ a\ single\ step.\n\ Iterate\ over\ the\ whole\ field\ updating\ the\ state\ of\ each\n\ fox\ and\ rabbit.\n
comment5.params=
comment5.target=void\ reset()
comment5.text=\n\ Reset\ the\ simulation\ to\ a\ starting\ position.\n
comment6.params=
comment6.target=void\ updateViews()
comment6.text=\n\ Update\ all\ existing\ views.\n
comment7.params=
comment7.target=void\ populate()
comment7.text=\n\ Randomly\ populate\ the\ field\ with\ foxes\ and\ rabbits.\n
comment8.params=millisec
comment8.target=void\ delay(int)
comment8.text=\n\ Pause\ for\ a\ given\ time.\n\ @param\ millisec\ \ The\ time\ to\ pause\ for,\ in\ milliseconds\n
numComments=9

View File

@@ -0,0 +1,186 @@
import java.util.Random;
import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
import java.awt.Color;
/**
* A simple predator-prey simulator, based on a rectangular field
* containing rabbits and foxes.
*
* @author David J. Barnes and Michael Kölling
* @version 2016.03.18
*/
public class Simulator
{
// Constants representing configuration information for the simulation.
// The default width for the grid.
private static final int DEFAULT_WIDTH = 120;
// The default depth of the grid.
private static final int DEFAULT_DEPTH = 80;
// The probability that a fox will be created in any given grid position.
private static final double FOX_CREATION_PROBABILITY = 0.02;
// The probability that a rabbit will be created in any given grid position.
private static final double RABBIT_CREATION_PROBABILITY = 0.08;
// List of animals in the field.
private List<Animal> animals;
// The current state of the field.
private Field field;
// The current step of the simulation.
private int step;
// A graphical view of the simulation.
private List<SimulatorView> views;
/**
* Construct a simulation field with default size.
*/
public Simulator()
{
this(DEFAULT_DEPTH, DEFAULT_WIDTH);
}
/**
* Create a simulation field with the given size.
* @param depth Depth of the field. Must be greater than zero.
* @param width Width of the field. Must be greater than zero.
*/
public Simulator(int depth, int width)
{
if(width <= 0 || depth <= 0) {
System.out.println("The dimensions must be greater than zero.");
System.out.println("Using default values.");
depth = DEFAULT_DEPTH;
width = DEFAULT_WIDTH;
}
animals = new ArrayList<>();
field = new Field(depth, width);
views = new ArrayList<>();
SimulatorView view = new GridView(depth, width);
view.setColor(Rabbit.class, Color.ORANGE);
view.setColor(Fox.class, Color.BLUE);
views.add(view);
view = new GraphView(500, 150, 500);
view.setColor(Rabbit.class, Color.BLACK);
view.setColor(Fox.class, Color.RED);
views.add(view);
// Setup a valid starting point.
reset();
}
/**
* Run the simulation from its current state for a reasonably long period,
* (4000 steps).
*/
public void runLongSimulation()
{
simulate(4000);
}
/**
* Run the simulation from its current state for the given number of steps.
* Stop before the given number of steps if it ceases to be viable.
* @param numSteps The number of steps to run for.
*/
public void simulate(int numSteps)
{
for(int step = 1; step <= numSteps && views.get(0).isViable(field); step++) {
simulateOneStep();
// delay(60); // uncomment this to run more slowly
}
}
/**
* Run the simulation from its current state for a single step.
* Iterate over the whole field updating the state of each
* fox and rabbit.
*/
public void simulateOneStep()
{
step++;
// Provide space for newborn animals.
List<Animal> newAnimals = new ArrayList<>();
// Let all rabbits act.
for(Iterator<Animal> it = animals.iterator(); it.hasNext(); ) {
Animal animal = it.next();
animal.act(newAnimals);
if(! animal.isAlive()) {
it.remove();
}
}
// Add the newly born foxes and rabbits to the main lists.
animals.addAll(newAnimals);
updateViews();
}
/**
* Reset the simulation to a starting position.
*/
public void reset()
{
step = 0;
animals.clear();
for (SimulatorView view : views) {
view.reset();
}
populate();
updateViews();
}
/**
* Update all existing views.
*/
private void updateViews()
{
for (SimulatorView view : views) {
view.showStatus(step, field);
}
}
/**
* Randomly populate the field with foxes and rabbits.
*/
private void populate()
{
Random rand = Randomizer.getRandom();
field.clear();
for(int row = 0; row < field.getDepth(); row++) {
for(int col = 0; col < field.getWidth(); col++) {
if(rand.nextDouble() <= FOX_CREATION_PROBABILITY) {
Location location = new Location(row, col);
Fox fox = new Fox(true, field, location);
animals.add(fox);
}
else if(rand.nextDouble() <= RABBIT_CREATION_PROBABILITY) {
Location location = new Location(row, col);
Rabbit rabbit = new Rabbit(true, field, location);
animals.add(rabbit);
}
// else leave the location empty.
}
}
}
/**
* Pause for a given time.
* @param millisec The time to pause for, in milliseconds
*/
private void delay(int millisec)
{
try {
Thread.sleep(millisec);
}
catch (InterruptedException ie) {
// wake up
}
}
}

View File

@@ -0,0 +1,14 @@
#BlueJ class context
comment0.params=animalClass\ color
comment0.target=void\ setColor(java.lang.Class,\ java.awt.Color)
comment0.text=\n\ Define\ a\ color\ to\ be\ used\ for\ a\ given\ class\ of\ animal.\n\ @param\ animalClass\ The\ animal's\ Class\ object.\n\ @param\ color\ The\ color\ to\ be\ used\ for\ the\ given\ class.\n
comment1.params=field
comment1.target=boolean\ isViable(Field)
comment1.text=\n\ Determine\ whether\ the\ simulation\ should\ continue\ to\ run.\n\ @return\ true\ If\ there\ is\ more\ than\ one\ species\ alive.\n
comment2.params=step\ field
comment2.target=void\ showStatus(int,\ Field)
comment2.text=\n\ Show\ the\ current\ status\ of\ the\ field.\n\ @param\ step\ Which\ iteration\ step\ it\ is.\n\ @param\ field\ The\ field\ whose\ status\ is\ to\ be\ displayed.\n
comment3.params=
comment3.target=void\ reset()
comment3.text=\n\ Prepare\ for\ a\ new\ run.\n
numComments=4

View File

@@ -0,0 +1,36 @@
import java.awt.Color;
/**
* A graphical view of the simulation grid. This interface defines all possible different
* views.
*
* @author Michael Kölling and David J. Barnes
* @version 2016.03.18
*/
public interface SimulatorView
{
/**
* Define a color to be used for a given class of animal.
* @param animalClass The animal's Class object.
* @param color The color to be used for the given class.
*/
void setColor(Class<?> animalClass, Color color);
/**
* Determine whether the simulation should continue to run.
* @return true If there is more than one species alive.
*/
boolean isViable(Field field);
/**
* Show the current status of the field.
* @param step Which iteration step it is.
* @param field The field whose status is to be displayed.
*/
void showStatus(int step, Field field);
/**
* Prepare for a new run.
*/
void reset();
}

View File

@@ -0,0 +1,376 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Tue Feb 14 18:40:57 GMT 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Animal (foxes-and-rabbits-graph)
</TITLE>
<META NAME="date" CONTENT="2012-02-14">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Animal (foxes-and-rabbits-graph)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="Counter.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?Animal.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Animal.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
Class Animal</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="./resources/inherit.gif" ALT="extended by "><B>Animal</B>
</PRE>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="Fox.html" title="class in &lt;Unnamed&gt;">Fox</A>, <A HREF="Rabbit.html" title="class in &lt;Unnamed&gt;">Rabbit</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public abstract class <B>Animal</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>
<P>
A class representing shared characteristics of animals.
<P>
<P>
<DL>
<DT><B>Version:</B></DT>
<DD>2011.07.31</DD>
<DT><B>Author:</B></DT>
<DD>David J. Barnes and Michael Kölling</DD>
</DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="Animal.html#Animal(Field, Location)">Animal</A></B>(<A HREF="Field.html" title="class in &lt;Unnamed&gt;">Field</A>&nbsp;field,
<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a new animal at location in field.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Animal.html#act(java.util.List)">act</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="Animal.html" title="class in &lt;Unnamed&gt;">Animal</A>&gt;&nbsp;newAnimals)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Make this animal act - that is: make it do
whatever it wants/needs to do.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="Field.html" title="class in &lt;Unnamed&gt;">Field</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="Animal.html#getField()">getField</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the animal's field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="Animal.html#getLocation()">getLocation</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the animal's location.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="Animal.html#isAlive()">isAlive</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check whether the animal is alive or not.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Animal.html#setDead()">setDead</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Indicate that the animal is no longer alive.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Animal.html#setLocation(Location)">setLocation</A></B>(<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;newLocation)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Place the animal at the new location in the given field.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="Animal(Field, Location)"><!-- --></A><H3>
Animal</H3>
<PRE>
public <B>Animal</B>(<A HREF="Field.html" title="class in &lt;Unnamed&gt;">Field</A>&nbsp;field,
<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</PRE>
<DL>
<DD>Create a new animal at location in field.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>field</CODE> - The field currently occupied.<DD><CODE>location</CODE> - The location within the field.</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="act(java.util.List)"><!-- --></A><H3>
act</H3>
<PRE>
public abstract void <B>act</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="Animal.html" title="class in &lt;Unnamed&gt;">Animal</A>&gt;&nbsp;newAnimals)</PRE>
<DL>
<DD>Make this animal act - that is: make it do
whatever it wants/needs to do.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>newAnimals</CODE> - A list to receive newly born animals.</DL>
</DD>
</DL>
<HR>
<A NAME="getField()"><!-- --></A><H3>
getField</H3>
<PRE>
protected <A HREF="Field.html" title="class in &lt;Unnamed&gt;">Field</A> <B>getField</B>()</PRE>
<DL>
<DD>Return the animal's field.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>The animal's field.</DL>
</DD>
</DL>
<HR>
<A NAME="getLocation()"><!-- --></A><H3>
getLocation</H3>
<PRE>
protected <A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A> <B>getLocation</B>()</PRE>
<DL>
<DD>Return the animal's location.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>The animal's location.</DL>
</DD>
</DL>
<HR>
<A NAME="isAlive()"><!-- --></A><H3>
isAlive</H3>
<PRE>
protected boolean <B>isAlive</B>()</PRE>
<DL>
<DD>Check whether the animal is alive or not.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>true if the animal is still alive.</DL>
</DD>
</DL>
<HR>
<A NAME="setDead()"><!-- --></A><H3>
setDead</H3>
<PRE>
protected void <B>setDead</B>()</PRE>
<DL>
<DD>Indicate that the animal is no longer alive.
It is removed from the field.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setLocation(Location)"><!-- --></A><H3>
setLocation</H3>
<PRE>
protected void <B>setLocation</B>(<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;newLocation)</PRE>
<DL>
<DD>Place the animal at the new location in the given field.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>newLocation</CODE> - The animal's new location.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="Counter.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?Animal.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Animal.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,324 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Tue Feb 14 18:40:57 GMT 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Counter (foxes-and-rabbits-graph)
</TITLE>
<META NAME="date" CONTENT="2012-02-14">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Counter (foxes-and-rabbits-graph)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="Animal.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="Field.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?Counter.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Counter.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
Class Counter</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="./resources/inherit.gif" ALT="extended by "><B>Counter</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Counter</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>
<P>
Provide a counter for a participant in the simulation.
This includes an identifying string and a count of how
many participants of this type currently exist within
the simulation.
<P>
<P>
<DL>
<DT><B>Version:</B></DT>
<DD>2011.07.31</DD>
<DT><B>Author:</B></DT>
<DD>Michael Kölling and David J. Barnes</DD>
</DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="Counter.html#Counter(java.lang.String)">Counter</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Provide a name for one of the simulation types.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Counter.html#getCount()">getCount</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="Counter.html#getName()">getName</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Counter.html#increment()">increment</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Increment the current count by one.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Counter.html#reset()">reset</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reset the current count to zero.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="Counter(java.lang.String)"><!-- --></A><H3>
Counter</H3>
<PRE>
public <B>Counter</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name)</PRE>
<DL>
<DD>Provide a name for one of the simulation types.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - A name, e.g. "Fox".</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="getCount()"><!-- --></A><H3>
getCount</H3>
<PRE>
public int <B>getCount</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>The current count for this type.</DL>
</DD>
</DL>
<HR>
<A NAME="getName()"><!-- --></A><H3>
getName</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getName</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>The short description of this type.</DL>
</DD>
</DL>
<HR>
<A NAME="increment()"><!-- --></A><H3>
increment</H3>
<PRE>
public void <B>increment</B>()</PRE>
<DL>
<DD>Increment the current count by one.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="reset()"><!-- --></A><H3>
reset</H3>
<PRE>
public void <B>reset</B>()</PRE>
<DL>
<DD>Reset the current count to zero.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="Animal.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="Field.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?Counter.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Counter.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,524 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Tue Feb 14 18:40:57 GMT 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Field (foxes-and-rabbits-graph)
</TITLE>
<META NAME="date" CONTENT="2012-02-14">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Field (foxes-and-rabbits-graph)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="Counter.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="FieldStats.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?Field.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Field.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
Class Field</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="./resources/inherit.gif" ALT="extended by "><B>Field</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Field</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>
<P>
Represent a rectangular grid of field positions.
Each position is able to store a single animal.
<P>
<P>
<DL>
<DT><B>Version:</B></DT>
<DD>2011.07.31</DD>
<DT><B>Author:</B></DT>
<DD>David J. Barnes and Michael Kölling</DD>
</DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="Field.html#Field(int, int)">Field</A></B>(int&nbsp;depth,
int&nbsp;width)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Represent a field of the given dimensions.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="Field.html#adjacentLocations(Location)">adjacentLocations</A></B>(<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return a shuffled list of locations adjacent to the given one.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Field.html#clear()">clear</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Empty the field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Field.html#clear(Location)">clear</A></B>(<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Clear the given location.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="Field.html#freeAdjacentLocation(Location)">freeAdjacentLocation</A></B>(<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Try to find a free location that is adjacent to the
given location.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Field.html#getDepth()">getDepth</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the depth of the field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="Field.html#getFreeAdjacentLocations(Location)">getFreeAdjacentLocations</A></B>(<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get a shuffled list of the free adjacent locations.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="Field.html#getObjectAt(int, int)">getObjectAt</A></B>(int&nbsp;row,
int&nbsp;col)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the animal at the given location, if any.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="Field.html#getObjectAt(Location)">getObjectAt</A></B>(<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the animal at the given location, if any.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Field.html#getWidth()">getWidth</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the width of the field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Field.html#place(java.lang.Object, int, int)">place</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;animal,
int&nbsp;row,
int&nbsp;col)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Place an animal at the given location.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Field.html#place(java.lang.Object, Location)">place</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;animal,
<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Place an animal at the given location.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="Field.html#randomAdjacentLocation(Location)">randomAdjacentLocation</A></B>(<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generate a random location that is adjacent to the
given location, or is the same location.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="Field(int, int)"><!-- --></A><H3>
Field</H3>
<PRE>
public <B>Field</B>(int&nbsp;depth,
int&nbsp;width)</PRE>
<DL>
<DD>Represent a field of the given dimensions.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>depth</CODE> - The depth of the field.<DD><CODE>width</CODE> - The width of the field.</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="adjacentLocations(Location)"><!-- --></A><H3>
adjacentLocations</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&gt; <B>adjacentLocations</B>(<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</PRE>
<DL>
<DD>Return a shuffled list of locations adjacent to the given one.
The list will not include the location itself.
All locations will lie within the grid.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>location</CODE> - The location from which to generate adjacencies.
<DT><B>Returns:</B><DD>A list of locations adjacent to that given.</DL>
</DD>
</DL>
<HR>
<A NAME="clear()"><!-- --></A><H3>
clear</H3>
<PRE>
public void <B>clear</B>()</PRE>
<DL>
<DD>Empty the field.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="clear(Location)"><!-- --></A><H3>
clear</H3>
<PRE>
public void <B>clear</B>(<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</PRE>
<DL>
<DD>Clear the given location.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>location</CODE> - The location to clear.</DL>
</DD>
</DL>
<HR>
<A NAME="freeAdjacentLocation(Location)"><!-- --></A><H3>
freeAdjacentLocation</H3>
<PRE>
public <A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A> <B>freeAdjacentLocation</B>(<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</PRE>
<DL>
<DD>Try to find a free location that is adjacent to the
given location. If there is none, return null.
The returned location will be within the valid bounds
of the field.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>location</CODE> - The location from which to generate an adjacency.
<DT><B>Returns:</B><DD>A valid location within the grid area.</DL>
</DD>
</DL>
<HR>
<A NAME="getDepth()"><!-- --></A><H3>
getDepth</H3>
<PRE>
public int <B>getDepth</B>()</PRE>
<DL>
<DD>Return the depth of the field.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>The depth of the field.</DL>
</DD>
</DL>
<HR>
<A NAME="getFreeAdjacentLocations(Location)"><!-- --></A><H3>
getFreeAdjacentLocations</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&gt; <B>getFreeAdjacentLocations</B>(<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</PRE>
<DL>
<DD>Get a shuffled list of the free adjacent locations.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>location</CODE> - Get locations adjacent to this.
<DT><B>Returns:</B><DD>A list of free adjacent locations.</DL>
</DD>
</DL>
<HR>
<A NAME="getObjectAt(int, int)"><!-- --></A><H3>
getObjectAt</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>getObjectAt</B>(int&nbsp;row,
int&nbsp;col)</PRE>
<DL>
<DD>Return the animal at the given location, if any.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>row</CODE> - The desired row.<DD><CODE>col</CODE> - The desired column.
<DT><B>Returns:</B><DD>The animal at the given location, or null if there is none.</DL>
</DD>
</DL>
<HR>
<A NAME="getObjectAt(Location)"><!-- --></A><H3>
getObjectAt</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>getObjectAt</B>(<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</PRE>
<DL>
<DD>Return the animal at the given location, if any.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>location</CODE> - Where in the field.
<DT><B>Returns:</B><DD>The animal at the given location, or null if there is none.</DL>
</DD>
</DL>
<HR>
<A NAME="getWidth()"><!-- --></A><H3>
getWidth</H3>
<PRE>
public int <B>getWidth</B>()</PRE>
<DL>
<DD>Return the width of the field.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>The width of the field.</DL>
</DD>
</DL>
<HR>
<A NAME="place(java.lang.Object, int, int)"><!-- --></A><H3>
place</H3>
<PRE>
public void <B>place</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;animal,
int&nbsp;row,
int&nbsp;col)</PRE>
<DL>
<DD>Place an animal at the given location.
If there is already an animal at the location it will
be lost.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>animal</CODE> - The animal to be placed.<DD><CODE>row</CODE> - Row coordinate of the location.<DD><CODE>col</CODE> - Column coordinate of the location.</DL>
</DD>
</DL>
<HR>
<A NAME="place(java.lang.Object, Location)"><!-- --></A><H3>
place</H3>
<PRE>
public void <B>place</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;animal,
<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</PRE>
<DL>
<DD>Place an animal at the given location.
If there is already an animal at the location it will
be lost.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>animal</CODE> - The animal to be placed.<DD><CODE>location</CODE> - Where to place the animal.</DL>
</DD>
</DL>
<HR>
<A NAME="randomAdjacentLocation(Location)"><!-- --></A><H3>
randomAdjacentLocation</H3>
<PRE>
public <A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A> <B>randomAdjacentLocation</B>(<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</PRE>
<DL>
<DD>Generate a random location that is adjacent to the
given location, or is the same location.
The returned location will be within the valid bounds
of the field.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>location</CODE> - The location from which to generate an adjacency.
<DT><B>Returns:</B><DD>A valid location within the grid area.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="Counter.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="FieldStats.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?Field.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Field.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,265 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.8.0_31) on Tue Sep 01 15:42:49 BST 2015 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
FieldStats
</TITLE>
<META NAME="date" CONTENT="2015-09-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="FieldStats";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
Class FieldStats</H2>
<PRE>
java.lang.Object
<IMG SRC="./resources/inherit.gif" ALT="extended by "><B>FieldStats</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>FieldStats</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
This class collects and provides some statistical data on the state
of a field. It is flexible: it will create and maintain a counter
for any class of object that is found within the field.
<P>
<P>
<DL>
<DT><B>Version:</B></DT>
<DD>2011.07.31</DD>
<DT><B>Author:</B></DT>
<DD>David J. Barnes and Michael Kölling</DD>
</DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="FieldStats.html#FieldStats()">FieldStats</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a FieldStats object.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="FieldStats.html#countFinished()">countFinished</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Indicate that an animal count has been completed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="FieldStats.html#getPopulationCount(Field, java.lang.Class)">getPopulationCount</A></B>(Field&nbsp;field,
java.lang.Class&nbsp;key)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the number of individuals in the population of a given class.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="FieldStats.html#getPopulationDetails(Field)">getPopulationDetails</A></B>(Field&nbsp;field)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get details of what is in the field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="FieldStats.html#incrementCount(java.lang.Class)">incrementCount</A></B>(java.lang.Class&nbsp;animalClass)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Increment the count for one class of animal.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="FieldStats.html#isViable(Field)">isViable</A></B>(Field&nbsp;field)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determine whether the simulation is still viable.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="FieldStats.html#reset()">reset</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Invalidate the current set of statistics; reset all
counts to zero.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="FieldStats()"><!-- --></A><H3>
FieldStats</H3>
<PRE>
public <B>FieldStats</B>()</PRE>
<DL>
<DD>Construct a FieldStats object.
<P>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="countFinished()"><!-- --></A><H3>
countFinished</H3>
<PRE>
public void <B>countFinished</B>()</PRE>
<DL>
<DD>Indicate that an animal count has been completed.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getPopulationCount(Field, java.lang.Class)"><!-- --></A><H3>
getPopulationCount</H3>
<PRE>
public int <B>getPopulationCount</B>(Field&nbsp;field,
java.lang.Class&nbsp;key)</PRE>
<DL>
<DD>Get the number of individuals in the population of a given class.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>An int with the number for this class.</DL>
</DD>
</DL>
<HR>
<A NAME="getPopulationDetails(Field)"><!-- --></A><H3>
getPopulationDetails</H3>
<PRE>
public java.lang.String <B>getPopulationDetails</B>(Field&nbsp;field)</PRE>
<DL>
<DD>Get details of what is in the field.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>A string describing what is in the field.</DL>
</DD>
</DL>
<HR>
<A NAME="incrementCount(java.lang.Class)"><!-- --></A><H3>
incrementCount</H3>
<PRE>
public void <B>incrementCount</B>(java.lang.Class&nbsp;animalClass)</PRE>
<DL>
<DD>Increment the count for one class of animal.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>animalClass</CODE> - The class of animal to increment.</DL>
</DD>
</DL>
<HR>
<A NAME="isViable(Field)"><!-- --></A><H3>
isViable</H3>
<PRE>
public boolean <B>isViable</B>(Field&nbsp;field)</PRE>
<DL>
<DD>Determine whether the simulation is still viable.
I.e., should it continue to run.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>true If there is more than one species alive.</DL>
</DD>
</DL>
<HR>
<A NAME="reset()"><!-- --></A><H3>
reset</H3>
<PRE>
public void <B>reset</B>()</PRE>
<DL>
<DD>Invalidate the current set of statistics; reset all
counts to zero.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,282 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Tue Feb 14 18:40:57 GMT 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Fox (foxes-and-rabbits-graph)
</TITLE>
<META NAME="date" CONTENT="2012-02-14">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Fox (foxes-and-rabbits-graph)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="FieldStats.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="GraphView.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?Fox.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Fox.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
Class Fox</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="./resources/inherit.gif" ALT="extended by "><A HREF="Animal.html" title="class in &lt;Unnamed&gt;">Animal</A>
<IMG SRC="./resources/inherit.gif" ALT="extended by "><B>Fox</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Fox</B><DT>extends <A HREF="Animal.html" title="class in &lt;Unnamed&gt;">Animal</A></DL>
</PRE>
<P>
A simple model of a fox.
Foxes age, move, eat rabbits, and die.
<P>
<P>
<DL>
<DT><B>Version:</B></DT>
<DD>2011.07.31</DD>
<DT><B>Author:</B></DT>
<DD>David J. Barnes and Michael Kölling</DD>
</DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="Fox.html#Fox(boolean, Field, Location)">Fox</A></B>(boolean&nbsp;randomAge,
<A HREF="Field.html" title="class in &lt;Unnamed&gt;">Field</A>&nbsp;field,
<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a fox.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Fox.html#act(java.util.List)">act</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="Animal.html" title="class in &lt;Unnamed&gt;">Animal</A>&gt;&nbsp;newFoxes)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is what the fox does most of the time: it hunts for
rabbits.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_Animal"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class <A HREF="Animal.html" title="class in &lt;Unnamed&gt;">Animal</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="Animal.html#getField()">getField</A>, <A HREF="Animal.html#getLocation()">getLocation</A>, <A HREF="Animal.html#isAlive()">isAlive</A>, <A HREF="Animal.html#setDead()">setDead</A>, <A HREF="Animal.html#setLocation(Location)">setLocation</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="Fox(boolean, Field, Location)"><!-- --></A><H3>
Fox</H3>
<PRE>
public <B>Fox</B>(boolean&nbsp;randomAge,
<A HREF="Field.html" title="class in &lt;Unnamed&gt;">Field</A>&nbsp;field,
<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</PRE>
<DL>
<DD>Create a fox. A fox can be created as a new born (age zero
and not hungry) or with a random age and food level.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>randomAge</CODE> - If true, the fox will have random age and hunger level.<DD><CODE>field</CODE> - The field currently occupied.<DD><CODE>location</CODE> - The location within the field.</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="act(java.util.List)"><!-- --></A><H3>
act</H3>
<PRE>
public void <B>act</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="Animal.html" title="class in &lt;Unnamed&gt;">Animal</A>&gt;&nbsp;newFoxes)</PRE>
<DL>
<DD>This is what the fox does most of the time: it hunts for
rabbits. In the process, it might breed, die of hunger,
or die of old age.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="Animal.html#act(java.util.List)">act</A></CODE> in class <CODE><A HREF="Animal.html" title="class in &lt;Unnamed&gt;">Animal</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>field</CODE> - The field currently occupied.<DD><CODE>newFoxes</CODE> - A list to return newly born foxes.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="FieldStats.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="GraphView.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?Fox.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Fox.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,369 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Tue Feb 14 18:40:58 GMT 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
GraphView (foxes-and-rabbits-graph)
</TITLE>
<META NAME="date" CONTENT="2012-02-14">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="GraphView (foxes-and-rabbits-graph)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="Fox.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="GraphView.GraphPanel.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?GraphView.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="GraphView.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
Class GraphView</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="./resources/inherit.gif" ALT="extended by "><B>GraphView</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="SimulatorView.html" title="interface in &lt;Unnamed&gt;">SimulatorView</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>GraphView</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A><DT>implements <A HREF="SimulatorView.html" title="interface in &lt;Unnamed&gt;">SimulatorView</A></DL>
</PRE>
<P>
The GraphView provides a view of two populations of actors in the field as a line graph
over time. In its current version, it can only plot exactly two different classes of
animals. If further animals are introduced, they will not currently be displayed.
<P>
<P>
<DL>
<DT><B>Version:</B></DT>
<DD>2011.07.31</DD>
<DT><B>Author:</B></DT>
<DD>Michael Kölling and David J. Barnes</DD>
</DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>(package private) &nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="GraphView.GraphPanel.html" title="class in &lt;Unnamed&gt;">GraphView.GraphPanel</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nested class: a component to display the graph.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="GraphView.html#GraphView(int, int, int)">GraphView</A></B>(int&nbsp;width,
int&nbsp;height,
int&nbsp;startMax)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="GraphView.html#isViable(Field)">isViable</A></B>(<A HREF="Field.html" title="class in &lt;Unnamed&gt;">Field</A>&nbsp;field)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determine whether the simulation should continue to run.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="GraphView.html#reset()">reset</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prepare for a new run.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="GraphView.html#setColor(java.lang.Class, java.awt.Color)">setColor</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;animalClass,
<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/Color.html?is-external=true" title="class or interface in java.awt">Color</A>&nbsp;color)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Define a color to be used for a given class of animal.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="GraphView.html#showStatus(int, Field)">showStatus</A></B>(int&nbsp;step,
<A HREF="Field.html" title="class in &lt;Unnamed&gt;">Field</A>&nbsp;field)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Show the current status of the field.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="GraphView(int, int, int)"><!-- --></A><H3>
GraphView</H3>
<PRE>
public <B>GraphView</B>(int&nbsp;width,
int&nbsp;height,
int&nbsp;startMax)</PRE>
<DL>
<DD>Constructor.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>width</CODE> - The width of the plotter window (in pixles).<DD><CODE>height</CODE> - The height of the plotter window (in pixles).<DD><CODE>startMax</CODE> - The initial maximum value for the y axis.<DD><CODE>world</CODE> - The world object.<DD><CODE>class1</CODE> - The first class to be plotted.<DD><CODE>width</CODE> - The second class to be plotted.</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="isViable(Field)"><!-- --></A><H3>
isViable</H3>
<PRE>
public boolean <B>isViable</B>(<A HREF="Field.html" title="class in &lt;Unnamed&gt;">Field</A>&nbsp;field)</PRE>
<DL>
<DD>Determine whether the simulation should continue to run.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="SimulatorView.html#isViable(Field)">isViable</A></CODE> in interface <CODE><A HREF="SimulatorView.html" title="interface in &lt;Unnamed&gt;">SimulatorView</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>true If there is more than one species alive.</DL>
</DD>
</DL>
<HR>
<A NAME="reset()"><!-- --></A><H3>
reset</H3>
<PRE>
public void <B>reset</B>()</PRE>
<DL>
<DD>Prepare for a new run.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="SimulatorView.html#reset()">reset</A></CODE> in interface <CODE><A HREF="SimulatorView.html" title="interface in &lt;Unnamed&gt;">SimulatorView</A></CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setColor(java.lang.Class, java.awt.Color)"><!-- --></A><H3>
setColor</H3>
<PRE>
public void <B>setColor</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;animalClass,
<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/Color.html?is-external=true" title="class or interface in java.awt">Color</A>&nbsp;color)</PRE>
<DL>
<DD>Define a color to be used for a given class of animal.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="SimulatorView.html#setColor(java.lang.Class, java.awt.Color)">setColor</A></CODE> in interface <CODE><A HREF="SimulatorView.html" title="interface in &lt;Unnamed&gt;">SimulatorView</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>animalClass</CODE> - The animal's Class object.<DD><CODE>color</CODE> - The color to be used for the given class.</DL>
</DD>
</DL>
<HR>
<A NAME="showStatus(int, Field)"><!-- --></A><H3>
showStatus</H3>
<PRE>
public void <B>showStatus</B>(int&nbsp;step,
<A HREF="Field.html" title="class in &lt;Unnamed&gt;">Field</A>&nbsp;field)</PRE>
<DL>
<DD>Show the current status of the field. The status is shown by displaying a line graph for
two classes in the field. This view currently does not work for more (or fewer) than exactly
two classes. If the field contains more than two different types of animal, only two of the classes
will be plotted.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="SimulatorView.html#showStatus(int, Field)">showStatus</A></CODE> in interface <CODE><A HREF="SimulatorView.html" title="interface in &lt;Unnamed&gt;">SimulatorView</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>step</CODE> - Which iteration step it is.<DD><CODE>field</CODE> - The field whose status is to be displayed.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="Fox.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="GraphView.GraphPanel.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?GraphView.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="GraphView.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,358 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Tue Feb 14 18:40:58 GMT 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Location (foxes-and-rabbits-graph)
</TITLE>
<META NAME="date" CONTENT="2012-02-14">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Location (foxes-and-rabbits-graph)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="GridView.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="Rabbit.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?Location.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Location.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
Class Location</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="./resources/inherit.gif" ALT="extended by "><B>Location</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Location</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>
<P>
Represent a location in a rectangular grid.
<P>
<P>
<DL>
<DT><B>Version:</B></DT>
<DD>2011.07.31</DD>
<DT><B>Author:</B></DT>
<DD>David J. Barnes and Michael Kölling</DD>
</DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="Location.html#Location(int, int)">Location</A></B>(int&nbsp;row,
int&nbsp;col)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Represent a row and column.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="Location.html#equals(java.lang.Object)">equals</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;obj)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Implement content equality.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Location.html#getCol()">getCol</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Location.html#getRow()">getRow</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="Location.html#hashCode()">hashCode</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use the top 16 bits for the row value and the bottom for
the column.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="Location.html#toString()">toString</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return a string of the form row,column</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="Location(int, int)"><!-- --></A><H3>
Location</H3>
<PRE>
public <B>Location</B>(int&nbsp;row,
int&nbsp;col)</PRE>
<DL>
<DD>Represent a row and column.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>row</CODE> - The row.<DD><CODE>col</CODE> - The column.</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="equals(java.lang.Object)"><!-- --></A><H3>
equals</H3>
<PRE>
public boolean <B>equals</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;obj)</PRE>
<DL>
<DD>Implement content equality.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A></CODE> in class <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getCol()"><!-- --></A><H3>
getCol</H3>
<PRE>
public int <B>getCol</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>The column.</DL>
</DD>
</DL>
<HR>
<A NAME="getRow()"><!-- --></A><H3>
getRow</H3>
<PRE>
public int <B>getRow</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>The row.</DL>
</DD>
</DL>
<HR>
<A NAME="hashCode()"><!-- --></A><H3>
hashCode</H3>
<PRE>
public int <B>hashCode</B>()</PRE>
<DL>
<DD>Use the top 16 bits for the row value and the bottom for
the column. Except for very big grids, this should give a
unique hash code for each (row, col) pair.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A></CODE> in class <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>A hashcode for the location.</DL>
</DD>
</DL>
<HR>
<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>toString</B>()</PRE>
<DL>
<DD>Return a string of the form row,column
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A></CODE> in class <CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>A string representation of the location.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="GridView.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="Rabbit.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?Location.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Location.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,281 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Tue Feb 14 18:40:58 GMT 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Rabbit (foxes-and-rabbits-graph)
</TITLE>
<META NAME="date" CONTENT="2012-02-14">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Rabbit (foxes-and-rabbits-graph)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="Location.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="Randomizer.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?Rabbit.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Rabbit.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
Class Rabbit</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="./resources/inherit.gif" ALT="extended by "><A HREF="Animal.html" title="class in &lt;Unnamed&gt;">Animal</A>
<IMG SRC="./resources/inherit.gif" ALT="extended by "><B>Rabbit</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Rabbit</B><DT>extends <A HREF="Animal.html" title="class in &lt;Unnamed&gt;">Animal</A></DL>
</PRE>
<P>
A simple model of a rabbit.
Rabbits age, move, breed, and die.
<P>
<P>
<DL>
<DT><B>Version:</B></DT>
<DD>2011.07.31</DD>
<DT><B>Author:</B></DT>
<DD>David J. Barnes and Michael Kölling</DD>
</DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="Rabbit.html#Rabbit(boolean, Field, Location)">Rabbit</A></B>(boolean&nbsp;randomAge,
<A HREF="Field.html" title="class in &lt;Unnamed&gt;">Field</A>&nbsp;field,
<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a new rabbit.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Rabbit.html#act(java.util.List)">act</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="Animal.html" title="class in &lt;Unnamed&gt;">Animal</A>&gt;&nbsp;newRabbits)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is what the rabbit does most of the time - it runs
around.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_Animal"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class <A HREF="Animal.html" title="class in &lt;Unnamed&gt;">Animal</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="Animal.html#getField()">getField</A>, <A HREF="Animal.html#getLocation()">getLocation</A>, <A HREF="Animal.html#isAlive()">isAlive</A>, <A HREF="Animal.html#setDead()">setDead</A>, <A HREF="Animal.html#setLocation(Location)">setLocation</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="Rabbit(boolean, Field, Location)"><!-- --></A><H3>
Rabbit</H3>
<PRE>
public <B>Rabbit</B>(boolean&nbsp;randomAge,
<A HREF="Field.html" title="class in &lt;Unnamed&gt;">Field</A>&nbsp;field,
<A HREF="Location.html" title="class in &lt;Unnamed&gt;">Location</A>&nbsp;location)</PRE>
<DL>
<DD>Create a new rabbit. A rabbit may be created with age
zero (a new born) or with a random age.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>randomAge</CODE> - If true, the rabbit will have a random age.<DD><CODE>field</CODE> - The field currently occupied.<DD><CODE>location</CODE> - The location within the field.</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="act(java.util.List)"><!-- --></A><H3>
act</H3>
<PRE>
public void <B>act</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="Animal.html" title="class in &lt;Unnamed&gt;">Animal</A>&gt;&nbsp;newRabbits)</PRE>
<DL>
<DD>This is what the rabbit does most of the time - it runs
around. Sometimes it will breed or die of old age.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="Animal.html#act(java.util.List)">act</A></CODE> in class <CODE><A HREF="Animal.html" title="class in &lt;Unnamed&gt;">Animal</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>newRabbits</CODE> - A list to return newly born rabbits.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="Location.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="Randomizer.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?Rabbit.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Rabbit.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,282 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Tue Feb 14 18:40:58 GMT 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Randomizer (foxes-and-rabbits-graph)
</TITLE>
<META NAME="date" CONTENT="2012-02-14">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Randomizer (foxes-and-rabbits-graph)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="Rabbit.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="Simulator.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?Randomizer.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Randomizer.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
Class Randomizer</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="./resources/inherit.gif" ALT="extended by "><B>Randomizer</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Randomizer</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>
<P>
Provide control over the randomization of the simulation.
<P>
<P>
<DL>
<DT><B>Version:</B></DT>
<DD>2011.07.31</DD>
<DT><B>Author:</B></DT>
<DD>David J. Barnes and Michael Kölling</DD>
</DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="Randomizer.html#Randomizer()">Randomizer</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor for objects of class Randomizer</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Random.html?is-external=true" title="class or interface in java.util">Random</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="Randomizer.html#getRandom()">getRandom</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Provide a random generator.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Randomizer.html#reset()">reset</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reset the randomization.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="Randomizer()"><!-- --></A><H3>
Randomizer</H3>
<PRE>
public <B>Randomizer</B>()</PRE>
<DL>
<DD>Constructor for objects of class Randomizer
<P>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="getRandom()"><!-- --></A><H3>
getRandom</H3>
<PRE>
public static <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Random.html?is-external=true" title="class or interface in java.util">Random</A> <B>getRandom</B>()</PRE>
<DL>
<DD>Provide a random generator.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>A random object.</DL>
</DD>
</DL>
<HR>
<A NAME="reset()"><!-- --></A><H3>
reset</H3>
<PRE>
public static void <B>reset</B>()</PRE>
<DL>
<DD>Reset the randomization.
This will have no effect if randomization is not through
a shared Random generator.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="Rabbit.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="Simulator.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?Randomizer.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Randomizer.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,347 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Tue Feb 14 18:40:58 GMT 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Simulator (foxes-and-rabbits-graph)
</TITLE>
<META NAME="date" CONTENT="2012-02-14">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Simulator (foxes-and-rabbits-graph)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="Randomizer.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="SimulatorView.html" title="interface in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?Simulator.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Simulator.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
Class Simulator</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="./resources/inherit.gif" ALT="extended by "><B>Simulator</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Simulator</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>
<P>
A simple predator-prey simulator, based on a rectangular field
containing rabbits and foxes.
<P>
<P>
<DL>
<DT><B>Version:</B></DT>
<DD>2011.07.31</DD>
<DT><B>Author:</B></DT>
<DD>David J. Barnes and Michael Kölling</DD>
</DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="Simulator.html#Simulator()">Simulator</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a simulation field with default size.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="Simulator.html#Simulator(int, int)">Simulator</A></B>(int&nbsp;depth,
int&nbsp;width)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a simulation field with the given size.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Simulator.html#reset()">reset</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reset the simulation to a starting position.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Simulator.html#runLongSimulation()">runLongSimulation</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Run the simulation from its current state for a reasonably long period,
(4000 steps).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Simulator.html#simulate(int)">simulate</A></B>(int&nbsp;numSteps)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Run the simulation from its current state for the given number of steps.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Simulator.html#simulateOneStep()">simulateOneStep</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Run the simulation from its current state for a single step.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="Simulator()"><!-- --></A><H3>
Simulator</H3>
<PRE>
public <B>Simulator</B>()</PRE>
<DL>
<DD>Construct a simulation field with default size.
<P>
</DL>
<HR>
<A NAME="Simulator(int, int)"><!-- --></A><H3>
Simulator</H3>
<PRE>
public <B>Simulator</B>(int&nbsp;depth,
int&nbsp;width)</PRE>
<DL>
<DD>Create a simulation field with the given size.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>depth</CODE> - Depth of the field. Must be greater than zero.<DD><CODE>width</CODE> - Width of the field. Must be greater than zero.</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="reset()"><!-- --></A><H3>
reset</H3>
<PRE>
public void <B>reset</B>()</PRE>
<DL>
<DD>Reset the simulation to a starting position.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="runLongSimulation()"><!-- --></A><H3>
runLongSimulation</H3>
<PRE>
public void <B>runLongSimulation</B>()</PRE>
<DL>
<DD>Run the simulation from its current state for a reasonably long period,
(4000 steps).
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="simulate(int)"><!-- --></A><H3>
simulate</H3>
<PRE>
public void <B>simulate</B>(int&nbsp;numSteps)</PRE>
<DL>
<DD>Run the simulation from its current state for the given number of steps.
Stop before the given number of steps if it ceases to be viable.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>numSteps</CODE> - The number of steps to run for.</DL>
</DD>
</DL>
<HR>
<A NAME="simulateOneStep()"><!-- --></A><H3>
simulateOneStep</H3>
<PRE>
public void <B>simulateOneStep</B>()</PRE>
<DL>
<DD>Run the simulation from its current state for a single step.
Iterate over the whole field updating the state of each
fox and rabbit.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="Randomizer.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="SimulatorView.html" title="interface in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?Simulator.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Simulator.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,282 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Tue Feb 14 18:40:58 GMT 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
SimulatorView (foxes-and-rabbits-graph)
</TITLE>
<META NAME="date" CONTENT="2012-02-14">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SimulatorView (foxes-and-rabbits-graph)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="Simulator.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?SimulatorView.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="SimulatorView.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
Interface SimulatorView</H2>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="GraphView.html" title="class in &lt;Unnamed&gt;">GraphView</A>, <A HREF="GridView.html" title="class in &lt;Unnamed&gt;">GridView</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>SimulatorView</B></DL>
</PRE>
<P>
A graphical view of the simulation grid. This interface defines all possible different
views.
<P>
<P>
<DL>
<DT><B>Version:</B></DT>
<DD>2011.07.31</DD>
<DT><B>Author:</B></DT>
<DD>Michael Kölling and David J. Barnes</DD>
</DL>
<HR>
<P>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="SimulatorView.html#isViable(Field)">isViable</A></B>(<A HREF="Field.html" title="class in &lt;Unnamed&gt;">Field</A>&nbsp;field)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determine whether the simulation should continue to run.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="SimulatorView.html#reset()">reset</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prepare for a new run.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="SimulatorView.html#setColor(java.lang.Class, java.awt.Color)">setColor</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;animalClass,
<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/Color.html?is-external=true" title="class or interface in java.awt">Color</A>&nbsp;color)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Define a color to be used for a given class of animal.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="SimulatorView.html#showStatus(int, Field)">showStatus</A></B>(int&nbsp;step,
<A HREF="Field.html" title="class in &lt;Unnamed&gt;">Field</A>&nbsp;field)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Show the current status of the field.</TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="isViable(Field)"><!-- --></A><H3>
isViable</H3>
<PRE>
boolean <B>isViable</B>(<A HREF="Field.html" title="class in &lt;Unnamed&gt;">Field</A>&nbsp;field)</PRE>
<DL>
<DD>Determine whether the simulation should continue to run.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>true If there is more than one species alive.</DL>
</DD>
</DL>
<HR>
<A NAME="reset()"><!-- --></A><H3>
reset</H3>
<PRE>
void <B>reset</B>()</PRE>
<DL>
<DD>Prepare for a new run.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setColor(java.lang.Class, java.awt.Color)"><!-- --></A><H3>
setColor</H3>
<PRE>
void <B>setColor</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;animalClass,
<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/Color.html?is-external=true" title="class or interface in java.awt">Color</A>&nbsp;color)</PRE>
<DL>
<DD>Define a color to be used for a given class of animal.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>animalClass</CODE> - The animal's Class object.<DD><CODE>color</CODE> - The color to be used for the given class.</DL>
</DD>
</DL>
<HR>
<A NAME="showStatus(int, Field)"><!-- --></A><H3>
showStatus</H3>
<PRE>
void <B>showStatus</B>(int&nbsp;step,
<A HREF="Field.html" title="class in &lt;Unnamed&gt;">Field</A>&nbsp;field)</PRE>
<DL>
<DD>Show the current status of the field.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>step</CODE> - Which iteration step it is.<DD><CODE>field</CODE> - The field whose status is to be displayed.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="Simulator.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?SimulatorView.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="SimulatorView.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,32 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.8.0_31) on Tue Sep 01 15:42:49 BST 2015 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
All Classes
</TITLE>
<META NAME="date" CONTENT="2015-09-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" CLASS="FrameHeadingFont">
<B>All Classes</B></FONT>
<BR>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="FieldStats.html" title="class in &lt;Unnamed&gt;" target="classFrame">FieldStats</A>
<BR>
</FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>

View File

@@ -0,0 +1,32 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.8.0_31) on Tue Sep 01 15:42:49 BST 2015 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
All Classes
</TITLE>
<META NAME="date" CONTENT="2015-09-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" CLASS="FrameHeadingFont">
<B>All Classes</B></FONT>
<BR>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="FieldStats.html" title="class in &lt;Unnamed&gt;">FieldStats</A>
<BR>
</FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>

View File

@@ -0,0 +1,45 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.8.0_31) on Tue Sep 01 15:42:49 BST 2015 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Constant Field Values
</TITLE>
<META NAME="date" CONTENT="2015-09-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Constant Field Values";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<HR>
<CENTER>
<H1>
Constant Field Values</H1>
</CENTER>
<HR SIZE="4" NOSHADE>
<B>Contents</B><UL>
</UL>
<HR>
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,204 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Tue Feb 14 18:40:58 GMT 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
API Help (foxes-and-rabbits-graph)
</TITLE>
<META NAME="date" CONTENT="2012-02-14">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="API Help (foxes-and-rabbits-graph)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H1>
How This API Document Is Organized</H1>
</CENTER>
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.<H3>
Package</H3>
<BLOCKQUOTE>
<P>
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:<UL>
<LI>Interfaces (italic)<LI>Classes<LI>Enums<LI>Exceptions<LI>Errors<LI>Annotation Types</UL>
</BLOCKQUOTE>
<H3>
Class/Interface</H3>
<BLOCKQUOTE>
<P>
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:<UL>
<LI>Class inheritance diagram<LI>Direct Subclasses<LI>All Known Subinterfaces<LI>All Known Implementing Classes<LI>Class/interface declaration<LI>Class/interface description
<P>
<LI>Nested Class Summary<LI>Field Summary<LI>Constructor Summary<LI>Method Summary
<P>
<LI>Field Detail<LI>Constructor Detail<LI>Method Detail</UL>
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</BLOCKQUOTE>
</BLOCKQUOTE>
<H3>
Annotation Type</H3>
<BLOCKQUOTE>
<P>
Each annotation type has its own separate page with the following sections:<UL>
<LI>Annotation Type declaration<LI>Annotation Type description<LI>Required Element Summary<LI>Optional Element Summary<LI>Element Detail</UL>
</BLOCKQUOTE>
</BLOCKQUOTE>
<H3>
Enum</H3>
<BLOCKQUOTE>
<P>
Each enum has its own separate page with the following sections:<UL>
<LI>Enum declaration<LI>Enum description<LI>Enum Constant Summary<LI>Enum Constant Detail</UL>
</BLOCKQUOTE>
<H3>
Tree (Class Hierarchy)</H3>
<BLOCKQUOTE>
There is a <A HREF="overview-tree.html">Class Hierarchy</A> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.<UL>
<LI>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.<LI>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</UL>
</BLOCKQUOTE>
<H3>
Index</H3>
<BLOCKQUOTE>
The <A HREF="index-all.html">Index</A> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</BLOCKQUOTE>
<H3>
Prev/Next</H3>
These links take you to the next or previous class, interface, package, or related page.<H3>
Frames/No Frames</H3>
These links show and hide the HTML frames. All pages are available with or without frames.
<P>
<H3>
Serialized Form</H3>
Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
<P>
<H3>
Constant Field Values</H3>
The <a href="constant-values.html">Constant Field Values</a> page lists the static final fields and their values.
<P>
<FONT SIZE="-1">
<EM>
This help file applies to API documentation generated using the standard doclet.</EM>
</FONT>
<BR>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,435 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Tue Feb 14 18:40:58 GMT 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Index (foxes-and-rabbits-graph)
</TITLE>
<META NAME="date" CONTENT="2012-02-14">
<LINK REL ="stylesheet" TYPE="text/css" HREF="./stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Index (foxes-and-rabbits-graph)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="./index.html?index-all.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="index-all.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="./allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="./allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<A HREF="#_A_">A</A> <A HREF="#_C_">C</A> <A HREF="#_E_">E</A> <A HREF="#_F_">F</A> <A HREF="#_G_">G</A> <A HREF="#_H_">H</A> <A HREF="#_I_">I</A> <A HREF="#_L_">L</A> <A HREF="#_N_">N</A> <A HREF="#_P_">P</A> <A HREF="#_R_">R</A> <A HREF="#_S_">S</A> <A HREF="#_T_">T</A> <A HREF="#_U_">U</A> <HR>
<A NAME="_A_"><!-- --></A><H2>
<B>A</B></H2>
<DL>
<DT><A HREF="./Animal.html#act(java.util.List)"><B>act(List&lt;Animal&gt;)</B></A> -
Method in class <A HREF="./Animal.html" title="class in &lt;Unnamed&gt;">Animal</A>
<DD>Make this animal act - that is: make it do
whatever it wants/needs to do.
<DT><A HREF="./Fox.html#act(java.util.List)"><B>act(List&lt;Animal&gt;)</B></A> -
Method in class <A HREF="./Fox.html" title="class in &lt;Unnamed&gt;">Fox</A>
<DD>This is what the fox does most of the time: it hunts for
rabbits.
<DT><A HREF="./Rabbit.html#act(java.util.List)"><B>act(List&lt;Animal&gt;)</B></A> -
Method in class <A HREF="./Rabbit.html" title="class in &lt;Unnamed&gt;">Rabbit</A>
<DD>This is what the rabbit does most of the time - it runs
around.
<DT><A HREF="./Field.html#adjacentLocations(Location)"><B>adjacentLocations(Location)</B></A> -
Method in class <A HREF="./Field.html" title="class in &lt;Unnamed&gt;">Field</A>
<DD>Return a shuffled list of locations adjacent to the given one.
<DT><A HREF="./Animal.html" title="class in &lt;Unnamed&gt;"><B>Animal</B></A> - Class in <A HREF="./package-summary.html">&lt;Unnamed&gt;</A><DD>A class representing shared characteristics of animals.<DT><A HREF="./Animal.html#Animal(Field, Location)"><B>Animal(Field, Location)</B></A> -
Constructor for class <A HREF="./Animal.html" title="class in &lt;Unnamed&gt;">Animal</A>
<DD>Create a new animal at location in field.
</DL>
<HR>
<A NAME="_C_"><!-- --></A><H2>
<B>C</B></H2>
<DL>
<DT><A HREF="./Field.html#clear()"><B>clear()</B></A> -
Method in class <A HREF="./Field.html" title="class in &lt;Unnamed&gt;">Field</A>
<DD>Empty the field.
<DT><A HREF="./Field.html#clear(Location)"><B>clear(Location)</B></A> -
Method in class <A HREF="./Field.html" title="class in &lt;Unnamed&gt;">Field</A>
<DD>Clear the given location.
<DT><A HREF="./GraphView.GraphPanel.html#clearImage()"><B>clearImage()</B></A> -
Method in class <A HREF="./GraphView.GraphPanel.html" title="class in &lt;Unnamed&gt;">GraphView.GraphPanel</A>
<DD>Clear the image on this panel.
<DT><A HREF="./Counter.html" title="class in &lt;Unnamed&gt;"><B>Counter</B></A> - Class in <A HREF="./package-summary.html">&lt;Unnamed&gt;</A><DD>Provide a counter for a participant in the simulation.<DT><A HREF="./Counter.html#Counter(java.lang.String)"><B>Counter(String)</B></A> -
Constructor for class <A HREF="./Counter.html" title="class in &lt;Unnamed&gt;">Counter</A>
<DD>Provide a name for one of the simulation types.
<DT><A HREF="./FieldStats.html#countFinished()"><B>countFinished()</B></A> -
Method in class <A HREF="./FieldStats.html" title="class in &lt;Unnamed&gt;">FieldStats</A>
<DD>Indicate that an animal count has been completed.
</DL>
<HR>
<A NAME="_E_"><!-- --></A><H2>
<B>E</B></H2>
<DL>
<DT><A HREF="./Location.html#equals(java.lang.Object)"><B>equals(Object)</B></A> -
Method in class <A HREF="./Location.html" title="class in &lt;Unnamed&gt;">Location</A>
<DD>Implement content equality.
</DL>
<HR>
<A NAME="_F_"><!-- --></A><H2>
<B>F</B></H2>
<DL>
<DT><A HREF="./Field.html" title="class in &lt;Unnamed&gt;"><B>Field</B></A> - Class in <A HREF="./package-summary.html">&lt;Unnamed&gt;</A><DD>Represent a rectangular grid of field positions.<DT><A HREF="./Field.html#Field(int, int)"><B>Field(int, int)</B></A> -
Constructor for class <A HREF="./Field.html" title="class in &lt;Unnamed&gt;">Field</A>
<DD>Represent a field of the given dimensions.
<DT><A HREF="./FieldStats.html" title="class in &lt;Unnamed&gt;"><B>FieldStats</B></A> - Class in <A HREF="./package-summary.html">&lt;Unnamed&gt;</A><DD>This class collects and provides some statistical data on the state
of a field.<DT><A HREF="./FieldStats.html#FieldStats()"><B>FieldStats()</B></A> -
Constructor for class <A HREF="./FieldStats.html" title="class in &lt;Unnamed&gt;">FieldStats</A>
<DD>Construct a FieldStats object.
<DT><A HREF="./Fox.html" title="class in &lt;Unnamed&gt;"><B>Fox</B></A> - Class in <A HREF="./package-summary.html">&lt;Unnamed&gt;</A><DD>A simple model of a fox.<DT><A HREF="./Fox.html#Fox(boolean, Field, Location)"><B>Fox(boolean, Field, Location)</B></A> -
Constructor for class <A HREF="./Fox.html" title="class in &lt;Unnamed&gt;">Fox</A>
<DD>Create a fox.
<DT><A HREF="./Field.html#freeAdjacentLocation(Location)"><B>freeAdjacentLocation(Location)</B></A> -
Method in class <A HREF="./Field.html" title="class in &lt;Unnamed&gt;">Field</A>
<DD>Try to find a free location that is adjacent to the
given location.
</DL>
<HR>
<A NAME="_G_"><!-- --></A><H2>
<B>G</B></H2>
<DL>
<DT><A HREF="./Location.html#getCol()"><B>getCol()</B></A> -
Method in class <A HREF="./Location.html" title="class in &lt;Unnamed&gt;">Location</A>
<DD>&nbsp;
<DT><A HREF="./Counter.html#getCount()"><B>getCount()</B></A> -
Method in class <A HREF="./Counter.html" title="class in &lt;Unnamed&gt;">Counter</A>
<DD>&nbsp;
<DT><A HREF="./Field.html#getDepth()"><B>getDepth()</B></A> -
Method in class <A HREF="./Field.html" title="class in &lt;Unnamed&gt;">Field</A>
<DD>Return the depth of the field.
<DT><A HREF="./Animal.html#getField()"><B>getField()</B></A> -
Method in class <A HREF="./Animal.html" title="class in &lt;Unnamed&gt;">Animal</A>
<DD>Return the animal's field.
<DT><A HREF="./Field.html#getFreeAdjacentLocations(Location)"><B>getFreeAdjacentLocations(Location)</B></A> -
Method in class <A HREF="./Field.html" title="class in &lt;Unnamed&gt;">Field</A>
<DD>Get a shuffled list of the free adjacent locations.
<DT><A HREF="./Animal.html#getLocation()"><B>getLocation()</B></A> -
Method in class <A HREF="./Animal.html" title="class in &lt;Unnamed&gt;">Animal</A>
<DD>Return the animal's location.
<DT><A HREF="./Counter.html#getName()"><B>getName()</B></A> -
Method in class <A HREF="./Counter.html" title="class in &lt;Unnamed&gt;">Counter</A>
<DD>&nbsp;
<DT><A HREF="./Field.html#getObjectAt(Location)"><B>getObjectAt(Location)</B></A> -
Method in class <A HREF="./Field.html" title="class in &lt;Unnamed&gt;">Field</A>
<DD>Return the animal at the given location, if any.
<DT><A HREF="./Field.html#getObjectAt(int, int)"><B>getObjectAt(int, int)</B></A> -
Method in class <A HREF="./Field.html" title="class in &lt;Unnamed&gt;">Field</A>
<DD>Return the animal at the given location, if any.
<DT><A HREF="./FieldStats.html#getPopulationCount(Field, java.lang.Class)"><B>getPopulationCount(Field, Class)</B></A> -
Method in class <A HREF="./FieldStats.html" title="class in &lt;Unnamed&gt;">FieldStats</A>
<DD>Get the number of individuals in the population of a given class.
<DT><A HREF="./FieldStats.html#getPopulationDetails(Field)"><B>getPopulationDetails(Field)</B></A> -
Method in class <A HREF="./FieldStats.html" title="class in &lt;Unnamed&gt;">FieldStats</A>
<DD>Get details of what is in the field.
<DT><A HREF="./GraphView.GraphPanel.html#getPreferredSize()"><B>getPreferredSize()</B></A> -
Method in class <A HREF="./GraphView.GraphPanel.html" title="class in &lt;Unnamed&gt;">GraphView.GraphPanel</A>
<DD>Tell the layout manager how big we would like to be.
<DT><A HREF="./Randomizer.html#getRandom()"><B>getRandom()</B></A> -
Static method in class <A HREF="./Randomizer.html" title="class in &lt;Unnamed&gt;">Randomizer</A>
<DD>Provide a random generator.
<DT><A HREF="./Location.html#getRow()"><B>getRow()</B></A> -
Method in class <A HREF="./Location.html" title="class in &lt;Unnamed&gt;">Location</A>
<DD>&nbsp;
<DT><A HREF="./Field.html#getWidth()"><B>getWidth()</B></A> -
Method in class <A HREF="./Field.html" title="class in &lt;Unnamed&gt;">Field</A>
<DD>Return the width of the field.
<DT><A HREF="./GraphView.html" title="class in &lt;Unnamed&gt;"><B>GraphView</B></A> - Class in <A HREF="./package-summary.html">&lt;Unnamed&gt;</A><DD>The GraphView provides a view of two populations of actors in the field as a line graph
over time.<DT><A HREF="./GraphView.html#GraphView(int, int, int)"><B>GraphView(int, int, int)</B></A> -
Constructor for class <A HREF="./GraphView.html" title="class in &lt;Unnamed&gt;">GraphView</A>
<DD>Constructor.
<DT><A HREF="./GraphView.GraphPanel.html" title="class in &lt;Unnamed&gt;"><B>GraphView.GraphPanel</B></A> - Class in <A HREF="./package-summary.html">&lt;Unnamed&gt;</A><DD>Nested class: a component to display the graph.<DT><A HREF="./GraphView.GraphPanel.html#GraphView.GraphPanel(int, int, int)"><B>GraphView.GraphPanel(int, int, int)</B></A> -
Constructor for class <A HREF="./GraphView.GraphPanel.html" title="class in &lt;Unnamed&gt;">GraphView.GraphPanel</A>
<DD>Create a new, empty GraphPanel.
<DT><A HREF="./GridView.html" title="class in &lt;Unnamed&gt;"><B>GridView</B></A> - Class in <A HREF="./package-summary.html">&lt;Unnamed&gt;</A><DD>A graphical view of the simulation grid.<DT><A HREF="./GridView.html#GridView(int, int)"><B>GridView(int, int)</B></A> -
Constructor for class <A HREF="./GridView.html" title="class in &lt;Unnamed&gt;">GridView</A>
<DD>Create a view of the given width and height.
</DL>
<HR>
<A NAME="_H_"><!-- --></A><H2>
<B>H</B></H2>
<DL>
<DT><A HREF="./Location.html#hashCode()"><B>hashCode()</B></A> -
Method in class <A HREF="./Location.html" title="class in &lt;Unnamed&gt;">Location</A>
<DD>Use the top 16 bits for the row value and the bottom for
the column.
</DL>
<HR>
<A NAME="_I_"><!-- --></A><H2>
<B>I</B></H2>
<DL>
<DT><A HREF="./Counter.html#increment()"><B>increment()</B></A> -
Method in class <A HREF="./Counter.html" title="class in &lt;Unnamed&gt;">Counter</A>
<DD>Increment the current count by one.
<DT><A HREF="./FieldStats.html#incrementCount(java.lang.Class)"><B>incrementCount(Class)</B></A> -
Method in class <A HREF="./FieldStats.html" title="class in &lt;Unnamed&gt;">FieldStats</A>
<DD>Increment the count for one class of animal.
<DT><A HREF="./Animal.html#isAlive()"><B>isAlive()</B></A> -
Method in class <A HREF="./Animal.html" title="class in &lt;Unnamed&gt;">Animal</A>
<DD>Check whether the animal is alive or not.
<DT><A HREF="./GraphView.GraphPanel.html#isOpaque()"><B>isOpaque()</B></A> -
Method in class <A HREF="./GraphView.GraphPanel.html" title="class in &lt;Unnamed&gt;">GraphView.GraphPanel</A>
<DD>This component is opaque.
<DT><A HREF="./FieldStats.html#isViable(Field)"><B>isViable(Field)</B></A> -
Method in class <A HREF="./FieldStats.html" title="class in &lt;Unnamed&gt;">FieldStats</A>
<DD>Determine whether the simulation is still viable.
<DT><A HREF="./GraphView.html#isViable(Field)"><B>isViable(Field)</B></A> -
Method in class <A HREF="./GraphView.html" title="class in &lt;Unnamed&gt;">GraphView</A>
<DD>Determine whether the simulation should continue to run.
<DT><A HREF="./GridView.html#isViable(Field)"><B>isViable(Field)</B></A> -
Method in class <A HREF="./GridView.html" title="class in &lt;Unnamed&gt;">GridView</A>
<DD>Determine whether the simulation should continue to run.
<DT><A HREF="./SimulatorView.html#isViable(Field)"><B>isViable(Field)</B></A> -
Method in interface <A HREF="./SimulatorView.html" title="interface in &lt;Unnamed&gt;">SimulatorView</A>
<DD>Determine whether the simulation should continue to run.
</DL>
<HR>
<A NAME="_L_"><!-- --></A><H2>
<B>L</B></H2>
<DL>
<DT><A HREF="./Location.html" title="class in &lt;Unnamed&gt;"><B>Location</B></A> - Class in <A HREF="./package-summary.html">&lt;Unnamed&gt;</A><DD>Represent a location in a rectangular grid.<DT><A HREF="./Location.html#Location(int, int)"><B>Location(int, int)</B></A> -
Constructor for class <A HREF="./Location.html" title="class in &lt;Unnamed&gt;">Location</A>
<DD>Represent a row and column.
</DL>
<HR>
<A NAME="_N_"><!-- --></A><H2>
<B>N</B></H2>
<DL>
<DT><A HREF="./GraphView.GraphPanel.html#newRun()"><B>newRun()</B></A> -
Method in class <A HREF="./GraphView.GraphPanel.html" title="class in &lt;Unnamed&gt;">GraphView.GraphPanel</A>
<DD>Indicate a new simulation run on this panel.
</DL>
<HR>
<A NAME="_P_"><!-- --></A><H2>
<B>P</B></H2>
<DL>
<DT><A HREF="./GraphView.GraphPanel.html#paintComponent(java.awt.Graphics)"><B>paintComponent(Graphics)</B></A> -
Method in class <A HREF="./GraphView.GraphPanel.html" title="class in &lt;Unnamed&gt;">GraphView.GraphPanel</A>
<DD>This component needs to be redisplayed.
<DT><A HREF="./Field.html#place(java.lang.Object, int, int)"><B>place(Object, int, int)</B></A> -
Method in class <A HREF="./Field.html" title="class in &lt;Unnamed&gt;">Field</A>
<DD>Place an animal at the given location.
<DT><A HREF="./Field.html#place(java.lang.Object, Location)"><B>place(Object, Location)</B></A> -
Method in class <A HREF="./Field.html" title="class in &lt;Unnamed&gt;">Field</A>
<DD>Place an animal at the given location.
</DL>
<HR>
<A NAME="_R_"><!-- --></A><H2>
<B>R</B></H2>
<DL>
<DT><A HREF="./Rabbit.html" title="class in &lt;Unnamed&gt;"><B>Rabbit</B></A> - Class in <A HREF="./package-summary.html">&lt;Unnamed&gt;</A><DD>A simple model of a rabbit.<DT><A HREF="./Rabbit.html#Rabbit(boolean, Field, Location)"><B>Rabbit(boolean, Field, Location)</B></A> -
Constructor for class <A HREF="./Rabbit.html" title="class in &lt;Unnamed&gt;">Rabbit</A>
<DD>Create a new rabbit.
<DT><A HREF="./Field.html#randomAdjacentLocation(Location)"><B>randomAdjacentLocation(Location)</B></A> -
Method in class <A HREF="./Field.html" title="class in &lt;Unnamed&gt;">Field</A>
<DD>Generate a random location that is adjacent to the
given location, or is the same location.
<DT><A HREF="./Randomizer.html" title="class in &lt;Unnamed&gt;"><B>Randomizer</B></A> - Class in <A HREF="./package-summary.html">&lt;Unnamed&gt;</A><DD>Provide control over the randomization of the simulation.<DT><A HREF="./Randomizer.html#Randomizer()"><B>Randomizer()</B></A> -
Constructor for class <A HREF="./Randomizer.html" title="class in &lt;Unnamed&gt;">Randomizer</A>
<DD>Constructor for objects of class Randomizer
<DT><A HREF="./GraphView.GraphPanel.html#repaintNow()"><B>repaintNow()</B></A> -
Method in class <A HREF="./GraphView.GraphPanel.html" title="class in &lt;Unnamed&gt;">GraphView.GraphPanel</A>
<DD>Cause immediate update of the panel.
<DT><A HREF="./Counter.html#reset()"><B>reset()</B></A> -
Method in class <A HREF="./Counter.html" title="class in &lt;Unnamed&gt;">Counter</A>
<DD>Reset the current count to zero.
<DT><A HREF="./FieldStats.html#reset()"><B>reset()</B></A> -
Method in class <A HREF="./FieldStats.html" title="class in &lt;Unnamed&gt;">FieldStats</A>
<DD>Invalidate the current set of statistics; reset all
counts to zero.
<DT><A HREF="./GraphView.html#reset()"><B>reset()</B></A> -
Method in class <A HREF="./GraphView.html" title="class in &lt;Unnamed&gt;">GraphView</A>
<DD>Prepare for a new run.
<DT><A HREF="./GridView.html#reset()"><B>reset()</B></A> -
Method in class <A HREF="./GridView.html" title="class in &lt;Unnamed&gt;">GridView</A>
<DD>Prepare for a new run.
<DT><A HREF="./Randomizer.html#reset()"><B>reset()</B></A> -
Static method in class <A HREF="./Randomizer.html" title="class in &lt;Unnamed&gt;">Randomizer</A>
<DD>Reset the randomization.
<DT><A HREF="./Simulator.html#reset()"><B>reset()</B></A> -
Method in class <A HREF="./Simulator.html" title="class in &lt;Unnamed&gt;">Simulator</A>
<DD>Reset the simulation to a starting position.
<DT><A HREF="./SimulatorView.html#reset()"><B>reset()</B></A> -
Method in interface <A HREF="./SimulatorView.html" title="interface in &lt;Unnamed&gt;">SimulatorView</A>
<DD>Prepare for a new run.
<DT><A HREF="./Simulator.html#runLongSimulation()"><B>runLongSimulation()</B></A> -
Method in class <A HREF="./Simulator.html" title="class in &lt;Unnamed&gt;">Simulator</A>
<DD>Run the simulation from its current state for a reasonably long period,
(4000 steps).
</DL>
<HR>
<A NAME="_S_"><!-- --></A><H2>
<B>S</B></H2>
<DL>
<DT><A HREF="./GraphView.GraphPanel.html#scaleDown()"><B>scaleDown()</B></A> -
Method in class <A HREF="./GraphView.GraphPanel.html" title="class in &lt;Unnamed&gt;">GraphView.GraphPanel</A>
<DD>Scale the current graph down vertically to make more room at the top.
<DT><A HREF="./GraphView.html#setColor(java.lang.Class, java.awt.Color)"><B>setColor(Class, Color)</B></A> -
Method in class <A HREF="./GraphView.html" title="class in &lt;Unnamed&gt;">GraphView</A>
<DD>Define a color to be used for a given class of animal.
<DT><A HREF="./GridView.html#setColor(java.lang.Class, java.awt.Color)"><B>setColor(Class, Color)</B></A> -
Method in class <A HREF="./GridView.html" title="class in &lt;Unnamed&gt;">GridView</A>
<DD>Define a color to be used for a given class of animal.
<DT><A HREF="./SimulatorView.html#setColor(java.lang.Class, java.awt.Color)"><B>setColor(Class, Color)</B></A> -
Method in interface <A HREF="./SimulatorView.html" title="interface in &lt;Unnamed&gt;">SimulatorView</A>
<DD>Define a color to be used for a given class of animal.
<DT><A HREF="./Animal.html#setDead()"><B>setDead()</B></A> -
Method in class <A HREF="./Animal.html" title="class in &lt;Unnamed&gt;">Animal</A>
<DD>Indicate that the animal is no longer alive.
<DT><A HREF="./Animal.html#setLocation(Location)"><B>setLocation(Location)</B></A> -
Method in class <A HREF="./Animal.html" title="class in &lt;Unnamed&gt;">Animal</A>
<DD>Place the animal at the new location in the given field.
<DT><A HREF="./GraphView.html#showStatus(int, Field)"><B>showStatus(int, Field)</B></A> -
Method in class <A HREF="./GraphView.html" title="class in &lt;Unnamed&gt;">GraphView</A>
<DD>Show the current status of the field.
<DT><A HREF="./GridView.html#showStatus(int, Field)"><B>showStatus(int, Field)</B></A> -
Method in class <A HREF="./GridView.html" title="class in &lt;Unnamed&gt;">GridView</A>
<DD>Show the current status of the field.
<DT><A HREF="./SimulatorView.html#showStatus(int, Field)"><B>showStatus(int, Field)</B></A> -
Method in interface <A HREF="./SimulatorView.html" title="interface in &lt;Unnamed&gt;">SimulatorView</A>
<DD>Show the current status of the field.
<DT><A HREF="./Simulator.html#simulate(int)"><B>simulate(int)</B></A> -
Method in class <A HREF="./Simulator.html" title="class in &lt;Unnamed&gt;">Simulator</A>
<DD>Run the simulation from its current state for the given number of steps.
<DT><A HREF="./Simulator.html#simulateOneStep()"><B>simulateOneStep()</B></A> -
Method in class <A HREF="./Simulator.html" title="class in &lt;Unnamed&gt;">Simulator</A>
<DD>Run the simulation from its current state for a single step.
<DT><A HREF="./Simulator.html" title="class in &lt;Unnamed&gt;"><B>Simulator</B></A> - Class in <A HREF="./package-summary.html">&lt;Unnamed&gt;</A><DD>A simple predator-prey simulator, based on a rectangular field
containing rabbits and foxes.<DT><A HREF="./Simulator.html#Simulator()"><B>Simulator()</B></A> -
Constructor for class <A HREF="./Simulator.html" title="class in &lt;Unnamed&gt;">Simulator</A>
<DD>Construct a simulation field with default size.
<DT><A HREF="./Simulator.html#Simulator(int, int)"><B>Simulator(int, int)</B></A> -
Constructor for class <A HREF="./Simulator.html" title="class in &lt;Unnamed&gt;">Simulator</A>
<DD>Create a simulation field with the given size.
<DT><A HREF="./SimulatorView.html" title="interface in &lt;Unnamed&gt;"><B>SimulatorView</B></A> - Interface in <A HREF="./package-summary.html">&lt;Unnamed&gt;</A><DD>A graphical view of the simulation grid.</DL>
<HR>
<A NAME="_T_"><!-- --></A><H2>
<B>T</B></H2>
<DL>
<DT><A HREF="./Location.html#toString()"><B>toString()</B></A> -
Method in class <A HREF="./Location.html" title="class in &lt;Unnamed&gt;">Location</A>
<DD>Return a string of the form row,column
</DL>
<HR>
<A NAME="_U_"><!-- --></A><H2>
<B>U</B></H2>
<DL>
<DT><A HREF="./GraphView.GraphPanel.html#update(int, Field, FieldStats)"><B>update(int, Field, FieldStats)</B></A> -
Method in class <A HREF="./GraphView.GraphPanel.html" title="class in &lt;Unnamed&gt;">GraphView.GraphPanel</A>
<DD>Dispay a new point of data.
</DL>
<HR>
<A HREF="#_A_">A</A> <A HREF="#_C_">C</A> <A HREF="#_E_">E</A> <A HREF="#_F_">F</A> <A HREF="#_G_">G</A> <A HREF="#_H_">H</A> <A HREF="#_I_">I</A> <A HREF="#_L_">L</A> <A HREF="#_N_">N</A> <A HREF="#_P_">P</A> <A HREF="#_R_">R</A> <A HREF="#_S_">S</A> <A HREF="#_T_">T</A> <A HREF="#_U_">U</A>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="./index.html?index-all.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="index-all.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="./allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="./allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,37 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Tue Sep 01 15:42:49 BST 2015-->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Generated Documentation (Untitled)
</TITLE>
<SCRIPT type="text/javascript">
targetPage = "" + window.location.search;
if (targetPage != "" && targetPage != "undefined")
targetPage = targetPage.substring(1);
if (targetPage.indexOf(":") != -1)
targetPage = "undefined";
function loadFrames() {
if (targetPage != "" && targetPage != "undefined")
top.classFrame.location = top.targetPage;
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<FRAMESET cols="20%,80%" title="" onLoad="top.loadFrames()">
<FRAME src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)">
<FRAME src="FieldStats.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes">
<NOFRAMES>
<H2>
Frame Alert</H2>
<P>
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
<BR>
Link to<A HREF="FieldStats.html">Non-frame version.</A>
</NOFRAMES>
</FRAMESET>
</HTML>

View File

@@ -0,0 +1,41 @@
Class documentation
<---- javadoc command: ---->
/Applications/BlueJ.app/Contents/Frameworks/jdk.framework/Versions/A/Contents/Home/bin/javadoc
-author
-version
-nodeprecated
-package
-noindex
-notree
-nohelp
-nonavbar
-source
1.8
-classpath
/Applications/BlueJ.app/Contents/Resources/Java/bluejcore.jar:/Applications/BlueJ.app/Contents/Resources/Java/junit-4.8.2.jar:/Applications/BlueJ.app/Contents/Resources/Java/userlib/pi4j-core.jar:/Applications/BlueJ.app/Contents/Resources/Java/userlib/pi4j-device.jar:/Applications/BlueJ.app/Contents/Resources/Java/userlib/pi4j-gpio-extension.jar:/Applications/BlueJ.app/Contents/Resources/Java/userlib/pi4j-service.jar:/Users/djb/Dropbox/ofwj/projects-sandbox/chapter12/foxes-and-rabbits-graph
-d
/Users/djb/Dropbox/ofwj/projects-sandbox/chapter12/foxes-and-rabbits-graph/doc
-encoding
UTF-8
-charset
UTF-8
-docletpath
/Applications/BlueJ.app/Contents/Resources/Java/bjdoclet.jar
-doclet
bluej.doclet.doclets.formats.html.HtmlDoclet
/Users/djb/Dropbox/ofwj/projects-sandbox/chapter12/foxes-and-rabbits-graph/FieldStats.java
<---- end of javadoc command ---->
Loading source file /Users/djb/Dropbox/ofwj/projects-sandbox/chapter12/foxes-and-rabbits-graph/FieldStats.java...
Constructing Javadoc information...
Standard Doclet version 1.8.0_31
Building tree for all the packages and classes...
Generating /Users/djb/Dropbox/ofwj/projects-sandbox/chapter12/foxes-and-rabbits-graph/doc/FieldStats.html...
Generating /Users/djb/Dropbox/ofwj/projects-sandbox/chapter12/foxes-and-rabbits-graph/doc/package-frame.html...
Generating /Users/djb/Dropbox/ofwj/projects-sandbox/chapter12/foxes-and-rabbits-graph/doc/package-summary.html...
Generating /Users/djb/Dropbox/ofwj/projects-sandbox/chapter12/foxes-and-rabbits-graph/doc/constant-values.html...
Building index for all the packages and classes...
Building index for all classes...
Generating /Users/djb/Dropbox/ofwj/projects-sandbox/chapter12/foxes-and-rabbits-graph/doc/allclasses-frame.html...
Generating /Users/djb/Dropbox/ofwj/projects-sandbox/chapter12/foxes-and-rabbits-graph/doc/allclasses-noframe.html...
Generating /Users/djb/Dropbox/ofwj/projects-sandbox/chapter12/foxes-and-rabbits-graph/doc/index.html...
Generating /Users/djb/Dropbox/ofwj/projects-sandbox/chapter12/foxes-and-rabbits-graph/doc/stylesheet.css...

View File

@@ -0,0 +1,170 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Tue Feb 14 18:40:58 GMT 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Class Hierarchy (foxes-and-rabbits-graph)
</TITLE>
<META NAME="date" CONTENT="2012-02-14">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Class Hierarchy (foxes-and-rabbits-graph)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?overview-tree.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
Hierarchy For All Packages</H2>
</CENTER>
<H2>
Class Hierarchy
</H2>
<UL>
<LI TYPE="circle">java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><B>Object</B></A><UL>
<LI TYPE="circle"><A HREF="Animal.html" title="class in &lt;Unnamed&gt;"><B>Animal</B></A><UL>
<LI TYPE="circle"><A HREF="Fox.html" title="class in &lt;Unnamed&gt;"><B>Fox</B></A><LI TYPE="circle"><A HREF="Rabbit.html" title="class in &lt;Unnamed&gt;"><B>Rabbit</B></A></UL>
<LI TYPE="circle">java.awt.<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/Component.html?is-external=true" title="class or interface in java.awt"><B>Component</B></A> (implements java.awt.image.<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/image/ImageObserver.html?is-external=true" title="class or interface in java.awt.image">ImageObserver</A>, java.awt.<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/MenuContainer.html?is-external=true" title="class or interface in java.awt">MenuContainer</A>, java.io.<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A>)
<UL>
<LI TYPE="circle">java.awt.<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/Container.html?is-external=true" title="class or interface in java.awt"><B>Container</B></A><UL>
<LI TYPE="circle">javax.swing.<A HREF="http://download.oracle.com/javase/6/docs/api/javax/swing/JComponent.html?is-external=true" title="class or interface in javax.swing"><B>JComponent</B></A> (implements java.io.<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A>)
<UL>
<LI TYPE="circle"><A HREF="GraphView.GraphPanel.html" title="class in &lt;Unnamed&gt;"><B>GraphView.GraphPanel</B></A></UL>
<LI TYPE="circle">java.awt.<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/Window.html?is-external=true" title="class or interface in java.awt"><B>Window</B></A> (implements javax.accessibility.<A HREF="http://download.oracle.com/javase/6/docs/api/javax/accessibility/Accessible.html?is-external=true" title="class or interface in javax.accessibility">Accessible</A>)
<UL>
<LI TYPE="circle">java.awt.<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/Frame.html?is-external=true" title="class or interface in java.awt"><B>Frame</B></A> (implements java.awt.<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/MenuContainer.html?is-external=true" title="class or interface in java.awt">MenuContainer</A>)
<UL>
<LI TYPE="circle">javax.swing.<A HREF="http://download.oracle.com/javase/6/docs/api/javax/swing/JFrame.html?is-external=true" title="class or interface in javax.swing"><B>JFrame</B></A> (implements javax.accessibility.<A HREF="http://download.oracle.com/javase/6/docs/api/javax/accessibility/Accessible.html?is-external=true" title="class or interface in javax.accessibility">Accessible</A>, javax.swing.<A HREF="http://download.oracle.com/javase/6/docs/api/javax/swing/RootPaneContainer.html?is-external=true" title="class or interface in javax.swing">RootPaneContainer</A>, javax.swing.<A HREF="http://download.oracle.com/javase/6/docs/api/javax/swing/WindowConstants.html?is-external=true" title="class or interface in javax.swing">WindowConstants</A>)
<UL>
<LI TYPE="circle"><A HREF="GridView.html" title="class in &lt;Unnamed&gt;"><B>GridView</B></A> (implements <A HREF="SimulatorView.html" title="interface in &lt;Unnamed&gt;">SimulatorView</A>)
</UL>
</UL>
</UL>
</UL>
</UL>
<LI TYPE="circle"><A HREF="Counter.html" title="class in &lt;Unnamed&gt;"><B>Counter</B></A><LI TYPE="circle"><A HREF="Field.html" title="class in &lt;Unnamed&gt;"><B>Field</B></A><LI TYPE="circle"><A HREF="FieldStats.html" title="class in &lt;Unnamed&gt;"><B>FieldStats</B></A><LI TYPE="circle"><A HREF="GraphView.html" title="class in &lt;Unnamed&gt;"><B>GraphView</B></A> (implements <A HREF="SimulatorView.html" title="interface in &lt;Unnamed&gt;">SimulatorView</A>)
<LI TYPE="circle"><A HREF="Location.html" title="class in &lt;Unnamed&gt;"><B>Location</B></A><LI TYPE="circle"><A HREF="Randomizer.html" title="class in &lt;Unnamed&gt;"><B>Randomizer</B></A><LI TYPE="circle"><A HREF="Simulator.html" title="class in &lt;Unnamed&gt;"><B>Simulator</B></A></UL>
</UL>
<H2>
Interface Hierarchy
</H2>
<UL>
<LI TYPE="circle"><A HREF="SimulatorView.html" title="interface in &lt;Unnamed&gt;"><B>SimulatorView</B></A></UL>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?overview-tree.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,33 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.8.0_31) on Tue Sep 01 15:42:49 BST 2015 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
&lt;Unnamed&gt;
</TITLE>
<META NAME="date" CONTENT="2015-09-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" CLASS="FrameTitleFont">
<A HREF="package-summary.html" target="classFrame">&lt;Unnamed&gt;</A></FONT>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
Classes</FONT>&nbsp;
<FONT CLASS="FrameItemFont">
<BR>
<A HREF="FieldStats.html" title="class in &lt;Unnamed&gt;" target="classFrame">FieldStats</A></FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>

View File

@@ -0,0 +1,47 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.8.0_31) on Tue Sep 01 15:42:49 BST 2015 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
</TITLE>
<META NAME="date" CONTENT="2015-09-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<HR>
<HR>
<H2>
Package &lt;Unnamed&gt;
</H2>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="FieldStats.html" title="class in &lt;Unnamed&gt;">FieldStats</A></B></TD>
<TD>This class collects and provides some statistical data on the state
of a field.</TD>
</TR>
</TABLE>
&nbsp;
<P>
<DL>
</DL>
<HR>
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,171 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Tue Feb 14 18:40:58 GMT 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Class Hierarchy (foxes-and-rabbits-graph)
</TITLE>
<META NAME="date" CONTENT="2012-02-14">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title=" Class Hierarchy (foxes-and-rabbits-graph)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?package-tree.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
Hierarchy For Package &lt;Unnamed&gt;
</H2>
</CENTER>
<H2>
Class Hierarchy
</H2>
<UL>
<LI TYPE="circle">java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><B>Object</B></A><UL>
<LI TYPE="circle"><A HREF="Animal.html" title="class in &lt;Unnamed&gt;"><B>Animal</B></A><UL>
<LI TYPE="circle"><A HREF="Fox.html" title="class in &lt;Unnamed&gt;"><B>Fox</B></A><LI TYPE="circle"><A HREF="Rabbit.html" title="class in &lt;Unnamed&gt;"><B>Rabbit</B></A></UL>
<LI TYPE="circle">java.awt.<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/Component.html?is-external=true" title="class or interface in java.awt"><B>Component</B></A> (implements java.awt.image.<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/image/ImageObserver.html?is-external=true" title="class or interface in java.awt.image">ImageObserver</A>, java.awt.<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/MenuContainer.html?is-external=true" title="class or interface in java.awt">MenuContainer</A>, java.io.<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A>)
<UL>
<LI TYPE="circle">java.awt.<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/Container.html?is-external=true" title="class or interface in java.awt"><B>Container</B></A><UL>
<LI TYPE="circle">javax.swing.<A HREF="http://download.oracle.com/javase/6/docs/api/javax/swing/JComponent.html?is-external=true" title="class or interface in javax.swing"><B>JComponent</B></A> (implements java.io.<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A>)
<UL>
<LI TYPE="circle"><A HREF="GraphView.GraphPanel.html" title="class in &lt;Unnamed&gt;"><B>GraphView.GraphPanel</B></A></UL>
<LI TYPE="circle">java.awt.<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/Window.html?is-external=true" title="class or interface in java.awt"><B>Window</B></A> (implements javax.accessibility.<A HREF="http://download.oracle.com/javase/6/docs/api/javax/accessibility/Accessible.html?is-external=true" title="class or interface in javax.accessibility">Accessible</A>)
<UL>
<LI TYPE="circle">java.awt.<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/Frame.html?is-external=true" title="class or interface in java.awt"><B>Frame</B></A> (implements java.awt.<A HREF="http://download.oracle.com/javase/6/docs/api/java/awt/MenuContainer.html?is-external=true" title="class or interface in java.awt">MenuContainer</A>)
<UL>
<LI TYPE="circle">javax.swing.<A HREF="http://download.oracle.com/javase/6/docs/api/javax/swing/JFrame.html?is-external=true" title="class or interface in javax.swing"><B>JFrame</B></A> (implements javax.accessibility.<A HREF="http://download.oracle.com/javase/6/docs/api/javax/accessibility/Accessible.html?is-external=true" title="class or interface in javax.accessibility">Accessible</A>, javax.swing.<A HREF="http://download.oracle.com/javase/6/docs/api/javax/swing/RootPaneContainer.html?is-external=true" title="class or interface in javax.swing">RootPaneContainer</A>, javax.swing.<A HREF="http://download.oracle.com/javase/6/docs/api/javax/swing/WindowConstants.html?is-external=true" title="class or interface in javax.swing">WindowConstants</A>)
<UL>
<LI TYPE="circle"><A HREF="GridView.html" title="class in &lt;Unnamed&gt;"><B>GridView</B></A> (implements <A HREF="SimulatorView.html" title="interface in &lt;Unnamed&gt;">SimulatorView</A>)
</UL>
</UL>
</UL>
</UL>
</UL>
<LI TYPE="circle"><A HREF="Counter.html" title="class in &lt;Unnamed&gt;"><B>Counter</B></A><LI TYPE="circle"><A HREF="Field.html" title="class in &lt;Unnamed&gt;"><B>Field</B></A><LI TYPE="circle"><A HREF="FieldStats.html" title="class in &lt;Unnamed&gt;"><B>FieldStats</B></A><LI TYPE="circle"><A HREF="GraphView.html" title="class in &lt;Unnamed&gt;"><B>GraphView</B></A> (implements <A HREF="SimulatorView.html" title="interface in &lt;Unnamed&gt;">SimulatorView</A>)
<LI TYPE="circle"><A HREF="Location.html" title="class in &lt;Unnamed&gt;"><B>Location</B></A><LI TYPE="circle"><A HREF="Randomizer.html" title="class in &lt;Unnamed&gt;"><B>Randomizer</B></A><LI TYPE="circle"><A HREF="Simulator.html" title="class in &lt;Unnamed&gt;"><B>Simulator</B></A></UL>
</UL>
<H2>
Interface Hierarchy
</H2>
<UL>
<LI TYPE="circle"><A HREF="SimulatorView.html" title="interface in &lt;Unnamed&gt;"><B>SimulatorView</B></A></UL>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?package-tree.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 B

View File

@@ -0,0 +1,228 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Tue Feb 14 18:40:58 GMT 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Serialized Form (foxes-and-rabbits-graph)
</TITLE>
<META NAME="date" CONTENT="2012-02-14">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Serialized Form (foxes-and-rabbits-graph)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?serialized-form.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="serialized-form.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H1>
Serialized Form</H1>
</CENTER>
<HR SIZE="4" NOSHADE>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="center"><FONT SIZE="+2">
<B>Package</B> <B>&lt;Unnamed&gt;</B></FONT></TH>
</TR>
</TABLE>
<P>
<A NAME="GridView"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Class <A HREF="GridView.html" title="class in &lt;Unnamed&gt;">GridView</A> extends <A HREF="http://download.oracle.com/javase/6/docs/api/javax/swing/JFrame.html?is-external=true" title="class or interface in javax.swing">JFrame</A> implements Serializable</B></FONT></TH>
</TR>
</TABLE>
<P>
<A NAME="serializedForm"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Serialized Fields</B></FONT></TH>
</TR>
</TABLE>
<H3>
STEP_PREFIX</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>STEP_PREFIX</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<H3>
POPULATION_PREFIX</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>POPULATION_PREFIX</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<H3>
stepLabel</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/javax/swing/JLabel.html?is-external=true" title="class or interface in javax.swing">JLabel</A> <B>stepLabel</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<H3>
population</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/javax/swing/JLabel.html?is-external=true" title="class or interface in javax.swing">JLabel</A> <B>population</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<H3>
fieldView</H3>
<PRE>
GridView.FieldView <B>fieldView</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<H3>
colors</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">K</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">V</A>&gt; <B>colors</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<H3>
stats</H3>
<PRE>
<A HREF="FieldStats.html" title="class in &lt;Unnamed&gt;">FieldStats</A> <B>stats</B></PRE>
<DL>
<DL>
</DL>
</DL>
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?serialized-form.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="serialized-form.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,29 @@
/* Javadoc style sheet */
/* Define colors, fonts and other style attributes here to override the defaults */
/* Page background color */
body { background-color: #FFFFFF; color:#000000 }
/* Headings */
h1 { font-size: 145% }
/* Table colors */
.TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */
.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */
.TableRowColor { background: #FFFFFF; color:#000000 } /* White */
/* Font used in left-hand frame lists */
.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
/* Navigation bar fonts and colors */
.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */
.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */
.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;}
.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;}
.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}
.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}

View File

@@ -0,0 +1,258 @@
#BlueJ package file
dependency1.from=Field
dependency1.to=Randomizer
dependency1.type=UsesDependency
dependency10.from=Rabbit
dependency10.to=Randomizer
dependency10.type=UsesDependency
dependency11.from=Rabbit
dependency11.to=Field
dependency11.type=UsesDependency
dependency12.from=Rabbit
dependency12.to=Location
dependency12.type=UsesDependency
dependency13.from=FieldStats
dependency13.to=Counter
dependency13.type=UsesDependency
dependency14.from=Simulator
dependency14.to=Field
dependency14.type=UsesDependency
dependency15.from=Simulator
dependency15.to=SimulatorView
dependency15.type=UsesDependency
dependency16.from=Simulator
dependency16.to=Rabbit
dependency16.type=UsesDependency
dependency17.from=Simulator
dependency17.to=Fox
dependency17.type=UsesDependency
dependency18.from=Simulator
dependency18.to=Animal
dependency18.type=UsesDependency
dependency19.from=Simulator
dependency19.to=Randomizer
dependency19.type=UsesDependency
dependency2.from=Field
dependency2.to=Location
dependency2.type=UsesDependency
dependency20.from=Simulator
dependency20.to=Location
dependency20.type=UsesDependency
dependency21.from=FieldStats
dependency21.to=Field
dependency21.type=UsesDependency
dependency22.from=GridView
dependency22.to=FieldStats
dependency22.type=UsesDependency
dependency23.from=GridView
dependency23.to=Field
dependency23.type=UsesDependency
dependency24.from=Simulator
dependency24.to=GridView
dependency24.type=UsesDependency
dependency25.from=GraphView
dependency25.to=FieldStats
dependency25.type=UsesDependency
dependency26.from=GraphView
dependency26.to=Field
dependency26.type=UsesDependency
dependency27.from=Simulator
dependency27.to=GraphView
dependency27.type=UsesDependency
dependency28.from=GraphView
dependency28.to=Animal
dependency28.type=UsesDependency
dependency29.from=SimulatorView
dependency29.to=Animal
dependency29.type=UsesDependency
dependency3.from=Animal
dependency3.to=Field
dependency3.type=UsesDependency
dependency30.from=GridView
dependency30.to=Animal
dependency30.type=UsesDependency
dependency4.from=Animal
dependency4.to=Location
dependency4.type=UsesDependency
dependency5.from=SimulatorView
dependency5.to=Field
dependency5.type=UsesDependency
dependency6.from=Fox
dependency6.to=Randomizer
dependency6.type=UsesDependency
dependency7.from=Fox
dependency7.to=Field
dependency7.type=UsesDependency
dependency8.from=Fox
dependency8.to=Location
dependency8.type=UsesDependency
dependency9.from=Fox
dependency9.to=Rabbit
dependency9.type=UsesDependency
objectbench.height=76
objectbench.width=1050
package.editor.height=635
package.editor.width=942
package.editor.x=70
package.editor.y=80
package.numDependencies=30
package.numTargets=12
package.showExtends=true
package.showUses=true
project.charset=UTF-8
readme.editor.height=700
readme.editor.width=900
readme.editor.x=53
readme.editor.y=23
target1.height=50
target1.name=Randomizer
target1.naviview.expanded=true
target1.showInterface=false
target1.type=ClassTarget
target1.typeParameters=
target1.width=90
target1.x=480
target1.y=570
target10.editor.height=700
target10.editor.width=900
target10.editor.x=230
target10.editor.y=46
target10.height=50
target10.name=GridView
target10.naviview.expanded=true
target10.showInterface=false
target10.type=ClassTarget
target10.typeParameters=
target10.width=80
target10.x=630
target10.y=130
target11.editor.height=700
target11.editor.width=900
target11.editor.x=126
target11.editor.y=95
target11.height=50
target11.name=Simulator
target11.naviview.expanded=true
target11.showInterface=false
target11.type=ClassTarget
target11.typeParameters=
target11.width=80
target11.x=70
target11.y=110
target12.editor.height=700
target12.editor.width=900
target12.editor.x=0
target12.editor.y=2
target12.height=50
target12.name=Location
target12.naviview.expanded=true
target12.showInterface=false
target12.type=ClassTarget
target12.typeParameters=
target12.width=90
target12.x=480
target12.y=310
target2.editor.height=700
target2.editor.width=900
target2.editor.x=0
target2.editor.y=2
target2.height=50
target2.name=Rabbit
target2.naviview.expanded=true
target2.showInterface=false
target2.type=ClassTarget
target2.typeParameters=
target2.width=80
target2.x=130
target2.y=520
target3.editor.height=717
target3.editor.width=900
target3.editor.x=398
target3.editor.y=53
target3.height=50
target3.name=SimulatorView
target3.naviview.expanded=true
target3.showInterface=false
target3.type=InterfaceTarget
target3.typeParameters=
target3.width=110
target3.x=540
target3.y=40
target4.editor.height=700
target4.editor.width=900
target4.editor.x=230
target4.editor.y=46
target4.height=50
target4.name=GraphView
target4.naviview.expanded=true
target4.showInterface=false
target4.type=ClassTarget
target4.typeParameters=
target4.width=90
target4.x=470
target4.y=170
target5.editor.height=700
target5.editor.width=900
target5.editor.x=0
target5.editor.y=2
target5.height=50
target5.name=Fox
target5.naviview.expanded=true
target5.showInterface=false
target5.type=ClassTarget
target5.typeParameters=
target5.width=80
target5.x=280
target5.y=470
target6.editor.height=700
target6.editor.width=900
target6.editor.x=230
target6.editor.y=46
target6.height=50
target6.name=FieldStats
target6.naviview.expanded=true
target6.showInterface=false
target6.type=ClassTarget
target6.typeParameters=
target6.width=80
target6.x=750
target6.y=210
target7.editor.height=700
target7.editor.width=900
target7.editor.x=0
target7.editor.y=2
target7.height=50
target7.name=Field
target7.naviview.expanded=true
target7.showInterface=false
target7.type=ClassTarget
target7.typeParameters=
target7.width=80
target7.x=340
target7.y=240
target8.editor.height=700
target8.editor.width=900
target8.editor.x=0
target8.editor.y=2
target8.height=50
target8.name=Counter
target8.naviview.expanded=true
target8.showInterface=false
target8.type=ClassTarget
target8.typeParameters=
target8.width=80
target8.x=820
target8.y=110
target9.editor.height=700
target9.editor.width=900
target9.editor.x=0
target9.editor.y=2
target9.height=50
target9.name=Animal
target9.naviview.expanded=true
target9.showInterface=false
target9.type=AbstractTarget
target9.typeParameters=
target9.width=90
target9.x=190
target9.y=370