1
0
forked from s425077/PotatoPlan

fixed everything

This commit is contained in:
Joel 2020-05-25 11:07:58 +02:00
parent 090a612660
commit 8b115ec1f5
3 changed files with 10 additions and 4 deletions

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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;
}
}