Statistikk og Simulering

Prosjekt 2

Veke 6. Implementasjon av predator/prey

6.5. Veke 6. Implementasjon av predator/prey

Denne delen av prosjektet er venta å for stor til å verta fullført på éi labøkt. Difor tek me ei pause frå dette prosjektet for å gje tid til å fullføra implementasjonen. I labøkta veke 10 skal de bruka implementasjonen.

6.5.1. Getting started

Oppgåve 6.9 Download the Barnes and Kölling’s «Book projects» from the BlueJ web page, and find the «foxes and rabbits» project.

Oppgåve 6.10 Review the «foxes and rabbits» example from Barnes and Kölling. Check that it compiles and runs. Even if it does not simulate ‘your’ species, it is still your first running prototype simulator.

It is suggested that you use Java and build on the example by Barnes and Kölling. You should keep the following requirements in mind throughout the project.

1.
The simulator must be able to produce a log file with comma-separated values (CVS) recording statistically data.

As a minimum, you should record

  • the age and time of death for every agent must be recorded.
  • the population sizes for each timestep.
2.
Make some (not all) of the model features configurable, so that you can experiment with variations of the model (e.g. starting population size, grid size, etc.).
3.
Visualise the location of individual agents at each time step. (The example from Barnes and Kolling tells you how to do this.)

Oppgåve 6.11 Review the OO model from last week’s lab session. Discuss what amendments you need to make to the prototype simulator to implement your model.

1.
Write the amendments down in order of priority.
2.
Allocate one amendment (task) to each person to do first.
3.
Whenever one amendment is made, check that the prototype still runs.

As tasks (amendments) are complete, allocate new ones to keep busy.

6.5.2. Continued development

Since Barnes and Kolling gives you a working prototype, you are well placed for an iterative (agile) development approach. The following exercises are intended as an aid to structure the process.

Oppgåve 6.12 Review your runnning prototype and discuss how to implement the features above.

1.
Divide the work into tasks, in order of priority.
2.
Allocate one amendment (task) to each person to do first.
3.
Whenever one amendment is made, check that the prototype still runs.

Continue allocating and completing tasks until all the necessary features are implemented.

Oppgåve 6.13 Evaluate your simulator. Which features have been implemented to satisfaction? What remains to be desired?

1.
Write down all features that you would like to add as potential tasks.
2.
Prioritise the tasks, and order them accordingly.
3.
Split the list into three sections, of (1) tasks which must be complete before the presentation, (2) tasks which you hope to complete, and (3) the rest.
4.
Take one task each and start implementing new features.
5.
Whenever one amendment is made, check that the prototype still runs and discuss whether it is satisfactory.

Continue allocating and completing tasks until you are satisfied.