invertedai.api.light(location: str, recurrent_states: Optional[str] = None, random_seed: Optional[int] = None) LightResponse[source]#

DEPRECATED! For maps with traffic lights, use iai.initialize() to get traffic light states instead. :param location: Location name in IAI format.

If recurrent_state is provided which is obtained from previous calls to light, next state is returned. Otherwise, a random state is generated which can be reproduced by setting the random_seed.

  • recurrent_states – Recurrent states for traffic lights, obtained from the previous call to light().

  • random_seed – Controls the stochastic aspects of agent behavior for reproducibility.

See also

initialize(), location_info(), drive(), blame()

class invertedai.api.LightResponse(*, traffic_lights_states: Dict[int, TrafficLightState] = None, recurrent_states: str = None)[source]#

Response returned from an API call to iai.light().

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'recurrent_states': FieldInfo(annotation=str, required=False, description='Recurrent states for traffic-lights, obtained from the previous call to `LIGHT`.'), 'traffic_lights_states': FieldInfo(annotation=Dict[int, invertedai.common.TrafficLightState], required=False, description="Current traffic lights states, an object where key is the traffic-light id and value is the state, i.e., 'green', 'yellow', 'red', or None.")}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

recurrent_states: str#
traffic_lights_states: Dict[int, TrafficLightState]#