Files
Gym_CPU/agent/__pycache__/base_agent.cpython-311.pyc

47 lines
4.0 KiB
Plaintext
Raw Normal View History

2026-03-10 09:31:39 -04:00
<EFBFBD>
è<>i
<00><00><><00>ddlZddlmZddlmZmZddlmZddlm Z ddl
m Z ddl m Z eje<0F><00>ZGd<08>d <09><00>ZdS)
<EFBFBD>N)<01>Agent)<02>T1<54>Robot)<01>BehaviorManager)<01>World)<01>Server)<01> WorldParserc <00>B<00>eZdZ ddededed ed
ef
d <0B>Zd <0C>Zd <0A>ZdS)<10>
Base_Agent<EFBFBD>Default<6C><00> localhost<73>`<60><00>fifa<66> team_name<6D>number<65>host<73>port<72>fieldc<00><00>t||||<05><01><00>|_t|<00><02><00>|_t |||j<00><03><00>|_t |<00><02><00>|_t|<00><02><00>|_ t|<00><02><00>|_ dS)a<>
Initializes the agent and all its main components.
Args:
team_name (str): The name of the team the agent belongs to.
number (int): The player number assigned to this agent.
host (str): The host address of the simulator server.
port (int): The port number of the simulator server.
field (str): The name of the field configuration to use.
)<04>agentrr<00>
field_name)r)rr<00> world_parserN) r<00>worldr rr<00>serverr<00>robotr<00>skills_managerr<00>decision_maker)<06>selfrrrrrs <20>0/home/miku/Downloads/Code/SE/agent/base_agent.py<70>__init__zBase_Agent.__init__s<><00><00>&"<22><04> <09>&<26>]b<>c<>c<>c<><04>
<EFBFBD>)4<>4<EFBFBD>)@<40>)@<40>)@<40><04><19>$<24><15>D<EFBFBD>t<EFBFBD>/@<40>
<EFBFBD>
<EFBFBD>
<EFBFBD><04> <0B><1F>T<EFBFBD>N<EFBFBD>N<EFBFBD>N<EFBFBD><04>
<EFBFBD>/><3E>T<EFBFBD>/J<>/J<>/J<><04><1B>%*<2A><14>%6<>%6<>%6<><04><1B><1B><1B>c <00><><00>|j<00><00><00>|j<00>d|jj<00>d|jj<00>d|jj<00>d<03><07><00> |j<00><00><00>|j<00> <00><00>|j
<00> <00><00>|j<00> <00><00>n##t$r|<00><00><00><00>wxYw<01><>)u<>
Starts the agents main control loop.
This method:
1. Connects to the simulator server.
2. Sends the initial configuration (init message).
3. Enters the main loop, where it:
- Receives and parses world updates.
- Updates internal world representation.
- Executes the decision-making process.
- Sends the next set of commands to the server.
z(init <20> <20>))r<00>connect<63>send_immediater<00>namerrr<00>receive<76>updater<00>update_current_behavior<6F>send<6E> Exception<6F>shutdown<77>rs r <00>runzBase_Agent.run*s<><00><00> <0A> <0B><1B><1B><1D><1D><1D> <0C> <0B>"<22>"<22> R<>T<EFBFBD>Z<EFBFBD>_<EFBFBD> R<> R<>t<EFBFBD>z<EFBFBD>';<3B> R<> R<>d<EFBFBD>j<EFBFBD>>O<> R<> R<> R<>
<EFBFBD>
<EFBFBD>
<EFBFBD> <16>
<16><14> <0B>#<23>#<23>%<25>%<25>%<25><14>
<EFBFBD>!<21>!<21>#<23>#<23>#<23><14>#<23>;<3B>;<3B>=<3D>=<3D>=<3D><14> <0B> <20> <20>"<22>"<22>"<22>"<22><><1C> <16> <16> <16><14> <0A> <0A><0F><0F><0F><15> <16><><EFBFBD><EFBFBD> s <00>A$C<00> C#c<00>l<00>t<00>d<01><00>|j<00><00><00>dS)zq
Safely shuts down the agent.
Logs a shutdown message and closes the server connection.
zShutting down.N)<04>logger<65>inforr.r/s r r.zBase_Agent.shutdownJs1<00><00> <0F> <0B> <0B>$<24>%<25>%<25>%<25> <0C> <0B><1C><1C><1E><1E><1E><1E>r"N)r r rrr)<08>__name__<5F>
__module__<EFBFBD> __qualname__<5F>str<74>intr!r0r.<00>r"r r r s<><00><00><00><00><00><00>'<27><1B>#<23><1D><1F> 7<>7<><1A>7<><18>7<><16> 7<>
<16> 7<> <17> 7<>7<>7<>7<>8<16><16><16>@<1F><1F><1F><1F>r"r )<12>logging<6E> agent.agentr<00> world.robotrr<00>behaviors.behavior_managerr<00> world.worldr<00>communication.serverr<00>world.world_parserr <00> getLogger<65>__file__r2r r9r"r <00><module>rCs<><00><01><0E><0E><0E><0E><1D><1D><1D><1D><1D><1D>!<21>!<21>!<21>!<21>!<21>!<21>!<21>!<21>6<>6<>6<>6<>6<>6<><1D><1D><1D><1D><1D><1D>'<27>'<27>'<27>'<27>'<27>'<27>*<2A>*<2A>*<2A>*<2A>*<2A>*<2A> <1A><17> <1A>8<EFBFBD> $<24> $<24><06>D<1F>D<1F>D<1F>D<1F>D<1F>D<1F>D<1F>D<1F>D<1F>Dr"