Skip to content

Wisetorsk/BioSimCSharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BioSim Project

Updated repo in Azure Devops

https://dev.azure.com/thewisetorsk/BioSim

What tf is it.

Simulates an island and some basic animals in it. Animals can interact with each other and the enviroment they occupy. This impacts the fitness of the animals.

Annual cycle:

  1. Food Grows in each cell
  2. Herbivores feed on grown food in cell
  3. Carnivores hunt and feed on herbiovres
  4. Dead herbivores are removed from enviroment
  5. Animals mate and give birth to offspring
  6. Animals migrate to neighboring cells
  7. Animals grow older
  8. Animals have a "chance" to die
  9. Dead animals are removed from enviroment


Dependencies

Animal generation uses MathNet.Numerics (NuGet)
Data post processing and visualization uses ffmpeg & python 3 with numpy and matplotlib
FFmpeg is available through Chocolatey or directly from ffmpeg.org
Automatic installation of all depenencies may be available through install script in the future.


Features

Main simulation runs as a console app, with possibilities to control and alter parameters through a MVC web interface

Results

Simulation object can generate output graphs as png through python. Data is saved as csv files available in the Results folder

Current output csv files:

  • simResult.csv - Global overview of island population and average "life" parameters.
  • HerbivorePopulation.csv - Cell by cell overview of Herbivore population by year.
  • CarnivorePopulation.csv - Cell by cell overview of Carnivore population by year.

Classes

Sim

Main simulation class can be instanced using this constructor

Sim(int yearsToSimulate, string template, bool noMigration);

Parameters:

  • yearsToSimulate -> integer value for the maximum amount of years the simulation is allowed to run.
  • template -> string representing the layout of the island to be simulated using "newline" char for linebreak. ex: "DDD\nSSS\nJJJ" is a three by three island with three "Desert" cells, three "Savannah" cells, and three "Jungle" cells.

    Cell types:
    Ocean and Mountain cells are impassable and uninhabitable to animals

    • "S" - Savannah
    • "J" - Jungle
    • "D" - Desert
    • "M" - Mountain
    • "O" - Ocean
  • noMigration -> bool value deciding wether animals are allowed to move between cells

Simulation can be started by invoking the method Sim.Simulate();
The simulation will run until one of two arguments is met:

  • All animals are dead
  • Current simulated year == yearsToSimulate

Animal

Main Animal class

Enviroment

Main Enviroment class

Parameters

The parameter class and subclasses decide the behaviour of the animals based on animal class (herbivoreParams/carnivoreParams) and the available food and re-growth rate of food in the island cells.


WebInterface

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published