(Documentation) (Test Results)
- GHC>=8.0.1 and cabal-install>=1.24
- or the latest Haskell platform
Run inside your shell:
cabal sandbox init # optional but recommended for installing any needed dependencies only-locally
cabal update
cabal install
This will automatically fetch any needed dependencies and install the HLogo library.
git pull
cabal update
cabal install
This will automatically fetch&update any needed dependencies and update the HLogo library.
There are many HLogo examples under bench/hlogo/
directory.
To compile an HLogo model (e.g. RedBlue), inside the repository's directory open a shell and run:
cabal exec ghc -- --make -O -XTemplateHaskell -XNoImplicitPrelude -cpp -threaded bench/hlogo/RedBlue.hs
To run the generated code:
./bench/hlogo/RedBlue --max-pxcor=10 --min-pxcor=-10 --max-pycor=10 --min-pycor=-10 +RTS -N2
# e.g. -N2 is for running on 2 cores
If you haven't add NetLogo.jar
to your CLASSPATH
, you have to locate its path in the filesystem.
After that run:
java -Xmx1024m -cp PATH/TO/NetLogo.jar org.nlogo.headless.Main --model bench/nlogo/RedBlue.nlogo