RandomMoveInGrid/assignment.txt ------------------------------- 0. Change the default size of the world and the number of agents created. Compile, run. 1. Add a debug message to Agent step() that prints out the x and y values in the Point returned from model.moveObjectInWorld( this, dx, dy ) (when it does return a Point!) 2. Change Model-stepReport() so that it calculates the average Y location of agents and prints that to the report lines. (Change the "header" info in the report file, too.) 3. Add a new parameter, chipDensity, using the instructions in howTo-AddParameter.txt 4. Add a new class, WoodChip, using the instructions in howTo-AddNewClass.txt . 5. Use the new class WoodChip in Model buildModel() to create woodchip instances and place them randomly in the world. Use the chipDensity parameter to control how many to create. Note some issues: how to make sure there is enough room for chips and ants; not placing them on top of each other; creating a list to keep track of them. 6. Change the Ant step method so that (before it moves?) it checks its neighbor cells to see if there is a chip in any of them. Add a debug message to indicate if any found, and if so, where. (Note: what if there are more than one neighbor chips?) There are two ways to do this: a. write methods that use the methods you know about to find out what is in neighbor cells, eg getObjectAt(); b. look at the Repast API for the Object2DGrid class and use the one of the getMooreNeighbors() methods. 7. Change the Ant's so that they have an IV that can be null (no chip) or can store the address of a WoodChip object that it is carrying. Add a printSelf() method that prints that info, along with other "state" of the ant. 8. If an ant is not carrying a chip, and is next to one, it picks it up. Note: what all has to be changed, in which objects, when a chip is "picked up"? 9. If an ant is carrying a chip, and it senses one next to it, change the ant so it puts the chip down in an open cell contiguous to the one with the chip. 10. Then what?? Run the model, see what happens, and think about ways to change the Ant behaviour so they perform as described in the NetLogo description. Also -- what could you be measuring and writing to the report file or plotting on the screen? - # Agents carrying chips? - Average over all chips, the #of chip neighbors they have? - Variance of chip population's average x,y values? - ? --------------------------------------------------------------------