Scripts supporting the design, execution, and analysis of Polyworld simulations
- Polyworld
- Java 8 with Ant
- Python 3 with NumPy and pandas
-
Clone the repository:
$ git clone https://github.com/smailliwcs/pwscripts.git
-
Initialize and update submodules:
pwscripts$ git submodule init pwscripts$ git submodule update
-
Build the JIDT submodule:
pwscripts/java/lib/jidt$ ant
-
Build the Java code:
pwscripts/java$ ant
-
Configure environment variables:
PATH
: Addpwscripts/shell
.CLASSPATH
: Addpwscripts/java/lib/jidt/infodynamics.jar
andpwscripts/java/bin
.PYTHONPATH
: Addpolyworld/scripts
.
polyworld$ ln -s ../pwscripts/config/static.mf gui.mf
polyworld$ ./Polyworld ../pwscripts/config/legacy.wf
polyworld$ ./Polyworld $(../pwscripts/config/modern)
To grow "poisonous" food items, pass the -D poison
option to modern
.
polyworld$ pwdriven ../pwscripts/config/legacy.wf 10 runs/driven
To ensure simulations run to completion, pass the --complete
option to pwdriven
.
This discards simulations that terminate prematurely (e.g., due to a population crash).
polyworld$ pwpassive runs/passive runs/driven/*
The entire simulation:
polyworld$ pmvencode run/movie.pmv run/movie.mp4 640 480
A segment of the simulation:
polyworld$ pmvencode run/movie.pmv run/movie.mp4 640 480 -- -s 9001 -e 10000
polyworld$ ./bin/genetics runs/legacy | java Diversity 0 > diversity.txt
Post hoc:
polyworld$ ./bin/timeseries in-vitro runs/legacy death 1 10 1000 | java Complexity > complexity.txt
On the fly:
polyworld$ mkfifo timeseries
polyworld$ java Complexity < timeseries > complexity.txt &
polyworld$ ./Polyworld ../pwscripts/config/legacy.wf --TimeSeriesLog '{ On True; }'
polyworld$ rm timeseries
Information-theoretic metrics include Complexity
, Entropy
, CompleteTransferEntropy
, CollectiveTransferEntropy
, and InfoDynamics
(which calculates the following metrics in one pass: active information storage, apparent transfer entropy, and separable information).
In general, multiple and/or longer time series may be required to achieve numerical stability.
To accomplish this when calculating post hoc, increase the first and/or last numeric arguments to timeseries
.
When calculating on the fly, specify the Repeats
and/or Steps
subparameters of TimeSeriesLog
.
For some metrics, additional arguments to java
are required.
Refer to the Python code's inline documentation:
pwscripts/python$ python calculate.py --help