Coder Social home page Coder Social logo

lanecodes / crafty_brazil Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jamesdamillington/crafty_brazil

0.0 1.0 0.0 63.91 MB

CRAFTY-Brazil: An implementation of the CRAFTY ABM simulation model across a Brazilian study area

R 6.77% Python 0.68% Shell 1.19% Java 91.36%

crafty_brazil's Introduction

CRAFTY-Brazil

DOI

This repo contains code for an implementation of the CRAFTY model across a Brazilian study area. The code was originally cloned from this repo. The original readme for that repo is copied below.

This model version is intended for use with BioLUC, linked via FLUTE Maestro. Scripts to create model input data and to analyse model outputs are also available.

Building the project without Eclipse

To help users build the project independently of Eclipse we have provided an ant build script, build.xml. To rebuild compiled binaries run the following command from the root of this repository.

ant clean && ant

Original repo readme follows, and see the newer CRAFTY homepage

CRAFTY CoBRA Template

Instructions for using the template

This template is meant to include the most appropriate file structure for a new CRAFTY-CoBRA model to start with. However, depending on your model it might be a better idea to start from another configured project.

When you checked out the template from the repository, make sure to disconnect the project and optionally share it with another repository (otherwise you'd mess up the template when committing if you're allowed to):

  • In eclipse, right-click the checked out project > Team > Disconnect
  • Delete the .hg folder in the project folder
  • In eclipse, right-click the checked out project > Team > Share Project ...

For information about setting up CRAFTY-CoBRA look here.

Template Adaptation

In order to adjust this template to your context, search all files for "TEMPLATE" and replace that string with a suitable substitute. Also look for "CUSTOMIZE" to e.g. adapt paths and further names.

Currently known files are: .local.properties ./config/ant/FetchBackResults.xml ./config/ant/ReleaseToLinuxCluster.xml ./config/ant/ReleaseToLinuxCluster-FS.xml ./config/cluster/resources/Eddie_CraftySerialModel.sh ./config/cluster/resources/Eddie_CraftyParallelModel.sh ./config/launcher/Crafty Template CoBRA.launch (substitute all occurrences of CRAFTY_TemplateCoBRA by your project name) files in ./config/R

Default Configuration

The out-of-the-box configuration is:

startTick: 2000 endTick: 2003 world: CUSTOMIZE-WORLD scenario: CUSTOMIZE-SCENARIO FRs: FR1, FR2, FR3 BTs: Cognitor, Innovator Preferences:Competitiveness, SocialApproval, NeighbourApproval Capitals: Cap1, Cap2, Cap3 Services: Service1, Service2, Service3

The default configuration should work as is and simulates a single region via Region.xml. In case you like to use several regions (4 per default) change World_XML.xml to World_CSV.xml in the file data/xml/Scenario.xml.

Test Run

Right click the file './config/launcher/Crafty Template CoBRA.launch' and choose 'Run as...' > Note: you need to substitute the project name first (see above)!

ReleaseToLinuxCluster

This ant script facilitates the transfer of model configuration data to e.g. a linux cluster. The '-FS' version of the script assumes you have mapped the cluster file system to a network drive of your local file system (see here for Eddie)

Some Notes

  • CRAFTY-CoBRA supports parallel processing of regions which requires MPI to be present and mpi.jar in the Java classpath. If MPI is not present, mpi.jar must be excluded from the Java classpath. CRAFTY-CoBRA will then issue a warning (No MPI in classpath!) which can be ignored.

  • CRAFTY-CoBRA currently issues a number of warnings from LEventbus. They basically mean that decision making processes are triggered, but no actual decision for that trigger configured. In most cases the warnings can be ignored.

Post-Processing

The folder ./config/R contains templates to aggregate and visualise simulation output data with R. See crafty wiki for details.


If you have any further questions don't hesitate to contact [email protected]

crafty_brazil's People

Contributors

jamesdamillington avatar lanecodes avatar

Watchers

 avatar

crafty_brazil's Issues

Document details of entry point for simulation

James and I took screenshots of his Eclipse configuration on 2nd December (see attached). These confirm the following details are needed to run a simulation:

  • Entry point is main in org.volante.abm.serialization.ModelRunner
  • Program is run with arguments -f xml/Scenario.xml -n 1 -o 0 -r 1.

The command line options for ModelRunner are given in the legacy getting started instructions in the CRAFTY docs. Of those used above we have

  • -f is location of scenario file relative to the data directory. The data directory can be specified by the -d option, but apparently defaults to ./data.
  • -n is the number of runs
  • -o is random seed offset
  • -r is Number of runs of configuration with random seed

We should document how a user could initialise such a configuration from the command line. This supports running models from inside containers.

crafty_eclipse_run_arg
crafty_eclipse_run_common
crafty_eclipse_run_main

Document how to build CRAFTY Brazil

The CRAFTY docs are light on information about how to build CRAFTY. This is important because we will need to make changes to the CRAFTY code and it would be good to be able to do so without needing to check in additional binaries.

I have not been able to find a .pom or build.xml file, indicating CRAFTY is not normally built with Maven or Ant. I have, however, found some ant scripts in config/ant, though these seem to be about publishing models or running them on clusters rather than simply compiling changes to source code. There is also an Eclipse ./.project file present containing build configuration. I wonder if CRAFTY is traditionally built using Eclipse. If so we should document this and think of how to build on the command line as an alternative to facilitate containerisation and CI.

See resources

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.