reduce_lanes_tool
Reduce lanes on road segments using relative or absolute reduction modes. Specify target road and radius for localized lane reduction, then reuse existing trip files for simulation.
Instructions
Reduce lanes on road segments with two modes.
✅ Trip file can be reused - edges still exist, only lane count changed.
Workflow: reduce_lanes → sumo_runner (reuse existing trip file)
**MODE 1: Relative Reduction (RECOMMENDED for most policies)**
- reduce_by: Reduce N lanes from each segment
- Example: reduce_by=1 → 5→4, 3→2, 2→1, 1→1 (balanced reduction)
**MODE 2: Absolute Reduction (for special cases)**
- remain_lanes: Set all segments to N lanes
- Example: remain_lanes=1 → 5→1, 3→1, 2→1, 1→1 (extreme reduction)
REALISTIC USAGE: Use reference_location + radius_km for localized lane reduction!
Examples:
# BALANCED POLICY: Reduce 1 lane from each segment
reduce_lanes_tool(
net_file="gangnam_station.net.xml",
target_road_name="테헤란로",
reference_location="강남역",
radius_km=0.5,
reduce_by=1 # Each segment: 5→4, 3→2, 2→1, 1→1
)
# Then: sumo_runner (reuse trip file - no trip_generate needed!)
# EXTREME POLICY: Set all segments to 1 lane
reduce_lanes_tool(
net_file="gangnam_station.net.xml",
target_road_name="테헤란로",
reference_location="강남역",
radius_km=0.5,
remain_lanes=1 # All segments: 5→1, 3→1, 2→1, 1→1
)
# Then: sumo_runner (reuse trip file - no trip_generate needed!)
Args:
net_file: Network file path
route_file: Route file path (optional, can be reused after this tool)
output_dir: Output directory for results
target_road_name: Road name to reduce lanes (e.g., '테헤란로')
edge_ids: Specific edge IDs (optional)
reference_location: Reference point (optional, e.g., "강남역")
radius_km: Radius in km (optional, e.g., 0.5)
reduce_by: Number of lanes to reduce from each segment (RECOMMENDED!)
remain_lanes: Number of lanes to remain (ABSOLUTE - use with caution)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edge_ids | No | ||
| net_file | Yes | ||
| radius_km | No | ||
| reduce_by | No | ||
| output_dir | No | output/networks | |
| route_file | No | ||
| remain_lanes | No | ||
| target_road_name | No | ||
| reference_location | No |