Coder Social home page Coder Social logo

skyzh / fish-agent-simulation-mcm2020 Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 0.0 8.86 MB

๐ŸŸ๐ŸŸ An agent-based model for simulating fish distribution in North Atlantic.

License: MIT License

Rust 50.05% JavaScript 12.25% HTML 0.99% Vue 5.24% TypeScript 0.22% Python 2.57% R 28.03% Shell 0.65%
agent-based-modeling agent-based-simulation d3 d3js r rlanguage python visualization mcm ocean-modelling

fish-agent-simulation-mcm2020's Introduction

Fish Agent Simulation for MCM2020

For MCM2020 Problem A, our team proposed an agent-based model to identify where fish are most likely to be.

This repo contains the complete workflow for running simulation, analyzing data and visualizing.

Fish Simulation

This part of work is done with the Rust programming language. Source code is located in png_process folder.

We grab sea surface temperature data from NASA Earth Observation website, thus using real world data for analysis.

Here we proposed a living index function, which is composed of five parts:

  • temperature of current location
  • food availability (more fish clustering in one location causes lower food availability)
  • land distance (far from land causes low land distance score)
  • age
  • random factor ~N(0,0.1)

Fish agents will automatically discover optimal location for themselves. By simulating this process with real world data we got a reasonable model for locating fish.

We also proposed a Markov-based global warming model to predict temperature of a given location at a given time from historical data.

Combining the simulation process and global warming model, we successfully obtained the most likely location of these fish in the future.

Visualization of Simulation Result

Data visualization is mainly done with d3.js. With d3-contour library, it's easy to observe living index function value.

We stack land map, visualization layer and temperature layer from top to bottom to obtain a map visualization.

Legends are drawn with Apple Keynote.

Data Analysis

In log_process, we use Python to extract useful information from simulation log. They are sorted into .csv files. These results are retained in log_process folder.

In coordinate_convert, we tried to obtain latitude and longitude from GeoTIFF file. Surprisingly, it's easy to convert pixel position to earth location with simple arithmetic.

Charts and Plotting

This is done with R Studio and the R programming language. R Markdown files are located in analysis folder. ggplot library is very helpful in producing high-quality and good-looking figures. These figures are exported in pdf format, ready for use in LaTeX.

Related Works

The design of this agent simulation system is greatly inspired by my previous project Game Theory on Matrix (aka. ๅŸบไบŽ่ฎฐๅฟ†ๆ•ˆๅบ”็š„็ฉบ้—ดๅ›šๅพ’ๅ›ฐๅขƒไธญ็ณป็ปŸๅˆไฝœ็š„ๆผ”ๅŒ–). In this fish agent simulation project, I leveraged real-world data and the Rust programming language to obtain a more stable and pratical model.

Visualization

Food Index and Load Index

food_score_explanation land_score_explanation

Fish distribution in one month

2040-8-fish

Fish distribution animation (Model evaluation result in very early stage)

animation

output

License

The simulation program, data analysis scripts and visualization program is licensed under MIT.

Credit

Thank my teammates T.T. Tang and R.L. Ye for designing this model in detail and coming up with ways to test and evaluate this model.

fish-agent-simulation-mcm2020's People

Contributors

dependabot[bot] avatar skyzh avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fish-agent-simulation-mcm2020's Issues

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.