Skip to content

AgroEcoSim

Pre-release
Pre-release
Compare
Choose a tag to compare
@isolin isolin released this 24 Oct 18:33
· 109 commits to main since this release

This is the fourth release of the simulation and rendering. It targets improvements in rendering and extends the scene by obstacles. The shadowing does not affect the growth yet.

Changelog

  • Two types of obstacles can be added to the scene: walls and umbrellas
  • A new version of the interface between plants simulation and rendering (sending primitives instead of triangle meshes)

How it works

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

Prerequisites

Usage

  1. Extract the archive files
  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  }
  ]
}