Vary start node of red agent.

This commit is contained in:
Marek Wolan
2024-02-08 09:19:18 +00:00
parent c35c060448
commit ff17062e1c
10 changed files with 745 additions and 46 deletions

View File

@@ -1,6 +1,6 @@
"""PrimAITE game - Encapsulates the simulation and agents."""
from ipaddress import IPv4Address
from typing import Dict, List
from typing import Dict, List, Tuple
from pydantic import BaseModel, ConfigDict
@@ -131,8 +131,14 @@ class PrimaiteGame:
agent.update_reward(state)
agent.reward_function.total_reward += agent.reward_function.current_reward
def apply_agent_actions(self) -> None:
"""Apply all actions to simulation as requests."""
def apply_agent_actions(self) -> Dict[str, Tuple[str, Dict]]:
"""
Apply all actions to simulation as requests.
:return: A recap of each agent's actions, in CAOS format.
:rtype: Dict[str, Tuple[str, Dict]]
"""
agent_actions = {}
for agent in self.agents:
obs = agent.observation_manager.current_observation