Compare commits
3 Commits
faa5d7ca4b
...
9ce5765192
Author | SHA1 | Date | |
---|---|---|---|
9ce5765192 | |||
f37ec6d03f | |||
12d5bdc738 |
@ -488,6 +488,8 @@ void dijkstra_solver_free(struct dijkstra_solver *solver)
|
||||
for (l = solver->net_metas; l != NULL; l = l->next) {
|
||||
net_meta = (struct dijkstra_net_meta*) l->data;
|
||||
free(net_meta->name);
|
||||
if (net_meta->access)
|
||||
free(net_meta->access);
|
||||
free(net_meta);
|
||||
}
|
||||
}
|
||||
@ -549,7 +551,10 @@ struct dijkstra_net_meta *dijkstra_net_meta_new(enum dijkstra_net_type net_type,
|
||||
if (net_meta) {
|
||||
net_meta->type = net_type;
|
||||
net_meta->name = strdup(name);
|
||||
net_meta->access = access;
|
||||
if (access)
|
||||
net_meta->access = strdup(access);
|
||||
else
|
||||
net_meta->access = NULL;
|
||||
}
|
||||
|
||||
return net_meta;
|
||||
@ -568,7 +573,9 @@ struct dijkstra_net_meta *dijkstra_net_meta_new_to_list(struct dijkstra_solver *
|
||||
|
||||
for (l = solver->net_metas; l != NULL; l = l->next) {
|
||||
net_meta = l->data;
|
||||
if (net_meta->type == net_type && !strcmp(net_meta->name, name)) {
|
||||
if (net_meta->type == net_type &&
|
||||
!strcmp(net_meta->name, name) &&
|
||||
(net_meta->access && (!strcmp(net_meta->access, access)))) {
|
||||
return net_meta;
|
||||
}
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ int add_geojson_to_dijkstra(struct dijkstra_solver *solver,
|
||||
z_last = 1000; // By default, let's assume 10x normal speed
|
||||
break;
|
||||
case ACCESS:
|
||||
z_last = 10; // By default, let's introduce a penalty to get on the train (ACCESS walk 10x slower)
|
||||
z_last = 99; // TODO: By default, let's introduce a penalty to get on the train (ACCESS walk 10x slower)
|
||||
break;
|
||||
default:
|
||||
z_last = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user