Esempio n. 1
0
def main():
    testfarm = Farm((0, 0))
    senone = Sensor((44.790300, -92.931998))
    sentwo = Sensor((44.790300, -92.931998))
    senthree = Sensor((44.790300, -92.931998))

    testfarm.add_sensor(senone)
    testfarm.add_sensor(sentwo)
    testfarm.add_sensor(senthree)

    testfarm.pull_current()
    testfarm.pull_forecast()

    print("\n\n\nRandomized Example Sensor Data")
    print("------------------------------")

    i = 0
    while i < len(testfarm.sensors):
        print("sensor " + str(i + 1))
        print(testfarm.sensors[i].point)
        i += 1

    print("\n\n\nExample Aggregate Scores")
    print("------------------------")

    box = score.score(testfarm, senone.point, senone)

    list = []
    for datapoints in testfarm.future_forecast:
        box = score.aggregateScore(testfarm, datapoints, senone)
        list.append(box)

    print(list)
Esempio n. 2
0
def main():
    testfarm = Farm((0, 0))
    senone = Sensor((44.790300, -92.931998))
    sentwo = Sensor((44.790300, -92.931998))
    senthree = Sensor((44.790300, -92.931998))

    testfarm.add_sensor(senone)
    testfarm.add_sensor(sentwo)
    testfarm.add_sensor(senthree)

    testfarm.pull_current()
    testfarm.pull_forecast()

    print(testfarm.future_forecast)

    #prints out some random weather data from sensors
    """
    i = 0
    while i < len(testfarm.sensors):
        print(testfarm.sensors[i].point)
        i += 1
    """

    returnlist = score.ranker(testfarm, testfarm.sensors[1])

    print(returnlist)
Esempio n. 3
0
def main():
    lat = float(sys.argv[1])
    lon = float(sys.argv[2])

    testfarm = Farm((lat, lon))
    senone = Sensor((44.790300, -92.931998))
    sentwo = Sensor((44.790300, -92.931998))
    senthree = Sensor((44.790300, -92.931998))

    senone.add_water((44.790302, -92.931994))
    sentwo.add_water((44.790302, -92.931994))
    senthree.add_water((44.790302, -92.931994))

    testfarm.add_sensor(senone)
    testfarm.add_sensor(sentwo)
    testfarm.add_sensor(senthree)

    testfarm.pull_current()
    testfarm.pull_forecast()

    box = score.score(testfarm, senone.point, senone)

    print(score)
    print(score.responsetext(box))