###Current Version: 0.1.5
Broken: panic: runtime error: index out of range
during operation.
##Goal
Server-side computation, client-side GUI controls and visualisation of the running ABM in a web browser.
Generalise system so any abm
package with local model context, agent design, etc can be hot-swapped in (linked via a command line flag) and run.
###How to use:
Install Go from here.
Download this repository: run go get -u github.com/benjamin-rood/abm-colour-polymorphism
Change current directory to $GOPATH/src/github.com/benjamin-rood/abm-colour-polymorphism
and run cd net && go build && ./net
Point web browser at localhost:8080
Only tested so far on Safari (OS X) and Chrome (OS X, Windows 8.1).
Base requirements completed.
-
A simple interface for the CP Prey ABM, with the visualisation on the left, with contextual parameter controls on the right. ✅
-
Use P5js for render viewport. ✅
-
Browser recieves drawing instructions from ABM which get loaded into the P5 instance's draw loop. ✅
-
Responsive design, visualisation (render viewport) scales to the dimensions of available browser real estate. ✅
-
Server handles concurrent bi-directional connections for concurrent ABM modelling individual to each user, with data sent between client and server using Web Sockets. ✅
-
Server cleans up after user disconnections. ✅
-
Server receives new submitted contextual parameters as signal to start/restart ABM. ✅
-
Serialisation of data messages using JSON (prohibatively slow for anything approaching 10,000 agents). ✅
-
CP Prey agents implementation:
- Rule-Based-Behaviour. ✅
- Asexual Reproduction. ✅
- Mutation (colouration). ✅
-
Visual Predator implementation:
- Rule-Based-Behaviour. ✅
- Exhaustive Prey Search (very slow). ✅
- Colour Imprinting (needs tweaking, no baseline yet established). ✅
-
Simple concurrent execution of Predator/Prey RBB. ✅
-
Unit tests for
geometry
,calc
,render
packages. ✅
-
Essential unit tests for
abm
package ✅ -
Client-side input validation.
-
Switch data serialisation to Protocol Buffers (protobuf) – marshalling drawing instructions to JSON is currently the single most expensive action!
-
Visual Predator implemenation:
- Find baseline params for Colour Imprinting. ✅
- Adaptation in response to hunger. ✅
- Starvation ⟹ Death. ✅
- Sexual Reproduction. ✅
- Better Prey Search (using grid system).
-
Use k-dimensional tree for spatial partitioning of model environment.
-
Visual Predator implemenation:
- Optimal Prey Search (using k-d tree)
-
Complete tests for
abm
package -
Integration, end-to-end tests?
-
Live statistical graphing widgets
-
Allow end-user to switch between different browser layouts: Visualisation only, Standard, and Statistical.
-
Control ABM computation from command-line.
-
Enable use in a distributed environment.
-
Complete testing suite.
-
Allow hot-swapping of different
abm
packages. -
Store modelling sessions to server database along with statistical data for later retrieval.
-
Offline ABM computation (start the model running, leave it, reconnect, see what it's up to).
-
Fluid ABM timescale controls.
-
Optional recording of Visualisation to SVG frame sequence.
##Context Software for computing a Predator-Prey Agent Based Model of prey colour polymorphism (CP) in Go.
Written specifically to assist the research by Dr. James Dale in evaluating hypotheses for the evolutionary maintenance of extreme colour polymorphism.