GithubHelp home page GithubHelp logo

jsinkers / mcss-assignment-2 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 35.05 MB

SWEN90004 - Modelling Complex Software Systems - Assignment 2

NewLisp 0.06% Java 0.34% Jupyter Notebook 79.00% HTML 20.60% Batchfile 0.01%

mcss-assignment-2's Introduction

Wealth Distribution

SWEN90004 - Modelling Complex Software Systems - Assignment 2

James Sinclair - 1114278, Yujun Yan - 952112, Junkai Xing - 1041973

Data Analysis

Organisation

Directory structure:

  • data-analysis: Jupyter notebooks and output files from data analysis
  • java-data: stores results from running Java model
    • commit-{hash}: stores Java output from a given commit
      • initial-patches: stores initial grain state of patches
  • netlogo-data: BehaviorSpace output of NetLogo wealth distribution model
    • initial-world-check: stores initial grain state of patches for NetLogo models
  • out: contains built class files
  • props: properties files as described below
  • src: source code for Java model

Build

To build the simulation, from the project root:

javac -d out src/World.java src/Turtle.java src/Patch.java src/Heading.java --class-path=src

Run

To run the simulation, from the project root:

java -classpath out World
  • can pass properties file as command line argument, otherwise defaults to props/wealth-distrib-default.properties
  • output CSVs will be named:
    • original model: {properties-file}-seed-{random-seed}.csv
    • extension model: {properties-file}-seed-{random-seed}-inheritance.csv
  • output CSVs are output in the working directory

Command Line Options

java -classpath out World {filename} {random seed} {inheritance flag}
  • arg 1: properties filename {string}
    • default value = props/wealth-distrib-default.properties
    • e.g. java -classpath out World props/wealth-distrib-default.properties
  • arg 2: random number seed {int}
    • default value = 0
    • If provided, must also pass arg 1.
    • e.g. java -classpath out World props/wealth-distrib-default.properties 10
  • arg 3: whether to run models with inheritance extension {boolean}
    • default value = false (no inheritance)
    • can only be used with arg 1 and arg 2

Running experiments

Run the Windows batch script wealth-distrib.bat to build and then run experiments. An individual CSV will be output for each run of each experiment.

Properties Files

Properties descriptions wealth-distrib-{i}.properties for experiments. The NetLogo default model settings are used unless otherwise specified.

  1. wealth-distrib-default.properties: Default
  2. wealth-distrib-2.properties: num-people = 1000
  3. wealth-distrib-3.properties: num-people = 50
  4. wealth-distrib-4.properties: max-vision = 15
  5. wealth-distrib-5.properties: max-vision = 1
  6. wealth-distrib-6.properties: percent-best-land = 25%
  7. wealth-distrib-7.properties: percent-best-land = 5%
  8. wealth-distrib-8.properties: grain-growth-interval = 10
  9. wealth-distrib-9.properties: num_grain_grown = 1
  10. wealth-distrib-10.properties: num_grain_grown = 10
  11. wealth-distrib-11.properties: life-expectancy-min = 50; life-expectancy-max = 50
  12. wealth-distrib-12.properties: life-expectancy-min = 50; life-expectancy-max = 100

Tests

JUnit is required to run unit tests. Requires manual setup

mcss-assignment-2's People

Contributors

jsinkers avatar junkaixing avatar

Stargazers

 avatar

Watchers

 avatar

mcss-assignment-2's Issues

need to set the first element in the list to be the next patch a turtle should move to

yMin = yMax - distance + 1;

if we use yMin yMax here, there is no garantee that the first element in the returned list represent the first patch (the next patch with 1 distance from the turtle) in the heading direction. However, there needs to be a way to find the next patch in the turtle's heading direction in order to help a turtle decide which is the next patch it should move to. It seems that other three if/else branch does not conflict with this purpose. Can you fix this branch to achieve this purpose? Or maybe you need a new method?

not sure if bound checking for get heading patches is implemented

* TODO return all patches in the heading direction within the turtle's vision. If the vision reach the boundary of the world, then just return the available patches in the heading direction that is in the world

this method should return all patches in the heading direction within the turtle's vision. If the vision reach the boundary of the world, then just return the available patches in the heading direction that is in the world. I am not sure if this bound checking mechanism has been implemented.

reproducibility and random seeds

rather than a new Random instance being produced in Turtle class, we should use World to generate random numbers so that we can make runs reproducible (helpful for debugging). will add a getter to world for the random instance and update turtle accordingly

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.