Skip to content

Commit

Permalink
doc string updates, new release version
Browse files Browse the repository at this point in the history
  • Loading branch information
rf-ivtdai committed Jan 17, 2024
1 parent 9f40eea commit b7c83e5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
12 changes: 8 additions & 4 deletions invertedai/api/drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class DriveResponse(BaseModel):
is_inside_supported_area: List[
bool
] #: For each agent, indicates whether the predicted state is inside supported area.
traffic_lights_states: Optional[TrafficLightStatesDict] # Traffic light states for the next time step
light_recurrent_states: Optional[LightRecurrentStates] # Recurrent states for all traffic lights at the next time step
traffic_lights_states: Optional[TrafficLightStatesDict] #: Traffic light states for the full map, each key-value pair corresponds to one particular traffic light.
light_recurrent_states: Optional[LightRecurrentStates] #: Light recurrent states for the full map, each element corresponds to one light group.


@validate_arguments
Expand Down Expand Up @@ -101,10 +101,14 @@ def drive(
traffic_lights_states:
If the location contains traffic lights within the supported area,
their current state should be provided here. Any traffic light for which no
state is provided will be ignored by the agents.
state is provided will have a state generated by iai.
light_recurrent_states:
Specifies the state and time remaining for each light group in the scene.
Light recurrent states for all agents, obtained from the previous call to
:func:`drive` or :func:`initialize`.
Specifies the state and time remaining for each light group in the map.
If manual control of individual traffic lights is desired, modify the relevant state(s)
in traffic_lights_states, then pass in light_recurrent_states as usual.
random_seed:
Controls the stochastic aspects of agent behavior for reproducibility.
Expand Down
8 changes: 4 additions & 4 deletions invertedai/api/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class InitializeResponse(BaseModel):
infractions: Optional[
List[InfractionIndicators]
] #: If `get_infractions` was set, they are returned here.
traffic_lights_states: Optional[TrafficLightStatesDict] #: Traffic light states at the first time step
light_recurrent_states: Optional[LightRecurrentStates] # To pass to :func:`iai.drive` at the first time step
traffic_lights_states: Optional[TrafficLightStatesDict] #: Traffic light states for the full map, each key-value pair corresponds to one particular traffic light.
light_recurrent_states: Optional[LightRecurrentStates] #: Light recurrent states for the full map, each element corresponds to one light group.
model_version: str # Model version used for this API call


Expand Down Expand Up @@ -96,8 +96,8 @@ def initialize(
traffic_light_state_history:
History of traffic light states - the list is over time, in chronological order, i.e.
the last element is the current state. Not specifying traffic light state is equivalent
to disabling traffic lights.
the last element is the current state. If there are traffic lights in the map,
not specifying traffic light state is equivalent to using iai generated light states.
location_of_interest:
Optional coordinates for spawning agents with the given location as center instead of the default map center
Expand Down
3 changes: 3 additions & 0 deletions invertedai/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ class TrafficLightState(str, Enum):


class LightRecurrentState(BaseModel):
"""
Recurrent state of all the traffic lights in one light group (one intersection).
"""
state: float
time_remaining: float

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "invertedai"
version = "0.0.11.post1"
version = "0.0.12"
description = "Client SDK for InvertedAI"
authors = ["Inverted AI <info@inverted.ai>"]
readme = "README.md"
Expand Down

0 comments on commit b7c83e5

Please sign in to comment.