No description, website, or topics provided.
Java Other
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Disease-Spreading Simluation
COMP-150-AAA project by:
    Constantin Berzan
    Sean Nilan
    Amanda Hay
    Max Alexander
Tufts University, spring 2012.

What's included?
-------------------          - the simulation    - the GUI for the simulation                  - agent definition         - agent visualization                - disease definitions                   - food item definition          - food item visualization              - an agent that adds food to the environment             - runs batch simulations and plots agents alive / infected              - runs batch simulations for different scenarios

- Java (not included; we tried it with 1.6 only)
- MASON simulation framework (included)
- gson (included; required for collecting statistics)
- JFreeChart library (included; only if plotting is desired)
- JMF (included; only if recording videos is desired)
- python 2.6+ with matplotlib (not included; only if batch runs with plotting are desired)

1) See "Classpath" below for how to configure your Java classpath so that MASON,
   gson, etc. are on it.
2) To compile all Java code, just do:
3) To run the simulation with a GUI, do:
        java DiseaseSpreadWithUI
   You can use the console to adjust parameters for the visualization. To adjust
   parameters for the simulation itself (e.g. disease type, flocking), you will
   need to specify those parameters on the command line. For a list, do:
        java DiseaseSpreadWithUI -help
4) To run the simulation without a GUI, do:
        java DiseaseSpread
   By default, this will run the simulation forever, which is probably not what
   you want. Add "-for 400" to run for 400 steps. For other options, See:
        java DiseaseSpread -help
5) To run batch simulations for one condition, do, for example:
        ./ --num 30 --sim-args "-for 3000 -disease cold \
            -flocking 2.5 -observability 0.2 -symptom-tolerance 0.2" \
            --title "testing testing" --fig "test.png"
   This will run 30 trials of the simulation with the given parameters, and
   plot the number of agents alive and infected at each time step in "test.png".
   It will save the logs for each trial in a temporary directory.
6) To run several "interesting" scenarios that we used in our presentation, do:
   This can take a while (30min+). It will produce all plots in ./plots/fig-*.png.

Add the following to your ~/.bashrc to get Mason + charting to work:

# Mason simulator:
MASON_PROJ_LOC=### put here the path to the project directory, e.g. /home/cberzan/comp150, not /home/cberzan/comp150/mason
export CLASSPATH=$CLASSPATH:.:$MASON_PROJ_LOC/mason/jar/mason.16.jar:$MASON_PROJ_LOC/jfreechart-1.0.14/lib/jcommon-1.0.17.jar:$MASON_PROJ_LOC/jfreechart-1.0.14/lib/jfreechart-1.0.14.jar:$MASON_PROJ_LOC/jfreechart-1.0.14/lib/iText-2.1.5.jar

If you're using another shell, you'll have to use the appropriate command (like
setenv instead of export).

JFreeChart comes with a gnujaxp.jar, which is some old XML thingy which breaks
java preferences... Don't put it in your classpath.

# JMF installation
For cshell:

setenv CLASSPATH $JMFHOME/lib/jmf.jar:$JMFHOME/lib/sound.jar:${CLASSPATH}

# Gson library for batch stats