# MARL mapping policy examples not working

**URL:** <https://discuss.ray.io/t/marl-mapping-policy-examples-not-working/9081>\
**Category:** RLlib\
**Created:** [January 23, 2023, 8:06pm UTC](https://discuss.ray.io/t/marl-mapping-policy-examples-not-working/9081 "2023-01-23T20:06:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Username1](https://avatars.discourse-cdn.com/v4/letter/u/ee59a6/32.png) [@Username1](https://discuss.ray.io/u/Username1)\
**Post date:** [January 23, 2023, 8:06pm UTC](https://discuss.ray.io/t/marl-mapping-policy-examples-not-working/9081/1 "2023-01-23T20:06:14Z")

</div>

_How severe does this issue affect your experience of using Ray?_\*

- High

I am searching for a MARL example where 5 agents share the same policy and the same action and observation space. However, both are made of tuples.

Like this:

```auto
  act_space = Tuple([Discrete(10), Discrete(2)]) 
  obs_space = Tuple([Discrete(10), Discrete(2)]) 
  self.action_space = {agent: act_space for agent in range(self.num_agents)}
  self.observation_space = {agent: obs_space for agent in range(self.num_agents)}

```

I am getting the following error:

```auto
raise ValueError(
ValueError: `observation_space` not provided in PolicySpec for default_policy and env does not have an observation space OR no spaces received from other workers' env(s) OR no `observation_space` specified in config!

```

Then, I’ve tried to run the official example scripts and got the same error:

when I try to run this example:

> <https://github.com/ray-project/ray/blob/master/rllib/examples/coin_game_env.py>

I get the following error:

`AttributeError: 'AsymCoinGame' object has no attribute 'observation_space'`

I have also tried to run this script getting the same error:

> <https://github.com/ray-project/ray/blob/master/rllib/examples/multi_agent_different_spaces_for_agents.py>

after fixing for typos: [Line 61- an extra {}](https://github.com/ray-project/ray/blob/76364c7d9635db6307cd0e0cfcfc761f46510bd5/rllib/examples/multi_agent_different_spaces_for_agents.py#L61) and [Line 72 - misspeling of ‘truncated’](https://github.com/ray-project/ray/blob/76364c7d9635db6307cd0e0cfcfc761f46510bd5/rllib/examples/multi_agent_different_spaces_for_agents.py#L72l)

---

<div class="post-metadata">

**Author:** ![arturn](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/arturn/32/2096_2.png) [@arturn](https://discuss.ray.io/u/arturn)\
**Post date:** [March 8, 2023, 11:55pm UTC](https://discuss.ray.io/t/marl-mapping-policy-examples-not-working/9081/2 "2023-03-08T23:55:27Z")

</div>

Hi @Username1 ,

I have opened a fixing PR: [[RLlib] Make coingame a tests again by ArturNiederfahrenhorst · Pull Request #33156 · ray-project/ray · GitHub](https://github.com/ray-project/ray/pull/33156)  
You can see the “solution” there or run on master soon to retrieve the correct code.

---

<div class="post-metadata">

**Author:** ![Username1](https://avatars.discourse-cdn.com/v4/letter/u/ee59a6/32.png) [@Username1](https://discuss.ray.io/u/Username1)\
**Post date:** [April 5, 2023, 5:25pm UTC](https://discuss.ray.io/t/marl-mapping-policy-examples-not-working/9081/3 "2023-04-05T17:25:32Z")

</div>

Thank you very much !
