Giter VIP home page Giter VIP logo

flee's People

Contributors

alirezajahani60 avatar arabnejad avatar arindamsaha1507 avatar botanihilator avatar cspgdds avatar cvanhille avatar djgroen avatar imahmood786 avatar lauraharbach avatar lgtm-migrator avatar marshhawk4 avatar mattprintz avatar mzrghorbani avatar s-moncalvillo avatar tdolor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flee's Issues

Module not found error: No module named 'flee', installing Flee in ubuntu

Hi, please excuse me, this is probably a very basic question.
I am installing Flee in Ubuntu 22.10 for testing purposes. It is a VirtualBox VM. I created and activated a virtualenv for this installation. I followed the steps of installing/testing flee. But in the last step I got this error:

$ python3 tests/test_csv.py
Traceback (most recent call last):
File "...flee/tests/test_csv.py", line 4, in
import flee.postprocessing.analysis as a
ModuleNotFoundError: No module named 'flee'

Thank you,

Yonny

Missing libraries

I noticed the following libraries have been removed from ssudan_mscalecity.py.

  • outputanalysis.analysis
  • analyze_graph

Removing the latter one is alright, because it is for debugging,
but what about outputanalysis.analysis? It is used for output files.

remove_forced_redirection implementation

An automated version of Burundi (2015) conflict has a forced redirection which was removed after certain days: https://github.com/djgroen/FabFlee/blob/master/config_files/burundi/input_csv/closures.csv

Currently, it is added in the closures.csv file but not implemented in the Flee code.

For reference, hard-coded version of Burundi run.py file
https://github.com/djgroen/FabFlee/blob/57dbca6ceeccd72bc6adb8d2375cc310fe0bca2a/config_files/validation/SWEEP/oldstyle_burundi/run.py#L173

Fix capacities bug

Camp capacities appear to not be correctly enforced in FLEE. Determine why this is, and solve the issue.

The population of conflict zones in location.csv doesn't affect the results (mscale)

During test executions with test input files of ssudan-mscale-test, I forgot to change the population from the original number to the test number and when I found that I realized that the population of conflict zones in location.csv hasn't affected the results before and after the correction the population. I wonder why this happens and how the population shouldn't affect the results?

Move conflict zone code into core libraries

The management of conflict zones, changing move chances and calculating move probabilities are now in the python scripts. We should create shorthands for this in the FLEE libraries.

'Camps' for suspectFLEE

When does a suspect stop traveling? This should work slightly differently for a 'suspect-agent' than for a forced migration agent.

On their way, a suspect may encounter multiple POIs ( at which they may stop (parking garage, etc). At each of these, the suspect stops traveling with a certain probability attributed to the POI.

input files missing for ssudan_mscalecity

Hi Ali.

I made some progress, and after fixing a few bugs I get a missing input file.

I run python3 ssudan_mscalecity 0, which then gives me the following error:

FileNotFoundError -> examples/ssudan_input_files/conflict_period.csv

Could you please upload this file and any other missing input files to the GitHub repo in your branch?

Refine 2.0 ruleset implementation

I am currently finalizing the ruleset 2.0 implementation. In it I will enable a mode that approximates the behavior of the original ruleset.

I already fixed one bug, where the setting to start on foot could not be disabled.

In this ticket I just want to remind myself to also look at the changed calculateLinkWeight(). It may be that the logic is subtly different here in the new version...

Update technical documentation of the use cases

Regarding technical documentation, I noticed when I was very new in using flee as a novice user, there is some complicated or incomplete documentation. For instance, the recent issue I noticed is about multiscale modelling and data preparation for it. I think we need completely guide users on how to do that.

Add YYYY-MM-DD column to out.csv

It is now requested by two collaborators to include actual dates (YYYY-MM-DD or DD-MM-YYYY) in out.csv instead of simulation days.

Would you be able to include an additional column with actual dates to out.csv?

Having more input files in Flee tutorials

The current version of Flee tutorial documents hasn't updated and reflected the new input files for simulations. Here is the new structure of input files which will be added to the tutorial:

  • source_data (directory)

    • data_layout.csv
    • refugees.csv
    • country_name-camp_name.csv
  • closures.csv

  • conflict_period.csv

  • conflicts.csv

  • coupled_locations.csv (for multiscale and coupled simulations)

  • locations.csv

  • registration_corrections.csv

  • routes.csv

Besides, it is worth to add that for coupled multiscale simulations, there is a need to have two files for the above input files reflecting macro and micro models inputs.

Issues with log levels in flee.py (i.e. camp, init, conflict) when set to 1 in simsetting.yml (FabFlee).

  1. Camp or camp?
Traceback (most recent call last):
  File "/home/csstdds/Codes/flee/runscripts/run_par.py", line 78, in <module>
    e.evolve()
  File "/home/csstdds/Codes/flee/flee/pflee.py", line 21, in wrapper
    return func(*args, **kwargs)
  File "/home/csstdds/Codes/flee/flee/pflee.py", line 621, in evolve
    a.finish_travel(time=self.time)
  File "/home/csstdds/Codes/flee/flee/pflee.py", line 21, in wrapper
    return func(*args, **kwargs)
  File "/home/csstdds/Codes/flee/flee/pflee.py", line 104, in finish_travel
    super().finish_travel(time=time)
  File "/home/csstdds/Codes/flee/flee/flee.py", line 184, in finish_travel
    if self.location.Camp is True:
AttributeError: 'Location' object has no attribute 'Camp'. Did you mean: 'camp'?

Solution: flee.py
line 184: if self.location.Camp is True: change to lower letter c -> if self.location.camp is True:
line 516: if loc.Camp is True: change to lower letter c -> if loc.camp is True:

  1. Set all log levels to 1 and out.csv has inconsistencies at the start (see attachment).
    out.csv

pip3 install flee

Low priority:

Enable this functionality, and expose a Flee API for easy external usage.

Add link-dependent maxmovespeeds

Add a link attribute that determines max move speeds for agents on that link.

There is a possible complication in determining how distancemovedthisturn needs to be interpreted in this context.

Enable toggle between parallel/serial mode for ssudan_mscalcity

The serial mode (using micro_flee instead of pmicro_flee) is essential because:

  • It is easier to debug.
  • It can be run with those that do not have MPI4Py set up.

Could you please add in an argument to the ssudan_mscalecity.py script that allows on to switch between these modes?

Also, perhaps rename the script, as the "mscalecity" part seems inappropriate to me, given that we are modelling a region/country?

Add support for multihop travel at higher awareness levels

Idea is to use a movestring array of location IDs (or names), and to have agents skip route choice decisions while this array is non-zero. An element is removed from the array whenever a location is visited.

The array will be erased whenever a location in the movestring can no longer be chosen for any reason.

This feature should be triggered automatically when awareness level is higher than 1.

plot_output works on remotely mounted results, not the local copy (!)

When I type:
fab localhost plot_output:mali_localhost_16,output_dir=tmp/

The plotting script operates on ~/FabSim3/results, which is not the local copy, but the staged one (the local one in my case is ~/Codes/FabSim3/results). This will cause this script to do processing in an unusual location and, moreover, to fail if anyone uses it on a run that is not done on localhost.

Error with population of conflict_zones

I am using Python 3.7.2 in PyCharm and applying the code to Turkey. Screenshots of my input files and error are attached.

The tutorial says to run the code using this command: python3 <country_name>.py <simulation_period> > out<country_name>/out.csv

But I can only get the code to run specifying the system arguments using this command: python3 Turkey.py Turkey/input_csv Turkey/source_data 10 2019-01-31 outTurkey/output.csv

I am getting this error:

Traceback (most recent call last): File "C:/Users/mrich/Downloads/FLEE/Turkey.py", line 92, in <module> e.add_agents_to_conflict_zones(new_refs) File "C:\Users\mrich\Downloads\FLEE\flee\flee.py", line 845, in add_agents_to_conflict_zones cl = self.pick_conflict_locations(number) File "C:\Users\mrich\Downloads\FLEE\flee\flee.py", line 839, in pick_conflict_locations return np.random.choice(self.conflict_zones, number, p=self.conflict_weights / self.conflict_pop) File "mtrand.pyx", line 1125, in mtrand.RandomState.choice ValueError: 'a' cannot be empty unless no samples are taken

It seems as though the 'population' and 'capacity' may be getting mixed up, though there is no mention of 'capacity' in the tutorial for loading data.

In camps, the 'capacity' becomes the population that is read in and the 'population' is 0. Example in error:

Location name: Apaydin, X: 36.235, Y: 36.352, movechance: 0.001, cap: 4390, pop: 0, country: Turkey, conflict? False, camp? True Location name: Ceylanpinar, X: 36.814, Y: 39.924, movechance: 0.001, cap: 21176, pop: 0, country: Turkey, conflict? False, camp? True Location name: Harran Kokenli, X: 36.873, Y: 38.932, movechance: 0.001, cap: 13761, pop: 0, country: Turkey, conflict? False, camp? True

In towns, the 'capacity' is -1 and the 'population' is also 0. Example in error:

Location name: Diyarbakir, X: 37.925631, Y: 40.210571, movechance: 0.3, cap: -1, pop: 0, country: Turkey, conflict? False, camp? False Location name: Batman, X: 37.889964, Y: 41.130106, movechance: 0.3, cap: -1, pop: 0, country: Turkey, conflict? False, camp? False Location name: Van, X: 38.500085, Y: 43.374066, movechance: 0.3, cap: -1, pop: 0, country: Turkey, conflict? False, camp? False

There is no error print-out for conflizt_zones but I suspect that the 'population' may also be interpreted as the 'capacity?'

I have debugged my input data as far as I can and still cannot get the code to run without throwing this error.

plot_output issue with latest version of pandas

there is an issue with the latest version of pandas=1.0.1

with version pandas = 0.25.0 there is no problem
it seems in the new version, DataFrame object has no attribute as_matrix
we need to investigate this issue and maybe other issues related to pandas library to make sure that flee will work with latest version

$ fab localhost plot_output:mali_localhost_16,out
Traceback (most recent call last):
  File "/home/hamid/BUL/flee/plot-flee-output.py", line 410, in <module>
    :, ["refugees in camps (simulation)"]].as_matrix().flatten()
  File "/home/hamid/.local/lib/python3.7/site-packages/pandas/core/generic.py", line 5274, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'as_matrix'

Fatal error: local() encountered an error (return code 1) while executing 'python3 ~/BUL/flee/plot-flee-output.py /home/hamid/BUL/FabSim3/results/mali_localhost_16 /home/hamid/BUL/FabSim3/results/mali_localhost_16/out'

Make a doc page for simsetting.yml

It's largely documented in SimulationSettings.py, but that's not a useful page. Perhaps we should have a ReadTheDocs page for it?

@cspgdds would you have time to make such a page?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.