forked from s425077/PotatoPlan
38 lines
893 B
C#
38 lines
893 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
class SoilProperties
|
|
{
|
|
static Random r = new Random();
|
|
|
|
|
|
public string soilType = "potato";
|
|
public float Temperature;
|
|
public float Humidity;
|
|
public float Moisture;
|
|
public float Nitrogen;
|
|
public float Potassium;
|
|
public float Phosphorous;
|
|
|
|
public void setSoilProperties()
|
|
{
|
|
Temperature = GetRandomNumber(22, 30);
|
|
Humidity = Temperature * GetRandomNumber(1.9, 2.1);
|
|
Moisture = GetRandomNumber(20, 70);
|
|
Nitrogen = GetRandomNumber(4 , 55);
|
|
Potassium = GetRandomNumber(0, 28);
|
|
Phosphorous = GetRandomNumber(0, 60);
|
|
}
|
|
|
|
public float GetRandomNumber(double minimum, double maximum)
|
|
{
|
|
return (float)(Math.Round(r.NextDouble() * (maximum - minimum) + minimum, 2));
|
|
}
|
|
}
|
|
|
|
|