pedestrian route choice, discrete choice model

130 views
Skip to first unread message

刘亚南

unread,
Nov 22, 2019, 3:35:43 AM11/22/19
to GAMA

Dear all, I have a study about pedestrian route choice on streets with the influencing of the built environment (e.g., sidewalk width and greenery on the streets). Now, I want to simulate pedestrians' new route choice when the attributes on some roads change. From my previous discrete choice model, I have known pedestrians' preference on the attributes. I learn from the example model "Road traffic" and got that GAMA calculates the shortest path only. I'd like to ask if GAMA can work with the discrete choice model results using the utilities to choose a route? Each agent in my study has a fixed OD and fixed choice set with 7 alternative routes. The 7 alternatives for each agent include different road segments (links). I don't study the route choice at each intersection. The decision making is only about which whole route, not about the decision on each link. Could you show me some models? It would be very appreciated to get your help. Thank you very much!

Srirama Bhamidipati

unread,
Nov 23, 2019, 1:37:33 AM11/23/19
to GAMA
Dear Liu,

I notice from your registration that you are from Netherlands. I know some of your colleagues who studied GAMA, Kim S, Eleni C, may be they can help you?  Or you can send me a private mail and we can arrange a meeting. I guide some students in Netherlands, so I can have a look into your requirements and see what can be done. 

Of course, feel free to reach GAMA on this google group also.

Cheers,
Srirama

Srirama Bhamidipati

unread,
Nov 27, 2019, 5:14:54 AM11/27/19
to GAMA
Hi Liu,

As I do not hear from you, here is my answer. 

If you have estimated your logit(??) coefficients outside of GAMA, then it should be easier to assess 7 alternatives using the exponential function in GAMA. And if you want to do this assessment in the initialization of you model, then it is even less computation (during the simulation). There was a student from Wageningen I worked with on something similar (also with preference to greenery on streets) . So largely, I can say your project is feasible in GAMA. 

No there are no direct examples of "discrete choice" in GAMA. There are examples of a standard continuous outcome but not for discrete. Are you interested in binary or MNL?

Secondly, it depends on how you would like to assess the 7 alternatives. If these 7 alternatives are mutually exclusive, it can be harder to implement and also each agent may not have 7 alternatives to assess (depending on the location of the agent & characteristics of the road). So you may need some adaptation here. 

cheers,
Srirama

Parisa Zare

unread,
Aug 4, 2020, 11:48:12 PM8/4/20
to GAMA
Hi Srirama,
I am working on similar model in GAMA for cycling. 
I have seen road weight map in the traffic model and Memorize Experiment on the Follow Weighted Network model in the GAMA library.
However, none of them works in this context. 
I will have my calculation in the SHP file as a column. So there would be a column that evaluates the road based on the predefined attributes and agents should choose a road that has the highest score between its rout choices. 
I was thinking about having a loop for road species. Is that right? do you have any suggestion for this?
Cheers,
Parin

Srirama Bhamidipati

unread,
Aug 5, 2020, 3:37:29 AM8/5/20
to GAMA
Hi,

Read about "each", "max_of" , "min_of" then you do not have to loop...... but of course shortest path can give you shortest on a variable or farthest(inverse of the same variable).

Srirama

Parisa Zare

unread,
Aug 6, 2020, 9:05:29 PM8/6/20
to GAMA
Hi,
Many thanks, Srirama.
I write this code. but it is not working. do you have any suggestion?


global {
  file shape_file_destinations <- file("../includes/destinationsbuffer.shp");    
   file shape_file_road_cyc <- file("../includes/road_cyc3.shp"); 
   file shape_file_dwellings <- file ("../includes/dwellings.shp");
   file shape_file_bounds <- file("../includes/bounds.shp");
   float satisfaction_coeff<- 10.0;
   map<road, int> roads_weight;
   geometry shape <- envelope(shape_file_bounds); 
graph road_network;
init {
create building from: shape_file_dwellings;
create road from: shape_file_road_cyc with: [road_type:: string(read("Infras")), satisfacation_amount:: int(read("sati"))];
     create cyclist  {
         location <- any_location_in (one_of (building));
         the_target <- any_location_in (one_of (destinations));
         color <- #blue;
         size <- 10.0;
         satisfacation <- 0.0;
         roads_knowledge <- roads_weight;
}  
      road_network <- as_edge_graph(road);
      create destinations from: shape_file_destinations with: [destinations_type::string(read ("Destinatio"))];
}

species destinations {
   string destinations_type<-destinations_type;
   int count_of_trips;
   float total_satisfacation <- 0.0; 
   rgb destinations_color <- #gray;
   aspect destinations_view { 
      draw shape color: destinations_color;
   } 
}
species cyclist skills: [moving]{
   map<road, int> roads_knowledge;
   float satisfacation;
   path path_to_follow;
   geometry choosen_segment;
   //define node to decide
   point next_node;
   bool at_home <- false;
   int cyclist_satisfaction2;
point the_target;
float size;
rgb color;
reflex  compute_road  when: location = living_place{
bool node <- road intersects road;
if location = node {
loop nod over: node {
list<geometry> segments <- path_to_follow.segments;
cyclist_satisfaction<-int(segments(location).satisfacation_amount);
choosen_segment<- geometry(path(segment max_of cyclist_satisfaction));
}    
    }
}
reflex move when: location != the_target {
path path_to_follow <- goto (target: the_target, on:choosen_segment, return_path:true);
aspect default {
draw circle (size) color:color;
}
}

species building {
aspect default {
draw shape color: #gray;
}
}

//Species to represent the roads
species road {
string road_type;
   float satisfacation_amount;
    bool cyclist_satisfaction;
rgb road_color <- #black;
aspect default {
draw (shape) color: road_color;
}

experiment traffic type: gui {
output {
display carte type: opengl{
species building refresh: false;
species road ;
species destinations aspect: destinations_view; 
species cyclist;
}  
}
}


Srirama Bhamidipati

unread,
Aug 7, 2020, 5:09:32 AM8/7/20
to GAMA
Hmm, what is road intersects road? a line will always intersect itself. Your cyclist does not know anything about the road. I think there is something wrong conceptually that is why it is not working.
If sati is already in the shapefile and if you wish to get shortest path between A and B, that gives max sati(sfaction), you must add weights to your graph, where weight is inverse of satisfaction.
There is an example in tutorials on how to add weights to a graph.

Or was this not your question? 

Srirama 

Srirama Bhamidipati

unread,
Aug 7, 2020, 5:15:24 AM8/7/20
to GAMA
Here is a thesis with a student on gama + bicycle. this link

Parisa Zare

unread,
Aug 9, 2020, 10:43:36 PM8/9/20
to GAMA

Hi Srirama,
I thought that I should calculate satisfaction for each segment. and cyclist should decide their route based on the satisfaction of each segment. So I try to define the intersection points. AT each intersection they decide that wich road has the most satisfaction and they choose that. 
As you mentioned this is not a proper way.
I read the thesis you mentioned. 
I wrote this code based on the thesis method. However, I am not sure that it is right or not. I define satisfaction_amount based on road type and try to shorten the path based on the satisfaction amount.
It would be great if you can advise.
here is the code

..
...
.....
init {
create road from: shape_file_road_cyc with: [road_type:: string(read("Infras")), satisfacation_amount:: int(read("sati"))];
roads_weight <- road as_map (each::(each.shape.perimeter)- cyclist_satisfaction*(each.shape.perimeter*(1/each.satisfacation_amount)));
create building from: shape_file_dwellings;
....
...
..
reflex move when: not is_arrived{
path the_path <- goto (target: target, on: road_network , move_weights:roads_weight,  return_path: true);
...
..
.

Srirama Bhamidipati

unread,
Aug 11, 2020, 3:46:51 AM8/11/20
to GAMA
Hi 

This is broadly similar to the thesis I mentioned with the student i worked with. However, what you ask for doesnt sound logical. Is the cyclist on a leisure trip? else cyclist should have a predefined destination, choosing a route at every intersection sounds odd. You may still do it but you have to limit the choice such that cyclist reaches the "predefined" destination. If a cyclist has always to maximize the satisfaction to destination, it would not be different from the shortest path, even if you make a decision at every intersection. 

First and foremost you have decide the purpose of the trip. If it is not leisure, high chances are to maximize "one" attribute. You may argue that agent is not always rational, so you can randomly select one of the top n shortest paths. Hint: look at paths_between in gama.
Second choice is to have a higher objective to reach a destination, and at a lower level objective of randomly choosing paths at each intersection that would still lead to the destination. In this case, at each intersection you recompute the shortest path enroute to the destination and randomly select one of them. However this will lead to lot of computation and slow down your model.

Srirama 

Reply all
Reply to author
Forward
0 new messages