forked from s425077/PotatoPlan
fixed map generation
This commit is contained in:
parent
5424c2c66a
commit
e868578f9b
@ -47,7 +47,7 @@ class Crops
|
|||||||
|
|
||||||
public float getSpeedFactor(float tractorSpeed)
|
public float getSpeedFactor(float tractorSpeed)
|
||||||
{
|
{
|
||||||
return 1f / getCostOnMovement();
|
return (1f * tractorSpeed) / getCostOnMovement();
|
||||||
}
|
}
|
||||||
|
|
||||||
public SoilProperties getSoilProperties()
|
public SoilProperties getSoilProperties()
|
||||||
|
@ -21,6 +21,7 @@ class Farm
|
|||||||
PresetCrops.init();
|
PresetCrops.init();
|
||||||
r = new Random();
|
r = new Random();
|
||||||
crops = new Crops[100, 100];
|
crops = new Crops[100, 100];
|
||||||
|
int dirtCount = 0;
|
||||||
for (int i = 0; i < 99; i++)
|
for (int i = 0; i < 99; i++)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < 99; j++)
|
for (int j = 0; j < 99; j++)
|
||||||
@ -40,20 +41,22 @@ class Farm
|
|||||||
x = r.Next(0, 12);
|
x = r.Next(0, 12);
|
||||||
crops[i, j].setCropType(x, PresetCrops.getPresetCropTypes(x));
|
crops[i, j].setCropType(x, PresetCrops.getPresetCropTypes(x));
|
||||||
crops[i, j].init();
|
crops[i, j].init();
|
||||||
|
|
||||||
|
if (crops[i, j].getStatus() == 2)
|
||||||
|
{
|
||||||
|
dirtCount++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
int dirtCount = 0;
|
|
||||||
for (int i = 0; i < 99; i++)
|
for (int i = 0; i < 99; i++)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < 99; j++)
|
for (int j = 0; j < 99; j++)
|
||||||
{
|
{
|
||||||
if (crops[i, j].getStatus() == 2)
|
if (crops[i, j].getStatus() == 2)
|
||||||
{
|
{
|
||||||
dirtCount++;
|
|
||||||
if (!astar.isReachable(crops, new Vector2((int)i, (int)j), housepos))
|
if (!astar.isReachable(crops, new Vector2((int)i, (int)j), housepos))
|
||||||
{
|
{
|
||||||
crops[i, j].setStatus(1);
|
//crops[i, j].setStatus(1);
|
||||||
dirtCount--;
|
dirtCount--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -61,7 +64,6 @@ class Farm
|
|||||||
}
|
}
|
||||||
if (dirtCount == 0)
|
if (dirtCount == 0)
|
||||||
init(Size, housepos);
|
init(Size, housepos);
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateFarm(Vector2 Size)
|
public void updateFarm(Vector2 Size)
|
||||||
|
@ -11,12 +11,12 @@ 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 path = "C:/Users/Joel/source/repos/Oskars Repo/Game1/Content/ML/Fertilizer_Prediction.csv";
|
||||||
private static string modelpath = "C:/Users/Oskar/source/repos/PotatoPlanFinal/Game1/Content/ML/MLmodel";
|
private static string modelpath = "C:/Users/Joel/source/repos/Oskars Repo/Game1/Content/ML/MLmodel";
|
||||||
private static string report = "C:/Users/Oskar/source/repos/PotatoPlanFinal/Game1/Content/ML/report";
|
private static string report = "C:/Users/Joel/source/repos/Oskars Repo/Game1/Content/ML/report";
|
||||||
private static string pathBig = "C:/Users/Oskar/source/repos/PotatoPlanFinal/Game1/Content/ML/BigFertPredict.csv";
|
private static string pathBig = "C:/Users/Joel/source/repos/Oskars Repo/Game1/Content/ML/BigFertPredict.csv";
|
||||||
private static string modelpathBig = "C:/Users/Oskar/source/repos/PotatoPlanFinal/Game1/Content/ML/MLmodelBig";
|
private static string modelpathBig = "C:/Users/Joel/source/repos/Oskars Repo/Game1/Content/ML/MLmodelBig";
|
||||||
private static string reportBig = "C:/Users/Oskar/source/repos/PotatoPlanFinal/Game1/Content/ML/report_BigModel";
|
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)
|
// Loading data, creatin and saving ML model for smaller dataset (100)
|
||||||
public static void CreateModel()
|
public static void CreateModel()
|
||||||
|
Loading…
Reference in New Issue
Block a user