a-b-street/abstreet · error

A trip just walking from

Error message

A trip just walking from {:?} to {:?} doesn't make sense

What it means

TripSpec::JustWalking describes a purely pedestrian trip; if the start and goal building positions are identical there is no trip to perform. into_plan panics because a zero-distance walk would produce an empty trip with no legs.

Solutions

  1. Skip or resample trips whose origin equals the destination in the scenario generator
  2. Convert the trip into a no-op/parking-only spec instead of JustWalking
  3. Deduplicate origin/destination pairs when building TripSpecs

Example fix

// before
TripSpec::JustWalking { start: b, goal: b, .. }
// after
if start == goal { return None; } // or pick a different goal building
Defensive patterns

Strategy: validation

Validate before calling

if start == goal {
    return None; // skip: nothing to walk
}
let spec = TripSpec::JustWalking { start, goal, depart };

Try / catch

let plan = std::panic::catch_unwind(|| spec.into_plan(&map, &mut rng));

Prevention

When it happens

Trigger: into_plan() with TripSpec::JustWalking where start == goal (same building or position), typically when a scenario samples origin and destination and they collide.

Common situations: Random scenario generators picking the same building twice; data pipelines where origin/destination columns alias; people parked at a building asked to walk to it.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of a-b-street/abstreet@0964f29315 (2026-09-13). Data as JSON: /api/errors/68ecff71f7f3b3e4. Report an issue: GitHub.

Appendix: source

Thrown at sim/src/make/spawner.rs:122

            TripSpec::SpawningFailure { .. } => {
                // TODO The legs are a lie. Since the trip gets cancelled, this doesn't matter.
                // I'm not going to bother doing better because I think TripLeg will get
                // revamped soon anyway.
                legs.push(TripLeg::RideBus(TransitRouteID(0), None));
            }
            TripSpec::UsingParkedCar { car, goal, .. } => {
                legs.push(TripLeg::Walk(SidewalkSpot::deferred_parking_spot()));
                legs.push(TripLeg::Drive(*car, goal.clone()));
                match goal {
                    DrivingGoal::ParkNear(b) => {
                        legs.push(TripLeg::Walk(SidewalkSpot::building(*b, map)));
                    }
                    DrivingGoal::Border(_, _) => {}
                }
            }
            TripSpec::JustWalking { start, goal, .. } => {
                if start == goal {
                    panic!(
                        "A trip just walking from {:?} to {:?} doesn't make sense",
                        start, goal
                    );
                }
                legs.push(TripLeg::Walk(goal.clone()));
            }
            TripSpec::UsingBike { start, goal, bike } => {
                // TODO Might not be possible to walk to the same border if there's no sidewalk
                let backup_plan = match goal {
                    DrivingGoal::ParkNear(b) => Some(TripSpec::JustWalking {
                        start: SidewalkSpot::building(*start, map),
                        goal: SidewalkSpot::building(*b, map),
                    }),
                    DrivingGoal::Border(i, _) => {
                        SidewalkSpot::end_at_border(*i, map).map(|goal| TripSpec::JustWalking {
                            start: SidewalkSpot::building(*start, map),
                            goal,
                        })

View on GitHub (pinned to 0964f29315)