/**
 * This function calculates the soil moisture index based on the given environmental variables.
 * The soil moisture index is calculated using the formula:
 * soil_moisture = (rainfall - evaporation) / temperature
 *
 * @param temperature The temperature in degrees Celsius.
 * @param rainfall The rainfall in millimeters.
 * @param evaporation The evaporation in millimeters.
 * @return The soil moisture index.
 */
fun calculateSoilMoisture(temperature: Float, rainfall: Float, evaporation: Float): Float {

    return when {
        temperature <= 0 -> -1f
        rainfall == 0f -> 0f
        else -> (rainfall - evaporation) / temperature
    }
}
/**
 * This function calculates the soil moisture index based on the given environmental variables.
 * The soil moisture index is calculated using the formula:
 * soil_moisture = (rainfall - evaporation) / temperature
 *
 * @param temperature The temperature in degrees Celsius.
 * @param rainfall The rainfall in millimeters.
 * @param evaporation The evaporation in millimeters.
 * @return The soil moisture index.
 */
fun calculateSoilMoisture(temperature: Float, rainfall: Float, evaporation: Float): Float {
/**
 * This function calculates the soil moisture index based on the given environmental variables.
 * The soil moisture index is calculated using the formula:
 * soil_moisture = (rainfall - evaporation) / temperature
 *
 * @param temperature The temperature in degrees Celsius.
 * @param rainfall The rainfall in millimeters.
 * @param evaporation The evaporation in millimeters.
 * @return The soil moisture index.
 */
fun calculateSoilMoisture(temperature: Float, rainfall: Float, evaporation: Float): Float {

    return when {
        temperature <= 0 -> -1f
        rainfall == 0f -> 0f
        else -> (rainfall - evaporation) / temperature
    }
}