Statistikk og Simulering

Lab Veke 7–11. Predator/Prey

Veke 8–10. Implementasjon av predator/prey

8.4. Veke 8–10. Implementasjon av predator/prey

  8.4.1 Getting started
  8.4.2 Continued development
  8.4.3 Presentasjon

Denne delen av prosjektet er for stor til å verta fullført i labtimane. Det er viktig at de gjer ein stor del av oppgåvane nedanfor mellom labtimane i veke 7 og veke 9.

Me har presentasjon både i veke 9 og veke 10. Det er eit krav at de har ein køyrbar prototyp til ein kvar tid, slik at de kan demonstrera når som helst.

8.4.1. Getting started

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

Oppgåve 8.12 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 the age and time of death for every agent must be recorded. It may be useful to record other data as well, such as the population size.

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 8.13 Review the OO model from Exercise 8.9 and the prioritised features from Exercises 8.5 to 8.7. 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.

8.4.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 8.14 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 8.15 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.

8.4.3. Presentasjon

Oppgåve 8.16 Run the simulator with a range of different parameters. Playing around with the parameters, select three different scenarioes showing the variety of possible outcomes:

1.
Both species dies out.
2.
One species dies out while the other survives.
3.
Both species survive.

Oppgåve 8.17 (Presentasjon) Demonstrer simulatoren din, og vis

1.
korleis han vert brukt.
2.
eit par ulike scenario (sjå oppgåve 8.16).
3.
kva utdata simulatoren gjev.