Code Monkey home page Code Monkey logo

cropgen's Introduction

CropGen

A crop design optimisation platform to optimise and quantify trade-offs of cropping strategies.

About the project

CropGen is a tool connecting the APSIM sorghum crop growth model with an optimisation platform to facilitate exploration and optimisation of the performance of a number of design factors (e.g., maturity, tillering), with respect to relevant production criteria (e.g., yield, risk, water use). CropGen generates a set of optimal solutions, i.e., combinations of the design factors specified, representing the full spectrum of trade-offs of the criteria of interest, allowing for different preferences and circumstances to be represented. By making use of the optimisation framework, CropGen allows for high dimensionality problems and scenarios to be explored more comprehensively and efficiently than traditional methods.

A schematic of the CropGen optimisation platform is shown below.

image

Implementation

CropGen is provided as a stand-alone application. It is written in Python and can be containerized. It has been tried and tested using Docker. The Dockerfile has been provided, which can be built to create the Docker image. To integrate CropGen into a fully functional system, the following additional applications are required:

  • APSIM Crop Growth Model โ€“ For running simulations.
  • Results Server โ€“ For invoking CropGen and for storing the results.

CropGen uses a JSON configuration file (CropGen\lib\config\config.json) to specify the application configuration. Each configuration entry can be overridden, to use a different value when running inside Docker, by appending Docker to the end of the entry, for example:

"SocketServerHost": "localhost",    
"SocketServerHostDocker": "0.0.0.0",

API

RunJobRequest

To run CropGen, a RunJobRequest message (CropGen\lib\models\run\run_job_request.py) should be sent. If a job is currently running, or the format of the message is invalid, an error will be returned (CropGen\lib\models\run\run_crop_gen_response.py), otherwise the run will commence.

To connect to APSIM, CropGen will create a socket connection, using the RunJobRequest, to extract the CGMServerHost and CGMServerPort. To run APSIM, CropGen will send RelayApsim messages (CropGen\lib\models\cgm\relay_apsim.py), until all iterations have been processed. Each iteration, CropGen will send an IterationResults message (CropGen\lib\models\rest\iteration_results_message.py) to the Results Server. Once all iterations have been processed, a FinalResults message (CropGen\lib\models\rest\final_results_message.py) will be sent.

The results messages will be sent using REST PUT calls (CropGen\lib\utils\results_publisher.py). The URLs for these are sent as part of the RunJobRequest (IterationResultsUrl and FinalResultsUrl), it is up to the Results Server to consolidate this data into the desired output format and allow these results to be downloaded.

GetStatus

To get the status of CropGen, a Status message can be sent to CropGen. The response will contain information about any running jobs.

GetConfig

To get the status of CropGen, a GetConfig message can be sent to CropGen. The response will contain the configuration that is currently loaded.

SetConfig

To set the CropGen configuration, a SetConfig message can be set to CropGen. This will overwrite the running configuration.

Example System Implementation

The following diagram shows an example of a full system implementation, with an example sequence diagram to illustrate a job being run.

Example Full System Implementation

image

RunJob Sequence Diagram

image

cropgen's People

Contributors

joesaddigh avatar gdurri avatar lapenavid avatar jbrider avatar

Watchers

Lucian avatar Dean Holzworth avatar Alex Wu avatar

Forkers

gdurri

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.