Examples

Example on Google Colab

We provide an in-depth example of mobile-env’s usage on Google Colab! The notebook shows how to train multi-agent reinforcement learning policies with RLlib and centralized control policies with stable-baselines3.

Open in colab

Environment Creation

mobile-env follows the Gymnasium interface. Here is an example of how mobile-env’s environments can be created:

import gymnasium
import mobile_env

# small environment; centralized control
env = gymnasium.make('mobile-small-central-v0')

# large environment; centralized control
env = gymnasium.make('mobile-large-central-v0')

# small environment; multi-agent control
env = gymnasium.make('mobile-large-ma-v0')
...

# then run the environment
obs, info = env.reset()
done = False

while not done:
    action = ... # Your agent code here
    obs, reward, terminated, truncated, info = env.step(action)
    done = terminated or truncated
    env.render()