Skip to content

AgentDataManager#278

Draft
atao-inverted wants to merge 22 commits intodevelopfrom
keyed_agents
Draft

AgentDataManager#278
atao-inverted wants to merge 22 commits intodevelopfrom
keyed_agents

Conversation

@atao-inverted
Copy link
Contributor

@atao-inverted atao-inverted commented Jan 27, 2026

Generate agents from iai.initialize calls

  • Users can optionally pass keys per agent requested (whether pre-existing or sampled agents)

  • Default behaviour: give all agents a UUID keys to store in agent_dict{}

Provide getters and setters for the AgentData so the user can manipulate them at will

Add Waypoints as a separate field into the AgentData (thus allowing us to not have to rely on InitializeResponse.AgentProperties)

Calls iai.large_drive and iai.large_initialize when you call AgentDataManager.drive and AgentDataManager.Initialize and packs/unpacks agent states/properties/recurrent states as necessary.

  • Allow users to pass kwargs for all the miscellaneous parameters to these functions

Allow the AgentDataManager to take in different class Config and therefore create new Configs for classes (such as a LoggerConfig) as necessary to initialize them within AgentDataManager

Integrate these different classes (like the waypoint manager, logger) into the AgentDataManager class before and after the iai.initialize/iai.drive calls

Conduct data validation for all data and configuration combinations with appropriate error messages if data is formatted incorrectly

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think making 3 additional example files is a tad excessive and will muddy our examples directory.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think one example file should suffice at most. It may be easier to add this to an existing file instead.

agents.set_recurrent_states(response.recurrent_states)
print(f"Begin stepping through simulation.")
for _ in tqdm(range(args.sim_length)):
response = iai.large_drive(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The functionality of the keyed agents are meant to replicate the same assumptions as the current SDK functionality. In this case, it means the mutability of parameters needs to remain the same (i.e. values should be passed by value, not be reference). This means that you will need to update the DriveResponse and InitializeResponse classes to return a KeyedAgents object with the update AgentData with the same keys.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My vision is that the change to a script using keyed_agents vs what currently exists will only change by a few lines. Those lines being where the data is retrieved from the response object (e.g. for subsequent drive() calls or getting the data for logging/visualization).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

large_initialize should be updated as well.

Comment on lines 23 to 27
for i in range(num_agents):
aid = f"agent_{i}"
agents_dict[aid] = AgentData(
properties=get_default_agent_properties({AgentType.car: 1})[0]
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be reduced to a single line by passing num_agents to get_default_agent_properties().

def drive(
location: str,
agent_states: List[AgentState],
agent_states: Optional[List[AgentState]] = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since agent_states is possibly Optional now, there should be a parameter validation step checking to make sure key_agents and agent_states are both not None.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be repeated anywhere agent_states has become Optional due to the existence of keyed_agents.

@atao-inverted atao-inverted changed the title Keyed Agents AgentDataManager Feb 11, 2026
@atao-inverted atao-inverted marked this pull request as draft February 11, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants