1
0
forked from s425077/PotatoPlan
This commit is contained in:
Joel 2020-05-11 01:30:18 +02:00
parent c3048700f2
commit 7691828cae
2 changed files with 13 additions and 6 deletions

View File

@ -2,6 +2,7 @@
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using System; using System;
using System.IO;
namespace Game1 namespace Game1
{ {
@ -19,6 +20,9 @@ namespace Game1
private Texture2D house; private Texture2D house;
private Texture2D markers; private Texture2D markers;
private Texture2D mouseCursor; private Texture2D mouseCursor;
string directory = Directory.GetCurrentDirectory();
private Texture2D ProgressionBar; private Texture2D ProgressionBar;
private Texture2D ProgressionBarStatus; private Texture2D ProgressionBarStatus;
@ -69,6 +73,8 @@ namespace Game1
//Generates the map with some random values //Generates the map with some random values
inventory.initInventorySystem(); inventory.initInventorySystem();
string path = directory + "Game1/Content/ML/Fertilizer_Prediction.csv";
input.init(graphics, new Vector2(16,16), 56, 1); //Generates the starting size input.init(graphics, new Vector2(16,16), 56, 1); //Generates the starting size
houseUnit.init(input.getTileSize(), input.getSpacing()); //Generates the house position houseUnit.init(input.getTileSize(), input.getSpacing()); //Generates the house position
tractorUnit.init(houseUnit.GetRectangle(), input); //Generates the Tractor tractorUnit.init(houseUnit.GetRectangle(), input); //Generates the Tractor

View File

@ -11,12 +11,13 @@ using Microsoft.ML.Trainers.LightGbm;
class MLModel class MLModel
{ {
private static MLContext mlContext = new MLContext(seed: 1); 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 directory = Directory.GetCurrentDirectory();
private static string modelpath = "C:/Users/Oskar/source/repos/PotatoPlanFinal/Game1/Content/ML/MLmodel"; private static string path = directory;
private static string report = "C:/Users/Oskar/source/repos/PotatoPlanFinal/Game1/Content/ML/report"; private static string modelpath = directory;
private static string pathBig = "C:/Users/Oskar/source/repos/PotatoPlanFinal/Game1/Content/ML/BigFertPredict.csv"; private static string report = directory;
private static string modelpathBig = "C:/Users/Oskar/source/repos/PotatoPlanFinal/Game1/Content/ML/MLmodelBig"; private static string pathBig = directory;
private static string reportBig = "C:/Users/Oskar/source/repos/PotatoPlanFinal/Game1/Content/ML/report_BigModel"; private static string modelpathBig = directory;
private static string reportBig = directory;
// Loading data, creatin and saving ML model for smaller dataset (100) // Loading data, creatin and saving ML model for smaller dataset (100)
public static void CreateModel() public static void CreateModel()