simworld.citygen.city package

Submodules

simworld.citygen.city.city_generator module

City generator module for generating cities with roads, buildings, and elements.

class simworld.citygen.city.city_generator.CityGenerator(config, seed: int | None = None, num_segments: int | None = None, generate_element: bool | None = None, generate_route: bool | None = None)

Bases: object

Manages the complete city generation process including roads, buildings, and elements.

property building_manager

Get the building manager.

Returns:

BuildingManager: Manager for building operations.

property building_quadtree

Get the building quadtree.

Returns:

Quadtree: Quadtree for efficient building queries.

property buildings

Get all buildings.

Returns:

list: List of buildings.

property city_quadtrees

Get all city quadtrees.

Returns:

list: List of road, building, and element quadtrees.

property element_manager

Get the element manager.

Returns:

ElementManager: Manager for element operations.

property element_quadtree

Get the element quadtree.

Returns:

Quadtree: Quadtree for efficient element queries.

property elements

Get all elements.

Returns:

list: List of elements.

generate()

Generate the city.

generate_step() bool

Generate one step of the city.

Returns:

bool: True if generation is complete.

property intersections

Get all intersections.

Returns:

list: List of road intersections.

is_generation_complete() bool

Check if city generation is complete.

Returns:

bool: True if generation is complete.

property road_manager

Get the road manager.

Returns:

RoadManager: Manager for road operations.

property road_quadtree

Get the road quadtree.

Returns:

Quadtree: Quadtree for efficient road queries.

property roads

Get all roads.

Returns:

list: List of road segments.

property route_manager

Get the route manager.

Returns:

RouteManager: Manager for route operations.

property routes

Get all routes.

Returns:

list: List of routes.

class simworld.citygen.city.city_generator.GenerationState(value)

Bases: Enum

Enum to track the generation state.

COMPLETED = 5
GENERATING_BUILDINGS = 2
GENERATING_ELEMENTS = 3
GENERATING_ROADS = 1
GENERATING_ROUTES = 4

Module contents

City generation and management package.

This package provides functionality for generating and managing city structures and layouts. It includes tools for creating city layouts, managing city components, and handling city-level operations and configurations.