problem with agents moving on graph roads from shapefile

51 views
Skip to first unread message

lyuba mancheva

unread,
Feb 6, 2019, 5:58:18 AM2/6/19
to gama-p...@googlegroups.com
Hello to all!

I have a problem with agents implemented to move on a graph of roads, created from a shape file. My problem is that the agents don't move on that graph while the expected behavior is to move. I have tested the code with 3 different roads shapefiles exported with QGIS.
I have tested the same code with shape files provided from GAMA examples and it's working.
I have added here a zip file with an example of the my code and the shapefile that I am using. Maybe there is a specific procedure for exporting/creating/implementing roads shapefiles?
Thank you very much in advance
Lyuba

Test_GIS_ROADS.zip

youce...@gmail.com

unread,
Feb 7, 2019, 3:21:49 AM2/7/19
to GAMA
hi, 
I'm not sure of my answer but I think the problem comes from your shapefile.  Your example works with related graphs such as the first two graphs in your model. However, the last shapefile (in your model) gives a graph with 62 components. Therefore, it becomes impossible to calculate a path from a point a to a point b if they are not on the same related subgraph.

cheers

lyuba mancheva

unread,
Feb 7, 2019, 8:25:40 AM2/7/19
to GAMA
Hello thanks;
ok, it is possible as a solution.
I don't know how to process a row shape file of roads to be considered as one related graph so agents can calculate path on it.
Thanks
Lyuba

Chintan Pathak

unread,
Feb 8, 2019, 9:23:08 PM2/8/19
to GAMA
Don't know if it would work for your case, but the gama function `clean_network` can connect disconnected edges to create a continuous graph. Searching on the forum should bring some examples.

Thanks
Reply all
Reply to author
Forward
0 new messages