Skip to content
This repository has been archived by the owner on Jun 8, 2020. It is now read-only.

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

License

Notifications You must be signed in to change notification settings

skyzh/fish-agent-simulation-mcm2020

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

54 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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.