From 2e96d5a2d57daa4f06abbdf2c1aae3d0387e6a0e Mon Sep 17 00:00:00 2001 From: BOTLester <58360400+BOTLester@users.noreply.github.com> Date: Sun, 14 Jun 2020 18:01:51 +0200 Subject: [PATCH] fixes --- Game1/Sources/Crops/Farm.cs | 4 ++-- Game1/Sources/ML/Engine.cs | 3 ++- Game1/Sources/ML_Joel/Engine.cs | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Game1/Sources/Crops/Farm.cs b/Game1/Sources/Crops/Farm.cs index e3d7dbd..6e8f4d5 100644 --- a/Game1/Sources/Crops/Farm.cs +++ b/Game1/Sources/Crops/Farm.cs @@ -79,8 +79,8 @@ class Farm RainPosition.Y = r.Next(0, 1950); WindSpeed.X = GetRandomNumber(-1f, 1f) / 500; WindSpeed.Y = GetRandomNumber(-1f, 1f) / 500; - RainfallMap = PerlinNoise.LoadImage("C:\\Users\\Joel\\source\\repos\\Oskars Repo\\Game1\\Content\\Rainfall.png"); - //RainfallMap = PerlinNoise.LoadImage("C:/Users/oel/source/repos/Oscars Repo/Game1/Content/Rainfall.png"); + //RainfallMap = PerlinNoise.LoadImage("C:\\Users\\Joel\\source\\repos\\Oskars Repo\\Game1\\Content\\Rainfall.png"); + RainfallMap = PerlinNoise.LoadImage("C:/Users/Oskar/source/repos/PotatoPlanFinal/Game1/Content/Rainfall.png"); } public Rectangle getRainPosition(int TileSize, int x, int y, Vector2 Size) diff --git a/Game1/Sources/ML/Engine.cs b/Game1/Sources/ML/Engine.cs index 7d3da83..4ecb117 100644 --- a/Game1/Sources/ML/Engine.cs +++ b/Game1/Sources/ML/Engine.cs @@ -10,6 +10,7 @@ static class Engine { private static MLContext mlContext = new MLContext(seed: 1); private static PredictionEngine PredictionEngine; + private static ModelOutput modelOutput; public static void init() { @@ -30,7 +31,7 @@ static class Engine Phosporous = crop.getSoilProperties().Phosphorous }; - ModelOutput modelOutput = new ModelOutput(); + //ModelOutput modelOutput = new ModelOutput(); PredictionEngine.Predict(modelInput, ref modelOutput); return modelOutput.Prediction; } diff --git a/Game1/Sources/ML_Joel/Engine.cs b/Game1/Sources/ML_Joel/Engine.cs index 08f1ba9..7b37e22 100644 --- a/Game1/Sources/ML_Joel/Engine.cs +++ b/Game1/Sources/ML_Joel/Engine.cs @@ -13,6 +13,7 @@ namespace Game1.Sources.ML_Joel private static MLContext mlContext = new MLContext(seed: 1); private static PredictionEngine PredictionEngine; private static PredictionEngine PredictionEngineArea; + private static OutputArea modelOutput; public static void CreateModel() @@ -44,7 +45,7 @@ namespace Game1.Sources.ML_Joel Rainfall = soilProperties.prevRainfall, }; - OutputArea modelOutput = new OutputArea(); + //OutputArea modelOutput = new OutputArea(); PredictionEngineArea.Predict(modelInput, ref modelOutput); return modelOutput.Score; }