unsprawl.core¶
Core engine contracts.
This package contains the deterministic, globally valid building blocks of Unsprawl.
Anti-circular protocol¶
The core MUST NOT import from unsprawl.adapters, unsprawl.providers, or unsprawl.loaders.
Submodules¶
Attributes¶
Classes¶
Package Contents¶
- Region¶
- 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'¶
- 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 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¶