NOTE: Due to the advanced natured of these modifications and the fact that I'm not particularly good at explaining them, I don't suggest doing any of this unless you really know what you're doing.



To add a new dump method

1. Add an additional line with a number before the words "Simulation Size" in the file SimulationData.txt; this number will tell it how many times to run through the simulation using your dump method the next time the program runs.

2. Follow the directions for adding a food dump method found just above the constructor in Space2d.java

----------------------------------------

To add an animal
NOTE: Some of this may sound very confusing, but the process of adding an animal, once you have coded the animal's class, is actually fairly simple.  All you are doing is finding all the parts of the code that make a reference to other animal types and adding in more code that says the same thing, only about your animal type.  Just find the functions this text refers to, and it should all make sense.

CAUTION: Make sure you have a backup before attemtping these modifications, as these instructions may be obsolete

1. Write the code for new animal's class, making it a subclass of Animal; I suggest copying and then modifying the code from another animal, perhaps a simple one such as Cow, so you know what to include.

2. Create the text file (Your Animal)Data.txt, and place it in the Data folder; this file will tell the program your animal's statistics; simply pattern your file off of one of the other ones in this folder.

2. Within Animal.java:
a. Add 2 lines to die () so that the program reacts when an instance of your new animal dies
b. Add lines to makeBabies () to set up the creation of a baby animal of your new type

3. Within SimulationState.java:
a. Add a public static int Total_(Your animal) to keep track of how many instances of your animal are currently alive, set it to be initially equal to the final static int.
b. If you plan to use a graphical display, addVar the static int to the Probe Map within the Landscape constructor.
c. If you plan to graph the population of your animal, add a getTotal(Your animal) () function

4. Within Landscape.java:
a. Add a private final static int NUM(YOUR ANIMAL) to tell the program how many instances of your animal to start with and add 1 to NUM_ANIMALS
b. If you plan to graph the population of your animal, add a getTotal(Your animal) () function
c. At the top of the buildObjects () function, make an object of your animal's class, then add code similar to the code used for each other animal below (this code creates the initial instances of each animal)

5. If you are using Overlord (ie, you are doing graphical simulations), then within Overlord.java:
a. In buildObjects, add a cmap.setColor$ToName that assigns whatever color you prefer to the highest possible number that is not already being used for a color; while coding your animal's class, you should set its color equal to this number
b.If you wish to graph the population of your animal, then, just slightly lower down, add an animalsGraph.createSequence$withFeedFrom$andSelector () for your animal; the only parts that need to be any different from the parts for the other animals are the first parameter, which should say what you are measuring, and the second parameter of the Selector constructor, which should be the function you added to SimulationState.java (ie, "getTotal(Your animal)")

6. If you are Optimizer to run multiple simulations, then within Middleman.java:
a. If you wish to measure your animal's viability, add a public double (your animal)Viability and a public int (your animal)Successes, setting this number to 0
b. In endSimulation (), add a line towards the top: (your animal)Viability = (your animal)Successes / measureTime
c. Later in the same function, add the line simuInfo.(your animal)viability = this.(your animal)Viability
d. Near the end of updateDisplay (), add a line similar the lines for the other animals that increment (animal)Successes at the appropriate time

Also, within Info.java:
a. Add a field do hold (your animal)Viability

Also, within Optimizer.java:
a. Add a line to addInfo () to update averageInfos on your animal's viability
b. Add a line to getAverages () to divide your animal's viability by the number of runs
c. Add a line to reportInfo () to report your animal's viability

And if you want the program to determine the best food dump method for your animal's viability, then also with Optimizer.java:
a. Add a public int max(Animal Name)ViabilityType and a public double max(Animal Name)Viability that is equal to -1 above the constructor
b. Add a few lines to getAverages () similar to the ones already there that check to see if a given element of averageInfos[] has the highest viability for your animal
c. At the end of reportInfo (), add a couple lines to output max(Animal Name)ViabilityType and max(Animal Name)Viability