From 4c18222a5340e1b0020c75d5da7eed095a8ec4d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Nasta=C5=82y?= Date: Sun, 10 May 2020 21:51:12 +0000 Subject: [PATCH] Fixing docs --- Oskar_Nastaly_ML_Report.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Oskar_Nastaly_ML_Report.md b/Oskar_Nastaly_ML_Report.md index 38cdff5..ecf7ac8 100644 --- a/Oskar_Nastaly_ML_Report.md +++ b/Oskar_Nastaly_ML_Report.md @@ -1,4 +1,8 @@ -## Introduction +# Machine Learning implementation report + + + +## Introduction Purpose of my ML implementation is for the agent (tractor) to decide what fertilizer it should use. It's decision is mostly based on nutrients in soil, but also on few other properties. @@ -94,11 +98,23 @@ Later that model is loaded and prediction engine is created when program is star Agent (tractor) navigates trough the grid looking for tiles where it can plant some plants. Upon planting and visitin already growing plants agent decides if any fertilizer is needed (rule based decision), and what fertilizer to use (using ML prediction engine). + + if (farm.getCrop(x, y).getStatus() >= 2) + { + fertilizer = fertilizerHolder.GetFertilizer(Engine.PredictFertilizer(farm.getCrop(x, y), farm.getPresetCropTypes(farm.getCrop(x, y).getCropType()))); + while (!(farm.getCrop(x, y).isSaturated(-1)) && farm.getCrop(x, y).belowCapacity() && inventory.useItem(fertilizerHolder.GetFertilizerID(fertilizer.Name), 0)) + { + farm.getCrop(x, y).Fertilize(fertilizer); + fertilizer = fertilizerHolder.GetFertilizer(Engine.PredictFertilizer(farm.getCrop(x, y), farm.getPresetCropTypes(farm.getCrop(x, y).getCropType()))); + WaitTwoFrames = true; + } + If field is properly fertilized it will have higher production rate, resulting in faster growth of a plant. Production rate value is shown in the UI as well as it is represented by the colour of progression bar (right side of every tile). At 100% bar will pure **Green**. Any value below will make bar more **Red**, while any value above will add **Blue**, eventually turning bar colour into cyan. + Example: -![Progression Bar](https://git.wmi.amu.edu.pl/s425077/PotatoPlan/raw/Oskar-ML/example_img.jpg) + ![Progression Bar](https://git.wmi.amu.edu.pl/s425077/PotatoPlan/raw/Oskar-ML/example_img.jpg)