unsprawl.core.schemas¶
unsprawl.core.schemas.
This module defines the Universal Modular Design (UMD) schema layer for Unsprawl.
These Pydantic models are the language of the deterministic core engine: - They are global (no country/city-specific assumptions). - They are stable contracts between messy local datasets (adapters) and the core simulation.
Anti-circular protocol¶
unsprawl.core MUST NOT import from adapters/providers/loaders.
Attributes¶
Classes¶
Module Contents¶
- LatLon¶
- class Entity(/, **data)[source]¶
Bases:
pydantic.BaseModelUniversal base class for the Unsprawl simulation.
Everything in the simulation (static or moving) is an Entity.
Notes
Coordinate ordering is strictly (lat, lon) across the entire platform. Adapters must normalize any source data into this convention at the boundary.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- location: LatLon¶
- class Asset(/, **data)[source]¶
Bases:
EntityA static economic unit (Building, Park, Transit Station).
This replaces the legacy Singapore-specific concept of “HDB Flat” with a generic container that can represent any asset class across any region.
The physics engine treats local_metadata as an opaque payload.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- asset_type: Literal['residential', 'commercial', 'transport']¶
- class Agent(/, **data)[source]¶
Bases:
EntityA dynamic actor (Commuter, Bus, Car).
Agents flow through the city graph / continuous space depending on the simulation backend.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- goal: LatLon¶
- state: Literal['idle', 'moving', 'stuck'] = 'idle'¶