Add call validation

This commit is contained in:
Marek Wolan
2024-03-08 15:57:43 +00:00
parent beb51834f9
commit 0447a05084
9 changed files with 69 additions and 44 deletions

View File

@@ -165,9 +165,13 @@ class PrimaiteGame:
for _, agent in self.agents.items():
obs = agent.observation_manager.current_observation
action_choice, options = agent.get_action(obs, timestep=self.step_counter)
agent_actions[agent.agent_name] = (action_choice, options)
request = agent.format_request(action_choice, options)
self.simulation.apply_request(request)
response = self.simulation.apply_request(request)
agent_actions[agent.agent_name] = {
"action": action_choice,
"parameters": options,
"response": response.model_dump(),
}
return agent_actions
def advance_timestep(self) -> None: