diff --git a/Game1/Sources/Crops/Farm.cs b/Game1/Sources/Crops/Farm.cs index a9b8ac1..a79d3f9 100644 --- a/Game1/Sources/Crops/Farm.cs +++ b/Game1/Sources/Crops/Farm.cs @@ -77,6 +77,8 @@ class Farm init(Size, housepos); RainPosition.X = r.Next(0, 1900); 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"); } @@ -214,8 +216,8 @@ class Farm private void updateRainMapPosition(Vector2 Size) { float x, y; - x = WindSpeed.X + GetRandomNumber(-1f, 1f) / 2000; - y = WindSpeed.Y + GetRandomNumber(-1f, 1f) / 2000; + x = WindSpeed.X + GetRandomNumber(-1f, 1f) / 20000; + y = WindSpeed.Y + GetRandomNumber(-1f, 1f) / 20000; if (x <= 0.02f && x >= -0.02f) { WindSpeed.X = x; diff --git a/Game1/Sources/ML/Engine.cs b/Game1/Sources/ML/Engine.cs index cb3c6ff..7d3da83 100644 --- a/Game1/Sources/ML/Engine.cs +++ b/Game1/Sources/ML/Engine.cs @@ -30,7 +30,9 @@ static class Engine Phosporous = crop.getSoilProperties().Phosphorous }; - return PredictionEngine.Predict(modelInput).Prediction; + 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 fbc1e05..ee28ac8 100644 --- a/Game1/Sources/ML_Joel/Engine.cs +++ b/Game1/Sources/ML_Joel/Engine.cs @@ -44,7 +44,9 @@ namespace Game1.Sources.ML_Joel Rainfall = soilProperties.Humidity, }; - return PredictionEngineArea.Predict(modelInput).Score; + OutputArea modelOutput = new OutputArea(); + PredictionEngineArea.Predict(modelInput, ref modelOutput); + return modelOutput.Score; } }