Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main.py execution fails for me #9

Open
suresh-s opened this issue Jan 29, 2019 · 8 comments
Open

main.py execution fails for me #9

suresh-s opened this issue Jan 29, 2019 · 8 comments

Comments

@suresh-s
Copy link

suresh-s commented Jan 29, 2019

While running main.py, i am getting following issues, Could you help me run it?
my Python version is 3.7.0
Found that there is no demand.py file in lib folder, could you share it?

$ python main.py
Traceback (most recent call last):
File "main.py", line 3, in
from lib.Utils import *
File "/Users/sureshs/Documents/source/amod-abm/lib/Utils.py", line 13, in
from lib.OsrmEngine import *
File "/Users/sureshs/Documents/source/amod-abm/lib/OsrmEngine.py", line 13, in
from lib.Constants import *
File "/Users/sureshs/Documents/source/amod-abm/lib/Constants.py", line 5, in
from lib.Demand import *
ModuleNotFoundError: No module named 'lib.Demand'

@qcwsf
Copy link

qcwsf commented Jan 30, 2019

I also get this error. Is there anyone knowing how to fix it?

@PepSalehi
Copy link

You need to generate a file, Demand.py, where each line is a request with OD coordinates

@suresh-s
Copy link
Author

Could you share it, i will refer and generate a new file

@PepSalehi
Copy link

This was in one of the earlier versions of the code:

"""
demand matrices and volumes for a series of scenarios
"""

D_MIT = 60
M_MIT = [
( -71.086319, 42.362396, -71.103823, 42.354241, 0.1, 0.1),
( -71.093499, 42.359121, -71.118953, 42.373568, 0.1, 0.2),
( -71.101767, 42.359878, -71.085837, 42.360482, 0.1, 0.3),
( -71.089973, 42.368276, -71.102711, 42.364923, 0.1, 0.4),
( -71.104143, 42.379222, -71.090304, 42.362369, 0.1, 0.5),
( -71.102711, 42.364923, -71.093499, 42.359121, 0.1, 0.6),
( -71.103823, 42.354241, -71.089973, 42.368276, 0.1, 0.7),
( -71.118953, 42.373568, -71.086319, 42.362396, 0.1, 0.8),
( -71.090304, 42.362369, -71.101767, 42.359878, 0.1, 0.9),
( -71.102711, 42.364923, -71.104143, 42.379222, 0.1, 1.0)
]

@suresh-s
Copy link
Author

I picked one of the item ( -71.102711, 42.364923, -71.104143, 42.379222, 0.1, 1.0) in your set, what is these values "0.1" and "1.0" denotes?

@PepSalehi
Copy link

I don't know/remember. If you look at the code for class "Model", you'll see it's using D to get the total demand, and M to be the matrix of OD locations.

@suresh-s
Copy link
Author

suresh-s commented Jun 4, 2019

I can able to run the python code. But i am getting following error
File "main.py", line 66, in <module> anime = anim(frames) File "/Users/sureshs/Documents/source/amod-abm/lib/Utils.py", line 211, in anim img = mpimg.imread("map.png") File "/anaconda3/lib/python3.6/site-packages/matplotlib/image.py", line 1366, in imread with open(fname, 'rb') as fd: FileNotFoundError: [Errno 2] No such file or directory: 'map.png'

I am using "massachusetts-latest.osm.pbf" file instead of "boston_massachusetts.osm.pbf"

How can i create map.png for this "massachusetts-latest.osm.pbf" file

@Leot6
Copy link

Leot6 commented Jun 9, 2019

map.png is just a map picture (e.g. a screenshot of google map) to generate the simulation anime, in amod-abm, it is a screenshot from OpenStreetMap with the same latitude and longitude boundaries as the .osm.pbf file. I think you can download an old version (which should be a completed version) of amod-abm from https://github.com/nbailey/amod-abm to run this code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants