From 7691828cae4d04800f91ff43cef4d202d6cb50fb Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 11 May 2020 01:30:18 +0200 Subject: [PATCH] UI --- Game1/Game1.cs | 6 ++++++ Game1/Sources/ML/MLModel.cs | 13 +++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Game1/Game1.cs b/Game1/Game1.cs index 1a1b4d8..e1b8e9b 100644 --- a/Game1/Game1.cs +++ b/Game1/Game1.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using System; +using System.IO; namespace Game1 { @@ -19,6 +20,9 @@ namespace Game1 private Texture2D house; private Texture2D markers; private Texture2D mouseCursor; + string directory = Directory.GetCurrentDirectory(); + + private Texture2D ProgressionBar; private Texture2D ProgressionBarStatus; @@ -69,6 +73,8 @@ namespace Game1 //Generates the map with some random values inventory.initInventorySystem(); + + string path = directory + "Game1/Content/ML/Fertilizer_Prediction.csv"; input.init(graphics, new Vector2(16,16), 56, 1); //Generates the starting size houseUnit.init(input.getTileSize(), input.getSpacing()); //Generates the house position tractorUnit.init(houseUnit.GetRectangle(), input); //Generates the Tractor diff --git a/Game1/Sources/ML/MLModel.cs b/Game1/Sources/ML/MLModel.cs index 2eec77c..32bc6fa 100644 --- a/Game1/Sources/ML/MLModel.cs +++ b/Game1/Sources/ML/MLModel.cs @@ -11,12 +11,13 @@ using Microsoft.ML.Trainers.LightGbm; class MLModel { private static MLContext mlContext = new MLContext(seed: 1); - private static string path = "C:/Users/Oskar/source/repos/PotatoPlanFinal/Game1/Content/ML/Fertilizer_Prediction.csv"; - private static string modelpath = "C:/Users/Oskar/source/repos/PotatoPlanFinal/Game1/Content/ML/MLmodel"; - private static string report = "C:/Users/Oskar/source/repos/PotatoPlanFinal/Game1/Content/ML/report"; - private static string pathBig = "C:/Users/Oskar/source/repos/PotatoPlanFinal/Game1/Content/ML/BigFertPredict.csv"; - private static string modelpathBig = "C:/Users/Oskar/source/repos/PotatoPlanFinal/Game1/Content/ML/MLmodelBig"; - private static string reportBig = "C:/Users/Oskar/source/repos/PotatoPlanFinal/Game1/Content/ML/report_BigModel"; + private static string directory = Directory.GetCurrentDirectory(); + private static string path = directory; + private static string modelpath = directory; + private static string report = directory; + private static string pathBig = directory; + private static string modelpathBig = directory; + private static string reportBig = directory; // Loading data, creatin and saving ML model for smaller dataset (100) public static void CreateModel()