also apply some of the new lane choice penalties to CH pathfinding for #217. this is necessary, because we wont opportunistically LC around an uber turn. validated near montlake/520.

also bring in fresh osm with some south seattle fixes... [rebuild]
This commit is contained in:
Dustin Carlino 2020-07-23 14:42:20 -07:00
parent dd3f3d14ab
commit 61b5441bd8
7 changed files with 69 additions and 50 deletions

View File

@ -5,58 +5,58 @@ data/input/berlin/planning_areas.bin,f1a3bd5118a0e4982b64c2307e01d82a,https://ww
data/input/berlin/planning_areas.kml,1bfc2044f1f5f40acdcdded1a644ad22,https://www.dropbox.com/s/9bvbshrtjw14tm7/planning_areas.kml.zip?dl=0
data/input/krakow/osm/huge_krakow.osm,b914bbcd42a7f769a40a90970cea35f2,https://www.dropbox.com/s/bhh14m5mxh2r4l1/huge_krakow.osm.zip?dl=0
data/input/krakow/osm/malopolskie-latest.osm.pbf,9505917bbacc478177e36605e89b6d77,https://www.dropbox.com/s/vehjfvwx25v1qnd/malopolskie-latest.osm.pbf.zip?dl=0
data/input/raw_maps/ballard.bin,87d54618474b5f22fa204e673ad04fa1,https://www.dropbox.com/s/599i1bfzotzf263/ballard.bin.zip?dl=0
data/input/raw_maps/ballard.bin,349209688009473a2462a9ba5e4240c6,https://www.dropbox.com/s/w0ed5objvj8zw4v/ballard.bin.zip?dl=0
data/input/raw_maps/berlin_center.bin,c4f9d049524392de6abd67b8e51b8fd6,https://www.dropbox.com/s/6nhilernsjc76a9/berlin_center.bin.zip?dl=0
data/input/raw_maps/downtown.bin,7edba9969a9f450cbb28b2abdc4c4f3e,https://www.dropbox.com/s/4u7waaeg96zh4fn/downtown.bin.zip?dl=0
data/input/raw_maps/downtown.bin,07c2d1031c298585e2972f171de5e2c3,https://www.dropbox.com/s/9u7l7rj2qg9vxr6/downtown.bin.zip?dl=0
data/input/raw_maps/huge_krakow.bin,abfbde38697aeabc3660777255b433f6,https://www.dropbox.com/s/eal8yq2shb5wlwv/huge_krakow.bin.zip?dl=0
data/input/raw_maps/huge_seattle.bin,6247a3a5194ce528cffee61dc5975823,https://www.dropbox.com/s/pnh7m038prelb36/huge_seattle.bin.zip?dl=0
data/input/raw_maps/lakeslice.bin,eee024bfdb8233dee81a93cb0b10fe3e,https://www.dropbox.com/s/euoc1jmndx0to26/lakeslice.bin.zip?dl=0
data/input/raw_maps/huge_seattle.bin,2ed7f16153c565120706fd8525dc708f,https://www.dropbox.com/s/yw0zlnwzr1nekvx/huge_seattle.bin.zip?dl=0
data/input/raw_maps/lakeslice.bin,2e72e1f698279fa403bf685818aed6b2,https://www.dropbox.com/s/29usqg4f7zenhx3/lakeslice.bin.zip?dl=0
data/input/raw_maps/montlake.bin,c175776a8ac9540d1973ef3c2986da6e,https://www.dropbox.com/s/2cvjuof5dgw4e3m/montlake.bin.zip?dl=0
data/input/raw_maps/south_seattle.bin,2a48d507cb7ddfcbe51a5fea22967bd1,https://www.dropbox.com/s/sdqc2b4nrhxae4j/south_seattle.bin.zip?dl=0
data/input/raw_maps/south_seattle.bin,73180817715d2e0e787944be8a7cef17,https://www.dropbox.com/s/bm3gbamlmjkkcle/south_seattle.bin.zip?dl=0
data/input/raw_maps/udistrict.bin,3fd43e81796744ef0cbc3e1a64426c79,https://www.dropbox.com/s/z05npfynb634m4e/udistrict.bin.zip?dl=0
data/input/raw_maps/west_seattle.bin,774eaba28e3ee16b1d25ac88343e42df,https://www.dropbox.com/s/hjqvp1szeuukb3h/west_seattle.bin.zip?dl=0
data/input/screenshots/downtown.zip,dce3eda4e90eb8fca812656691c0c43d,https://www.dropbox.com/s/qawd35wz62m2acl/downtown.zip.zip?dl=0
data/input/screenshots/huge_krakow.zip,6bb6a9abc0ba651fe4a61a0d33c7a76c,https://www.dropbox.com/s/dbzon7k5ukndtza/huge_krakow.zip.zip?dl=0
data/input/screenshots/lakeslice.zip,7d9343347e27494cc84d2c268cc587e2,https://www.dropbox.com/s/z0z96lsn7bunqfy/lakeslice.zip.zip?dl=0
data/input/screenshots/montlake.zip,b003580dd21481d0820eaef788499b78,https://www.dropbox.com/s/r9vkgwesqklfuq2/montlake.zip.zip?dl=0
data/input/screenshots/udistrict.zip,88150891440485ff5e052d4dbfbfbbbe,https://www.dropbox.com/s/ecnt1tyza48y9o2/udistrict.zip.zip?dl=0
data/input/raw_maps/west_seattle.bin,651faa9b9dfd9d4ad7226e0a185c12ad,https://www.dropbox.com/s/7r2qwc82tulh14z/west_seattle.bin.zip?dl=0
data/input/screenshots/downtown.zip,ff3db56acc8dd8e4b616f05dc1fd5944,https://www.dropbox.com/s/qawd35wz62m2acl/downtown.zip.zip?dl=0
data/input/screenshots/huge_krakow.zip,0c84dd50e59fb8e612d49921b040fbb7,https://www.dropbox.com/s/dbzon7k5ukndtza/huge_krakow.zip.zip?dl=0
data/input/screenshots/lakeslice.zip,ff5774db1f954716d702c51d7206bad5,https://www.dropbox.com/s/z0z96lsn7bunqfy/lakeslice.zip.zip?dl=0
data/input/screenshots/montlake.zip,01a1c3a08e8fb70420db3db92d7b0925,https://www.dropbox.com/s/r9vkgwesqklfuq2/montlake.zip.zip?dl=0
data/input/screenshots/udistrict.zip,900d415ab84f55acfd134c6eb58706c5,https://www.dropbox.com/s/ecnt1tyza48y9o2/udistrict.zip.zip?dl=0
data/input/seattle/N47W122.hgt,0db4e23e51f7680538b0bbbc72208e07,https://www.dropbox.com/s/mmb4mgutwotijdw/N47W122.hgt.zip?dl=0
data/input/seattle/blockface.bin,add872bab9040ae911366328a230f8b5,https://www.dropbox.com/s/rxd2care60tbe75/blockface.bin.zip?dl=0
data/input/seattle/blockface.kml,350bd9e59bf2af4e885a7c0741e6ee6b,https://www.dropbox.com/s/ukknmpjdvilncq9/blockface.kml.zip?dl=0
data/input/seattle/offstreet_parking.bin,a33c05e8962dfe10a7a14b9eb6413803,https://www.dropbox.com/s/7j2gwb18685kd5u/offstreet_parking.bin.zip?dl=0
data/input/seattle/offstreet_parking.kml,e24d1c308ca739df73621846c7b7847c,https://www.dropbox.com/s/dkkkpywob7cdo57/offstreet_parking.kml.zip?dl=0
data/input/seattle/osm/ballard.osm,a45de6b7d0fbffa270649aab188278b4,https://www.dropbox.com/s/2ni27hzkhi307is/ballard.osm.zip?dl=0
data/input/seattle/osm/downtown.osm,2efcbea58a8b4a06658d6200d943f51e,https://www.dropbox.com/s/alfupn4aqsl55id/downtown.osm.zip?dl=0
data/input/seattle/osm/huge_seattle.osm,66ac561f86f98217d5ae9eaa39ea812e,https://www.dropbox.com/s/5770pf6dg8n89bu/huge_seattle.osm.zip?dl=0
data/input/seattle/osm/lakeslice.osm,b832550569ed61c3bc088bfd3639a0dd,https://www.dropbox.com/s/ogatdyvtgi8unj4/lakeslice.osm.zip?dl=0
data/input/seattle/osm/montlake.osm,65f47302319ea7fa8249f4f33ff34a95,https://www.dropbox.com/s/8s1xmct89z61iea/montlake.osm.zip?dl=0
data/input/seattle/osm/south_seattle.osm,1a92dde4750597246d28ccb5facd30e0,https://www.dropbox.com/s/7z28nn440j1fzs4/south_seattle.osm.zip?dl=0
data/input/seattle/osm/udistrict.osm,5bcda7a8c2808ce2b6263b14630abeaa,https://www.dropbox.com/s/dfwzq71do022p54/udistrict.osm.zip?dl=0
data/input/seattle/osm/washington-latest.osm.pbf,1c48eba66c7950baf268bb7e822b0a06,https://www.dropbox.com/s/r2kd75wfjq7nxm9/washington-latest.osm.pbf.zip?dl=0
data/input/seattle/osm/west_seattle.osm,6e85e0cc091621149fed741a734501e6,https://www.dropbox.com/s/65v6sznumz9lgqo/west_seattle.osm.zip?dl=0
data/input/seattle/parcels.bin,33657ca5808b0200b84288776533a364,https://www.dropbox.com/s/t5dkhhscv4yot2q/parcels.bin.zip?dl=0
data/input/seattle/osm/ballard.osm,d13ab8bd18c3b8af49837f3e4bee15a8,https://www.dropbox.com/s/fkcnpbntylyg2g9/ballard.osm.zip?dl=0
data/input/seattle/osm/downtown.osm,161fd58028167c661f6a2eb05d4e9163,https://www.dropbox.com/s/20lvqov76tisso0/downtown.osm.zip?dl=0
data/input/seattle/osm/huge_seattle.osm,d54be5159bcecf50f153bbd5edefb920,https://www.dropbox.com/s/b5yqqkhzindzt5j/huge_seattle.osm.zip?dl=0
data/input/seattle/osm/lakeslice.osm,71f52736d8edd946690b8fd9eb423f8c,https://www.dropbox.com/s/otjl2irafd6clej/lakeslice.osm.zip?dl=0
data/input/seattle/osm/montlake.osm,c233e3c7a026339976539f78c073e75c,https://www.dropbox.com/s/yvnel12zb1p93xs/montlake.osm.zip?dl=0
data/input/seattle/osm/south_seattle.osm,e07b9eefe6a9450bcda2e1505484f5a0,https://www.dropbox.com/s/rwd7nfapitqxf6e/south_seattle.osm.zip?dl=0
data/input/seattle/osm/udistrict.osm,2aa7d0e63542693733467739562ae2b0,https://www.dropbox.com/s/kek0g6pi2odswbu/udistrict.osm.zip?dl=0
data/input/seattle/osm/washington-latest.osm.pbf,1bd352f47827e1517e32b42d18e3c667,https://www.dropbox.com/s/ddjyd4m3gic3yu3/washington-latest.osm.pbf.zip?dl=0
data/input/seattle/osm/west_seattle.osm,59588308d47737456d7d32439fe1ca0d,https://www.dropbox.com/s/qrmm4nvk721f1va/west_seattle.osm.zip?dl=0
data/input/seattle/parcels.bin,e4608239258f37155412f0e468af4517,https://www.dropbox.com/s/fukvrknt09uygrv/parcels.bin.zip?dl=0
data/input/seattle/parcels_urbansim.txt,db63d7d606e8702d12f9399e87e6a00f,https://www.dropbox.com/s/6g8rbsf200dssj3/parcels_urbansim.txt.zip?dl=0
data/input/seattle/popdat.bin,0fd10698d2c6bf41da3d57804c617d15,https://www.dropbox.com/s/iboctakleznvslq/popdat.bin.zip?dl=0
data/input/seattle/trips_2014.csv,d4a8e733045b28c0385fb81359d6df03,https://www.dropbox.com/s/5ppravwmk6bf20d/trips_2014.csv.zip?dl=0
data/system/cities/seattle.bin,bbae1f23c641d338eb6eea4d6910d176,https://www.dropbox.com/s/rr36q33hq5oqfc4/seattle.bin.zip?dl=0
data/system/maps/ballard.bin,7b8f77deb217e25e253bc7b6d079aafa,https://www.dropbox.com/s/imj86iuxnjepybl/ballard.bin.zip?dl=0
data/system/maps/berlin_center.bin,ec810bbcd7a08a27ef5754b355295c7b,https://www.dropbox.com/s/ipg9tl8jh68qhpc/berlin_center.bin.zip?dl=0
data/system/maps/downtown.bin,82a1bc95bcf497a4f0c82b4e6fc4a360,https://www.dropbox.com/s/e0u1fjdt13unk3j/downtown.bin.zip?dl=0
data/system/maps/huge_krakow.bin,07c2fb584a2a4f61361cf19606125ee7,https://www.dropbox.com/s/47rv7k4s3eb57dy/huge_krakow.bin.zip?dl=0
data/system/maps/huge_seattle.bin,c0dbd4446638659439f89d633eb3f000,https://www.dropbox.com/s/gfhck88ykqcol0r/huge_seattle.bin.zip?dl=0
data/system/maps/lakeslice.bin,584affeda19166e2dc2432fbed56e16b,https://www.dropbox.com/s/3883z65dl72vq83/lakeslice.bin.zip?dl=0
data/system/maps/montlake.bin,936ea0bfe0ff033bd3aa1b64e01a38fd,https://www.dropbox.com/s/11rnmo7h70s6rtj/montlake.bin.zip?dl=0
data/system/maps/south_seattle.bin,e4d7655d15d1b995c609b3e5d6df6724,https://www.dropbox.com/s/79hhdsi1otkubye/south_seattle.bin.zip?dl=0
data/system/maps/udistrict.bin,055652cd722c433257ab081447d9b828,https://www.dropbox.com/s/4n5g4f3ttebybcz/udistrict.bin.zip?dl=0
data/system/maps/west_seattle.bin,44c9353ae7cc2c55f5dc8ef95af7c618,https://www.dropbox.com/s/ivdp1pafw9b5kyr/west_seattle.bin.zip?dl=0
data/system/prebaked_results/lakeslice/weekday.bin,70cdfff331854665b830e4ba2f6a8855,https://www.dropbox.com/s/48hrvn7313bdb9i/weekday.bin.zip?dl=0
data/system/cities/seattle.bin,52509bd1f048b7eae36cda73d9771901,https://www.dropbox.com/s/1gz6n50rcu786pn/seattle.bin.zip?dl=0
data/system/maps/ballard.bin,ad6f3c7d2a406386907479b447835f14,https://www.dropbox.com/s/hyd6124ackojtkg/ballard.bin.zip?dl=0
data/system/maps/berlin_center.bin,524fcf3f73b0bca53562d7355933df5f,https://www.dropbox.com/s/0z0j1x7w7rregrv/berlin_center.bin.zip?dl=0
data/system/maps/downtown.bin,e1eb88cb1cbd530a83efaf4fb9edffdc,https://www.dropbox.com/s/np4805m1d5aezqa/downtown.bin.zip?dl=0
data/system/maps/huge_krakow.bin,8d0bd5476baf31bca76626aeaf79df91,https://www.dropbox.com/s/em59puuta13igao/huge_krakow.bin.zip?dl=0
data/system/maps/huge_seattle.bin,8241da1dc2577434db95f7cd4c624b8a,https://www.dropbox.com/s/9b8842nundekty2/huge_seattle.bin.zip?dl=0
data/system/maps/lakeslice.bin,22293c1a28c1e919f56bc4c1c9d5637c,https://www.dropbox.com/s/2qi3qveffaxa7sk/lakeslice.bin.zip?dl=0
data/system/maps/montlake.bin,ed62f008dd18555a59189e82c38c4ccc,https://www.dropbox.com/s/mmo3rfizn5gzjto/montlake.bin.zip?dl=0
data/system/maps/south_seattle.bin,6aeed51d67ee3838f0d0ad86c481a389,https://www.dropbox.com/s/7g4yodh0x1pij9x/south_seattle.bin.zip?dl=0
data/system/maps/udistrict.bin,5c4d6ffc6b1f4c671d5a046afda3a128,https://www.dropbox.com/s/ob6rrt8kmua0ucn/udistrict.bin.zip?dl=0
data/system/maps/west_seattle.bin,0c0e67c09590458a53d27c599335e123,https://www.dropbox.com/s/ut9sqxeto575b59/west_seattle.bin.zip?dl=0
data/system/prebaked_results/lakeslice/weekday.bin,620e5fa7b972567197fe66771a43ac76,https://www.dropbox.com/s/vr8yoe1wf6p0889/weekday.bin.zip?dl=0
data/system/prebaked_results/montlake/car vs bike contention.bin,9e4920cf59268cd169372cad63e772e3,https://www.dropbox.com/s/jefg0ikjy9dsrdd/car%20vs%20bike%20contention.bin.zip?dl=0
data/system/prebaked_results/montlake/weekday.bin,b06c5c064caedcd7154f21f292df5bb9,https://www.dropbox.com/s/nnlb40zcpmhqfs2/weekday.bin.zip?dl=0
data/system/scenarios/ballard/weekday.bin,0eeb4e78405eee29be1bb53b054433d7,https://www.dropbox.com/s/ghkfy3j4q3rojji/weekday.bin.zip?dl=0
data/system/scenarios/downtown/weekday.bin,c5a680f7c01b144e44126ce3013a14b1,https://www.dropbox.com/s/w4p1u0gkvykj29n/weekday.bin.zip?dl=0
data/system/scenarios/huge_seattle/weekday.bin,0ded1491eaf86f2ae4ebf9539f37c26b,https://www.dropbox.com/s/46d2ui4bxtntu3b/weekday.bin.zip?dl=0
data/system/scenarios/lakeslice/weekday.bin,90378e4996efab4a2bd50fa87fc679f5,https://www.dropbox.com/s/s06f5bjuknnhyrn/weekday.bin.zip?dl=0
data/system/scenarios/montlake/weekday.bin,e8b11f825a184bc1f9ca363ab5b17c92,https://www.dropbox.com/s/z8d7h0a7b2zzq8g/weekday.bin.zip?dl=0
data/system/scenarios/south_seattle/weekday.bin,6c0e9d513e06863afaae450e61ea6b4c,https://www.dropbox.com/s/5d18zduf2zu85c6/weekday.bin.zip?dl=0
data/system/scenarios/udistrict/weekday.bin,dd134c41f54e2b6f7ad8620cfc3e34a3,https://www.dropbox.com/s/w0ujszd2in7gr4r/weekday.bin.zip?dl=0
data/system/scenarios/west_seattle/weekday.bin,8d50652c221a6f20a751ad744d3b6862,https://www.dropbox.com/s/fgm4q56epee2s9b/weekday.bin.zip?dl=0
data/system/prebaked_results/montlake/weekday.bin,8d7dba9443bdb2a5e4184c844c523d55,https://www.dropbox.com/s/v1t34xy78dyi8ob/weekday.bin.zip?dl=0
data/system/scenarios/ballard/weekday.bin,60999a9ce56908e4ef362063e6dfea20,https://www.dropbox.com/s/o7cdgtoybrehboj/weekday.bin.zip?dl=0
data/system/scenarios/downtown/weekday.bin,84af5501be854fd6af7d6ef8d37c6488,https://www.dropbox.com/s/gdudy2ikb9p1xlt/weekday.bin.zip?dl=0
data/system/scenarios/huge_seattle/weekday.bin,1787171bebb764ec1536dad26a9e4846,https://www.dropbox.com/s/1z6c0tjv4x3cyh6/weekday.bin.zip?dl=0
data/system/scenarios/lakeslice/weekday.bin,c5897fa2685c44510e99798ff44dbf64,https://www.dropbox.com/s/9v4mj3vdkzuujel/weekday.bin.zip?dl=0
data/system/scenarios/montlake/weekday.bin,d3c9ca04e4d74eff981201c34c7f80b7,https://www.dropbox.com/s/pwz1ezovlgxpoet/weekday.bin.zip?dl=0
data/system/scenarios/south_seattle/weekday.bin,7904bbde33bfb1abc40fcfa24a5b356c,https://www.dropbox.com/s/8luuy1vm137uex2/weekday.bin.zip?dl=0
data/system/scenarios/udistrict/weekday.bin,3eca9e92dba498983f2b241f9a21f48c,https://www.dropbox.com/s/cdrudb74lsp8sk3/weekday.bin.zip?dl=0
data/system/scenarios/west_seattle/weekday.bin,913c198d4a15daf39aacbd576e8f9e55,https://www.dropbox.com/s/609z6hihapfhycu/weekday.bin.zip?dl=0

4
data/regen.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
rm -fv data/system/maps/huge_seattle.bin data/input/raw_maps/huge_seattle.bin data/input/seattle/popdat.bin
./import.sh --raw --map --scenario && ./import.sh --raw --map --city=berlin && ./import.sh --raw --map --city=krakow

View File

@ -70,6 +70,7 @@ Divide into implemented or not.
- is it always fine to block the box at degenerate intersections?
- hacks to allow conflicting turns at really broken intersections
- manually timing signals
- penalties for lane choice to make lane usage realistic
### Not implemented

View File

@ -267,7 +267,7 @@ impl Lane {
pub fn get_max_cost(&self, constraints: PathConstraints, map: &Map) -> usize {
map.get_turns_to_lane(self.id)
.into_iter()
.map(|turn| pathfind::cost(self, turn, constraints, map))
.map(|turn| pathfind::driving_cost(self, turn, constraints, map))
.max()
.unwrap_or_else(|| {
// Probably a border.

View File

@ -1,4 +1,4 @@
use crate::pathfind::{cost, walking_cost, WalkingNode};
use crate::pathfind::{driving_cost, walking_cost, WalkingNode};
use crate::{
IntersectionID, LaneID, Map, Path, PathConstraints, PathRequest, PathStep, RoadID, TurnID,
};
@ -61,7 +61,9 @@ impl Zone {
&graph,
req.start.lane(),
|l| l == req.end.lane(),
|(_, _, turn)| cost(map.get_l(turn.src), map.get_t(*turn), req.constraints, map),
|(_, _, turn)| {
driving_cost(map.get_l(turn.src), map.get_t(*turn), req.constraints, map)
},
|_| 0,
)?;
let mut steps = Vec::new();

View File

@ -178,7 +178,7 @@ fn make_input_graph(
from,
nodes.get(Node::Lane(turn.id.dst)),
// Round up! 0 cost edges are ignored
cost(l, turn, constraints, map).max(1),
driving_cost(l, turn, constraints, map).max(1),
);
}
} else {
@ -188,7 +188,7 @@ fn make_input_graph(
let mut sum_cost = 0;
for t in &ut.path {
sum_cost += cost(map.get_l(t.src), map.get_t(*t), constraints, map);
sum_cost += driving_cost(map.get_l(t.src), map.get_t(*t), constraints, map);
}
input_graph.add_edge(from, nodes.get(Node::UberTurn(*idx)), sum_cost.max(1));
input_graph.add_edge(
@ -213,10 +213,10 @@ fn make_input_graph(
input_graph
}
pub fn cost(lane: &Lane, turn: &Turn, constraints: PathConstraints, map: &Map) -> usize {
pub fn driving_cost(lane: &Lane, turn: &Turn, constraints: PathConstraints, map: &Map) -> usize {
// TODO Could cost turns differently.
match constraints {
let base = match constraints {
PathConstraints::Car | PathConstraints::Train => {
// Prefer slightly longer route on faster roads
let t1 = lane.length() / map.get_r(lane.parent).speed_limit;
@ -257,5 +257,17 @@ pub fn cost(lane: &Lane, turn: &Turn, constraints: PathConstraints, map: &Map) -
(lt_penalty * (t1 + t2)).inner_seconds().round() as usize
}
PathConstraints::Pedestrian => unreachable!(),
};
// Normally opportunistic lane-changing adjusts the path live, but that doesn't work near
// uber-turns. So still use some of the penalties here.
let (lt, lc, rightmost) = turn.penalty(map);
// TODO Since these costs wind up mattering most for particular lane choice, I guess just
// adding is reasonable?
let mut extra_penalty = lt + lc;
if constraints == PathConstraints::Bike {
extra_penalty = rightmost;
}
base + extra_penalty
}

View File

@ -4,7 +4,7 @@ mod node_map;
pub mod uber_turns;
mod walking;
pub use self::driving::cost;
pub use self::driving::driving_cost;
use self::driving::VehiclePathfinder;
use self::walking::{one_step_walking_path, walking_path_to_steps, SidewalkPathfinder};
pub use self::walking::{walking_cost, WalkingNode};