Skip to content

AgroEcoSim

Latest
Compare
Choose a tag to compare
@isolin isolin released this 13 Dec 14:20
· 83 commits to main since this release

This is the first beta release of the simulation and rendering. It wraps improvements in visualization, finally a correct irradiance interface and an improved simple metabolism model.

Changelog

  • The plant parts accumulate availability of external resources and their efficiency in production of metabolic substances over a day
  • Plants behave normally if there is enough energy reserve, then those parts with best access to external resources get the energy. If the energy is reserve is low, plant parts producing the most metabolic substances get the most energy.
  • Visualization of the new data added to Godot.
  • Automatic screenshots in Godot.
  • Reduced rendering times since only leafs are considered sensors
  • Batch rendering of all sensors at once (at my machine this runs slower than the single-core mode)

How it works

A server listens on port 7215 for HTTP requests, runs simulations and returns the results.

Prerequisites

Usage

  1. Extract the archive AgroEcoSim-SOME_DATE.zip
  2. Run sh deployDocker (on windows you need to load the images manually) before starting the first time
  3. Then, each time you want to start the simulation server just run docker-compose up or docker compose up (depending on the engine version) in the folder where you extracted the files.

API

Once the server is up and running, navigate your browser to explore the API to http://localhost:7215/swagger/index.html

A new simulation is started by a POST request to http://localhost:7215/Simulation. Please be patient, CPU irradiance rendering is really slow. To simulate 3 plants for one month, it takes 17 seconds on a recent AMD Ryzen 9. Better keep the number of plants and time steps low. Here is an example of a configuration json sent in the POST request:

{
    "TicksPerHour": 1,
    "TotalHours": 744,
    "FieldResolution": 0.5,
    "FieldSize": { "X": 10, "D": 4, "Z": 10 },
    "Seed": 42,

    "Plants": [
        { "P": {"X": 2.5, "Y": -0.05, "Z": 5}},
        { "P": {"X": 5, "Y": -0.05, "Z": 5}},
        { "P": {"X": 7.5, "Y": -0.05, "Z": 5}}
    ],

    "Obstacles": [
        { "T": "wall", "O": 0, "L": 5, "H": 3.2, "P": {"X": 2.5, "Y": 0, "Z": 0}},
        { "T": "umbrella", "R": 1.5, "H": 2.2, "D": 0.1, "P": {"X": 2.5, "Y": 0, "Z": 2.5}}
    ],
}

For the obstacles, T denotes type, O orientation, L horizontal length or diameter and R half-length or radius, H: vertical height, D is depth or thickness, all in meters.

The result is an array of plant volumes (in m³) at simulation end. The ordering is the same as in the input:

{
  "plants": [
    { "V": 0.0017850252  },
    { "V": 0.0015580055  },
    { "V": 0.0016916988  }
  ]
}

Godot visualization

The simulation can also run as a Godot plugin. You may either start the project directly from the repository, or grab one of the attached zip files. Make sure to first start the rendering server: python3 render-server.py --port 9000.