Code Monkey home page Code Monkey logo

abm-cowgrazing's Introduction

Simple agent-based modeling of cow grazing over a square lattice

Model Details

  1. Adult cows (agents) are confined in a $n \times n$ square lattice (we call it field).
  2. $n_{cows}$ are fixed throughout the grazing simulation and are initially placed randomly within the lattice.
  3. Each cow possesses a health attribute named $h_{cow} \in [0,1]$.
  4. Each patch within the field represents grass and is quantified by its health $h_{grass} \in [0,1]$.
  5. Initially, $\rho_{grass, init}$ percent of the field will be filled with grass. $n_{cows}$ will be placed randomly and all will have $h_{cow, init}$.
  6. For each time step:
    6.1. One cow (positioned at $x_{cow}, y_{cow}$) will be selected for feeding.
    6.2. It will select among its neighbors for grass where $h_{grass} > 0$ (positioned at $x_{grass}, y_{grass}$)
    6.3. Once the cow chooses a nearest healthy grass patch:
        6.3.1. The cow will move to that position ($x_{grass}, y_{grass}$)
        6.3.2. The health of the cow will increase by a factor $g_{cow}$.
        6.3.3. The health of the grass patch $h_{grass}$ will decrease by a factor $e_{grass}$.
        6.3.4. In the same manner, $\rho_{grass, grow}$ percent of the field will be selected to grow by a factor $g_{grass}$.

Sample simulation (time = 50 days):

Cow Growth Simulation

Questions?

If you have questions or anything that you'd like to raise, shoot me an email at jprmaulion[at]gmail[dot]com. 🐄

abm-cowgrazing's People

Contributors

jprmaulion avatar

Watchers

 avatar

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.