Strange results

This commit is contained in:
Joel 2020-05-10 16:00:39 +02:00
parent aee7262c45
commit e2f903eb8c
3 changed files with 29 additions and 8 deletions

View File

@ -69,7 +69,7 @@ namespace Game1
//Generates the map with some random values
inventory.initInventorySystem();
input.init(graphics, new Vector2(16,16), 56, 1); //Generates the starting size
input.init(graphics, new Vector2(16,16), 56, 10); //Generates the starting size
houseUnit.init(input.getTileSize(), input.getSpacing()); //Generates the house position
tractorUnit.init(houseUnit.GetRectangle(), input); //Generates the Tractor
tractorUnit.updateSizing(input, 0, houseUnit.getVector(), Time); //Updates the first Size of the Tractor

View File

@ -11,12 +11,12 @@ 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 path = "C:/Users/Joel/source/repos/Oskars Repo/Game1/Content/ML/Fertilizer_Prediction.csv";
private static string modelpath = "C:/Users/Joel/source/repos/Oskars Repo/Game1/Content/ML/MLmodel";
private static string report = "C:/Users/Joel/source/repos/Oskars Repo/Game1/Content/ML/report";
private static string pathBig = "C:/Users/Joel/source/repos/Oskars Repo/Game1/Content/ML/BigFertPredict.csv";
private static string modelpathBig = "C:/Users/Joel/source/repos/Oskars Repo/Game1/Content/ML/MLmodelBig";
private static string reportBig = "C:/Users/Joel/source/repos/Oskars Repo/Game1/Content/ML/report_BigModel";
// Loading data, creatin and saving ML model for smaller dataset (100)
public static void CreateModel()

View File

@ -9,7 +9,9 @@ class Tractor
private Path path = new Path();
private SmartTractor smartTractor = new SmartTractor();
private HandleRotation handleRotation = new HandleRotation();
private int j = 60;
private int WaitFrame = 30;
private int j;
public void updateSizing(Input input, int Status, Vector2 newHousePos, DayNightCycle Time)
@ -63,10 +65,29 @@ class Tractor
public void updatePosition(Vector2 Size, int Status) // updates the position
{
//farm.updateSize(Size, sizeTile, Spacing);
for (int i = 0; i < Speed; i++)
{
updateDirection(Size, Position);
/*
if (!smartTractor.getWaitTwoFrames())
{
updateDirection(Size, Position);
j = WaitFrame;
}
else if (j != 0)
{
j--;
}
else
{
smartTractor.setWaitTwoFrames(false);
}*/
}
}