simworld.citygen.function_call package
Submodules
simworld.citygen.function_call.city_function_call module
City generation function call module for handling city creation operations.
This module provides a high-level interface for city generation operations including creating roads, buildings, and elements, as well as exporting the generated city data.
- class simworld.citygen.function_call.city_function_call.CityFunctionCall(config: Config, seed: int | None = None, num_segments: int | None = None, generate_element: bool | None = None, generate_route: bool | None = None)
Bases:
objectFunction call interface for city generation operations.
- add_road(start: List[float], end: List[float]) int
Add a road segment to the city.
- Args:
start: Starting coordinates [x, y] of the road. end: Ending coordinates [x, y] of the road.
- Returns:
ID of the newly added road segment.
- export_city(output_dir: str | None = None)
Export city data to JSON files.
- Args:
output_dir: Directory path where the city data will be exported.
- generate_building_alone_road(road_id: int)
Generate buildings along a single road.
- Args:
road_id: ID of the road to generate buildings along.
- generate_building_alone_roads()
Generate buildings along all roads in the city.
- generate_city()
Generate city randomly with roads, buildings and elements.
- generate_element_alone_road(road_id: int)
Generate elements along a single road.
- Args:
road_id: ID of the road to generate elements along.
- generate_element_alone_roads()
Generate elements along all roads in the city.
- generate_element_around_buildings()
Generate elements around all buildings in the city.
- generate_road_network()
Generate a procedural road network.
- Args:
num_segments: Target number of road segments to generate.
- modify_road(id: int, start: List[float], end: List[float]) bool
Modify an existing road segment.
- Args:
id: ID of the road segment to modify. start: New starting coordinates [x, y] of the road. end: New ending coordinates [x, y] of the road.
- Returns:
True if the road was successfully modified, False otherwise.
Module contents
Function call management package.
This package provides functionality for managing function calls within the city generation system. It includes tools for handling and processing city-related function calls and their associated operations.