Пример #1
0
    # Burkina Faso

    b1 = e.addLocation("Mentao", movechance=0.0)
    # GPS 13.999700 -1.680371
    b2 = e.addLocation("Bobo-Dioulasso", movechance=0.0)
    # GPS 11.178103 -4.291773

    # No linking up yet, as BF border was shut prior to March 21st 2012.

    # Niger
    n1 = e.addLocation("Abala", movechance=0.0)
    # GPS 14.927683 3.433727
    n2 = e.addLocation("Mangaize", movechance=0.0)
    # GPS 14.684030 1.882720

    d = handle_refugee_data.DataTable("mali2012/refugees.csv",
                                      csvformat="mali-portal")

    for t in xrange(0, end_time):

        # Close/open borders here.
        if (
                t == 22
        ):  #On the 21st of March, Burkina Faso opens its borders (see PDF report 3).
            linkBF(e)
        if (
                t == 31
        ):  #Starting from April, refugees appear to enter Niger again (on foot, report 4).
            linkNiger(e)

        new_refs = d.get_new_refugees(t)
        for i in xrange(0, new_refs):
Пример #2
0
    n1 = e.addLocation("Abala", movechance=0.001, capacity=18573, foreign=True)
    # GPS 14.927683 3.433727
    n2 = e.addLocation("Mangaize",
                       movechance=0.001,
                       capacity=4356,
                       foreign=True)
    # GPS 14.684030 1.882720
    n3 = e.addLocation("Niamey", movechance=0.001, capacity=6327, foreign=True)

    n4 = e.addLocation("Tabareybarey",
                       movechance=0.001,
                       capacity=9189,
                       foreign=True)
    # GPS 14.754761 0.944773

    d = handle_refugee_data.DataTable(csvformat="generic",
                                      data_directory="mali2012/")

    print(
        "Day,Mbera sim,Mbera data,Mbera error,Fassala sim,Fassala data,Fassala error,Mentao sim,Mentao data,Mentao error,Bobo-Dioulasso sim,Bobo-Dioulasso data,Bobo-Dioulasso error,Abala sim,Abala data,Abala error,Mangaize sim,Mangaize data,Mangaize error,Niamey sim,Niamey data,Niamey error,Tabareybarey sim,Tabareybarey data,Tabareybarey error,Total error,refugees in camps (UNHCR),refugees in camps (simulation),raw UNHCR refugee count"
    )

    # Kidal has fallen. All refugees want to leave this place.
    o1.movechance = 1.0

    # Set up a mechanism to incorporate temporary decreases in refugees
    refugee_debt = 0
    refugees_raw = 0  #raw (interpolated) data from TOTAL UNHCR refugee count only.

    # Add initial refugees to the destinations.
    AddInitialRefugees(e, d, m1)
    AddInitialRefugees(e, d, m2)
Пример #3
0
    l1 = e.addLocation("Bamako", movechance=0.3)

    # Mauritania

    # Burkina Faso

    # Niger
    l2 = e.addLocation("Kiffa", movechance=0.0)
    l3 = e.addLocation("Niamey", movechance=0.0)
    l4 = e.addLocation("Bobo-Dioulasso", movechance=0.0)

    e.linkUp("Bamako", "Kiffa", "834.0")
    e.linkUp("Bamako", "Niamey", "1368.0")
    e.linkUp("Bamako", "Bobo-Dioulasso", "536.0")

    d = handle_refugee_data.DataTable("source-data-unhcr.txt",
                                      csvformat="mali-pdf")

    for t in range(0, end_time):
        new_refs = d.get_new_refugees(t)
        for i in range(0, new_refs):
            e.addAgent(location=l1)
        e.evolve()
        #    e.printInfo()
        print t
        l2_data = d.get_field("Mauritania", t) - d.get_field("Mauritania", 0)
        l3_data = d.get_field("Niger", t) - d.get_field("Niger", 0)
        l4_data = d.get_field("Burkina Faso", t) - d.get_field(
            "Burkina Faso", 0)

        errors = [
            a.rel_error(l2.numAgents, l2_data),