{"record":{"id":"5f3997000944d728","repo":"a-b-street/abstreet","slug":"no-path-found","errorCode":null,"errorMessage":"no path found","messagePattern":"no path found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"synthpop/src/make/activity_model.rs","lineNumber":230,"sourceCode":"        bail!(\"TODO: handle working and living in the same building\");\n    }\n\n    let mode = match (&home, &work) {\n        // commuting entirely within map\n        (TripEndpoint::Building(home_bldg), TripEndpoint::Building(work_bldg)) => {\n            // Decide mode based on walking distance. If the buildings aren't connected,\n            // probably a bug in importing; just skip this person.\n            let dist = if let Some(path) = PathRequest::between_buildings(\n                map,\n                *home_bldg,\n                *work_bldg,\n                PathConstraints::Pedestrian,\n            )\n            .and_then(|req| map.pathfind(req).ok())\n            {\n                path.total_length()\n            } else {\n                bail!(\"no path found\");\n            };\n\n            // TODO If home or work is in an access-restricted zone (like a living street),\n            // then probably don't drive there. Actually, it depends on the specific tagging;\n            // access=no in the US usually means a gated community.\n            select_trip_mode(dist, rng)\n        }\n        // if you exit or leave the map, we assume driving\n        _ => TripMode::Drive,\n    };\n\n    // TODO This will cause a single morning and afternoon rush. Outside of these times,\n    // it'll be really quiet. Probably want a normal distribution centered around these\n    // peak times, but with a long tail.\n    let mut depart_am = rand_time(\n        rng,\n        Time::START_OF_DAY + Duration::hours(7),\n        Time::START_OF_DAY + Duration::hours(10),","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/synthpop/src/make/activity_model.rs#L212-L248","documentation":"When deciding the commute mode for a synthetic person, create_prole measures the pedestrian path length between home and work. If the pedestrian pathfinder cannot find any path, the generation of that person fails with 'no path found'.","triggerScenarios":"map.pathfind on a pedestrian PathRequest between the home and work endpoints returns no route, e.g. endpoints on disconnected road/sidewalk networks or inaccessible buildings.","commonSituations":"OSM imports with severed sidewalks or missing pedestrian connections, buildings not attached to the walkable network, maps split by highways without crossings.","solutions":["Fix map connectivity (sidewalk/crossing data in the OSM import) so home and work are walkable-connected","Fall back to another mode or skip the individual instead of failing","Rebuild the pathfinder after map edits so it reflects current connectivity"],"exampleFix":"// before\nlet path = map.pathfind(req).ok()?;\n// after\nlet path = match map.pathfind(req) {\n    Some(p) => p,\n    None => { warn!(\"skipping prole with no walkable path\"); return Ok(None); }\n};","handlingStrategy":"fallback","validationCode":"let connected = map.pathfind(PathRequest::find_req(map, home, work, PathConstraints::Pedestrian)).is_some();\nif !connected { eprintln!(\"home and work not walkable-connected\"); }","typeGuard":null,"tryCatchPattern":"match create_prole(map, rng, home, work, ...) {\n    Ok(p) => Some(p),\n    Err(e) if e.to_string() == \"no path found\" => { skipped += 1; None }\n    Err(e) => return Err(e),\n}","preventionTips":["Check map connectivity for pedestrian constraints before generating populations","Use only buildings connected to the sidewalk network","Count and report skipped individuals instead of aborting the whole run"],"tags":["pathfinding","synthpop","routing"],"backgroundTag":"resource-not-found","analyzedSha":"0964f29315820c91b171b585eb51e300164e9197","analyzedAt":"2026-09-13T18:02:03.421Z","contentChangedAt":"2026-09-13T18:02:03.421Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}