Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit a17b21f

Browse files
modify
1 parent f984fa9 commit a17b21f

File tree

3 files changed

+2
-109
lines changed

3 files changed

+2
-109
lines changed

controllers/marl/marl.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
import rllib
21
from marllib import marl
32

4-
ENV_REGISTRY = {}
5-
ENV_REGISTRY["soccer"] = rllib.RLlibSoccer
6-
73
env = marl.make_env(environment_name="soccer", map_name="soccer")
84
mappo = marl.algos.mappo(hyperparam_source="test")
95
model = marl.build_model(env, mappo, {"core_arch": "mlp", "encode_layer": "128-256"})

controllers/marl/rllib.py

-103
This file was deleted.

controllers/marl/soccer/soccer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def observe(self, agent):
114114
obs[2] = -obs[2]
115115
obs[3] = -obs[3]
116116
obs[4] = normalize_angle_rad(obs[4]+math.pi)
117-
return obs
117+
return np.array(obs)
118118

119119
def state(self):
120120
ball_x, ball_y, _ = self.ball_pos.getSFVec3f()
@@ -125,7 +125,7 @@ def state(self):
125125
player.append(self.agent_list[i].pos)
126126
state = [ball_x, ball_y, 0, player[0][0], player[0][1], player[0][2], player[1][0], player[1][1], player[1][2], player[2][0], player[2][1], player[2][2], player[3][0], player[3][1], player[3][2], player[4][0], player[4][1], player[4][2], player[5][0], player[5][1], player[5][2]]
127127
#state = [ball_x, ball_y, 0, player[0][0], player[0][1], player[0][2]]
128-
return state
128+
return np.array(state)
129129

130130
def step(self, action):
131131
if self.terminations[self.agent_selection] or self.truncations[self.agent_selection]:

0 commit comments

Comments
 (0)