agent_urban_planning.ZoneChoice¶
- class ZoneChoice(zone_name=None, utility=0.0, zone_utilities=None, *, residence=None, workplace=None)[source]¶
Bases:
LocationChoiceBackward-compatible alias for
LocationChoice.Accepts the legacy keyword-argument style
ZoneChoice(zone_name=..., utility=..., zone_utilities=...)and mapszone_nameto bothresidenceandworkplace(since Singapore scenarios conflated them). Also accepts the newresidence=/workplace=keywords for forward compatibility. New code should useLocationChoicedirectly; this class remains so that the large existing codebase (utility engines, LLM engines, clustering, cache serialization) continues to work unchanged.Examples
>>> from agent_urban_planning import ZoneChoice >>> legacy = ZoneChoice(zone_name="Mitte", utility=1.5) >>> legacy.residence == legacy.workplace == "Mitte" True >>> # New code SHOULD use the explicit residence/workplace kwargs: >>> modern = ZoneChoice(residence="Mitte", workplace="Charlottenburg", ... utility=2.1) >>> modern.workplace 'Charlottenburg'