Skip to content

bezirg/hlogo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HLogo: parallel NetLogo variant in Haskell

Build Status License (3-Clause BSD) (Documentation) (Test Results)

Software Requirements

Installing

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.

Updating

git pull
cabal update
cabal install

This will automatically fetch&update any needed dependencies and update the HLogo library.

Example: Running an HLogo program

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

Comparing with a NetLogo program

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  

About

A Parallel NetLogo variant in Haskell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published