simworld.citygen.dataclass package
Submodules
simworld.citygen.dataclass.dataclass module
Module for data classes defining various data structures for city generation.
- class simworld.citygen.dataclass.dataclass.Bounds(x: float, y: float, width: float, height: float, rotation: float = 0.0)
Bases:
objectA bounding box with x, y, width, height, and rotation.
(x, y) is the bottom-left corner of the bounding box width: width of the bounding box height: height of the bounding box
- to_dict()
Convert the bounds to dictionary representation.
- class simworld.citygen.dataclass.dataclass.Building(building_type: BuildingType, bounds: Bounds, rotation: float = 0.0)
Bases:
objectA building.
- building_type: BuildingType
- to_dict()
Convert the building to dictionary representation.
- class simworld.citygen.dataclass.dataclass.BuildingType(name: str, width: float, height: float, num_limit: int = -1)
Bases:
objectA building type.
- to_dict()
Convert the building type to dictionary representation.
- class simworld.citygen.dataclass.dataclass.Element(element_type: ElementType, bounds: Bounds, rotation: float = 0.0, building: Building | None = None)
Bases:
objectAn element is a small object that can be placed in the city.
- element_type: ElementType
- to_dict()
Convert the element to dictionary representation.
- class simworld.citygen.dataclass.dataclass.ElementType(name: str, width: float, height: float)
Bases:
objectAn element type.
- to_dict()
Convert the element type to dictionary representation.
- class simworld.citygen.dataclass.dataclass.Intersection(point: Point, segments: List[Segment])
Bases:
objectA road intersection.
- class simworld.citygen.dataclass.dataclass.MetaInfo(highway: bool = False, t: float = 0.0)
Bases:
objectMetadata for road segments.
- class simworld.citygen.dataclass.dataclass.Point(x: float, y: float)
Bases:
objectA point in a 2D plane.
- to_dict()
Convert the point to dictionary representation.
- class simworld.citygen.dataclass.dataclass.Route(points: List[Point], start: Point, end: Point, bounds: Bounds = Bounds(x=0, y=0, width=0, height=0, rotation=0.0))
Bases:
objectA route consisting of multiple points.
- class simworld.citygen.dataclass.dataclass.Segment(start: ~simworld.citygen.dataclass.dataclass.Point, end: ~simworld.citygen.dataclass.dataclass.Point, q: ~simworld.citygen.dataclass.dataclass.MetaInfo = <factory>, bounds: ~simworld.citygen.dataclass.dataclass.Bounds = Bounds(x=0, y=0, width=0, height=0, rotation=0.0))
Bases:
objectA road segment connecting two points.
- to_dict()
Convert the segment to dictionary representation.
Module contents
Dataclass module for the city generation.