git clone https://github.com/kbys-t/gym_MA.git
cd gym_MA
pip install -e .
-
First of all,
import gym_multiagent
-
Select environment from
["MoveFormMA-v0", "MoveFormMA-v1"]
ENV_NAME = "MoveFormMA-v0"
env = gym.make(ENV_NAME)
- Prepare agents
age = []
for i in range(env.AGE_NUM):
age.append( some_agent() )
- Send listed actions and Get listed observations and rewards for all agents together
observation, reward, done, info = env.step(action)
for i in range(env.AGE_NUM):
age[i].set_State(observation[i])
age[i].update(reward[i])
action[i] = age[i].get_Action()