Introduce a penalty for entering / leaving the train

Done by upping the cost for walking on an access layer.
wip/bound-for
Markus Koch 2021-02-26 19:33:21 +01:00
parent aa7256c12e
commit faa5d7ca4b
2 changed files with 6 additions and 2 deletions

View File

@ -175,7 +175,8 @@ dijkstra_cost dijkstra_get_weight_from_distance(struct dijkstra_node *node_a,
float scale;
switch (net_type) {
case TRAINLINE:
case TRAINLINE: // Trainlines and access types use the z-coordinate
case ACCESS: // for cost scaling.
scale = (float)node_a->position.z;
scale += (float)node_b->position.z;
scale /= 200;

View File

@ -102,7 +102,10 @@ int add_geojson_to_dijkstra(struct dijkstra_solver *solver,
z_last = 0; // By default, let's assume height 0
break;
case TRAINLINE:
z_last = 1000; // By default, let's assume 5x normal speed
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)
break;
default:
z_last = -1;