22
33from rcrs_core .agents .agent import Agent
44from rcrs_core .commands .Command import Command
5+ from rcrs_core .config .config import Config as RCRSConfig
56from rcrs_core .worldmodel .changeSet import ChangeSet
67
78from adf_core_python .core .agent .action .action import Action
1415from adf_core_python .core .agent .module .module_manager import ModuleManager
1516from adf_core_python .core .agent .precompute .precompute_data import PrecomputeData
1617from adf_core_python .core .component .tactics .tactics_agent import TacticsAgent
18+ from adf_core_python .core .config .config import Config
1719
1820
1921class Platoon (Agent ):
@@ -53,7 +55,21 @@ def post_connect(self) -> None:
5355 # self._mode = Mode.NON_PRECOMPUTE
5456 self ._mode = Mode .NON_PRECOMPUTE
5557
56- self ._scenario_info : ScenarioInfo = ScenarioInfo (self .config , self ._mode ) # type: ignore
58+ config = Config ()
59+ if self .config is not None :
60+ rcrc_config : RCRSConfig = self .config
61+ for key , value in rcrc_config .data .items ():
62+ config .set_value (key , value )
63+ for key , value in rcrc_config .int_data .items ():
64+ config .set_value (key , value )
65+ for key , value in rcrc_config .float_data .items ():
66+ config .set_value (key , value )
67+ for key , value in rcrc_config .boolean_data .items ():
68+ config .set_value (key , value )
69+ for key , value in rcrc_config .array_data .items ():
70+ config .set_value (key , value )
71+
72+ self ._scenario_info : ScenarioInfo = ScenarioInfo (config , self ._mode )
5773 self ._module_manager : ModuleManager = ModuleManager (
5874 self ._agent_info ,
5975 self ._world_info ,
@@ -88,6 +104,8 @@ def post_connect(self) -> None:
88104 )
89105
90106 def think (self , time : int , change_set : ChangeSet , hear : list [Command ]) -> None :
107+ self ._agent_info .set_change_set (change_set )
108+ self ._world_info .set_change_set (change_set )
91109 action : Action = self ._tactics_agent .think (
92110 self ._agent_info ,
93111 self ._world_info ,
@@ -99,4 +117,4 @@ def think(self, time: int, change_set: ChangeSet, hear: list[Command]) -> None:
99117 )
100118 if action is not None and self .agent_id is not None :
101119 self ._agent_info .set_executed_action (time , action )
102- self .send_msg (action .get_command (self .agent_id , time ))
120+ self .send_msg (action .get_command (self .agent_id , time ). prepare_cmd () )
0 commit comments