Skip to main content

mobile-env: An Open Environment for Autonomous Coordination in Wireless Mobile Networks

Project description

CI PyPI Documentation Open in Colab

mobile-env: An Open Environment for Autonomous Coordination in Mobile Networks

mobile-env is an open, minimalist OpenAI Gym environment for training and evaluating coordination algorithms in wireless mobile networks. The environment allows modeling users moving around an area and can connect to one or multiple base stations. Using the Gym interface, the environment can be used with any reinforcement learning framework (e.g., stable-baselines or Ray RLlib) or any custom (even non-RL) coordination approach. The environment is highly configurable and can be easily extended (e.g., regarding users, movement patterns, channel models, etc.).

mobile-env supports multi-agent and centralized reinforcement learning policies. It provides various choices for rewards and observations. mobile-env is also easily extendable, so that anyone may add another channel models (e.g. path loss), movement patterns, utility functions, etc.

As an example, mobile-env can be used to study multi-cell selection in coordinated multipoint. Here, it must be decided what connections should be established among user equipments (UEs) and base stations (BSs) in order to maximize Quality of Experience (QoE) globally. To maximize the QoE of single UEs, the UE intends to connect to as many BSs as possible, which yields higher (macro) data rates. However, BSs multiplex resources among connected UEs (e.g. schedule physical resource blocks) and, therefore, UEs compete for limited resources (conflicting goals). To maximize QoE globally, the policy must recognize that (1) the data rate of any connection is governed by the channel (e.g. SNR) between UE and BS and (2) QoE of single UEs not necessarily grows linearly with increasing data rate.


Base station icon by Clea Doltz from the Noun Project

Try mobile-env: Open in Colab

Documentation and API: ReadTheDocs

Installation

From PyPI (Recommended)

The simplest option is to install the latest release of mobile-env from PyPI using pip:

pip install mobile-env

This is recommended for most users. mobile-env is tested on Ubuntu, Windows, and MacOS.

From Source (Development)

Alternatively, for development, you can clone mobile-env from GitHub and install it from source. After cloning, install in "editable" mode (-e):

pip install -e .

This is equivalent to running pip install -r requirements.txt.

If you want to run tests or examples, also install the requirements in tests. For dependencies for building docs, install the requirements in docs.

Example Usage

import gym
import mobile_env

env = gym.make("mobile-medium-central-v0")
obs = env.reset()
done = False

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

Customization

mobile-env supports custom channel models, movement patterns, arrival & departure models, resource multiplexing schemes and utility functions. For example, replacing the default Okumura–Hata channel model by a (simplified) path loss model can be as easy as this:

import gym
import numpy as np
from mobile_env.core.base import MComCore
from mobile_env.core.channel import Channel


class PathLoss(Channel):
    def __init__(self, gamma, **kwargs):
        super().__init__(**kwargs)
        # path loss exponent
        self.gamma = gamma

    def power_loss(self, bs, ue):
        """Computes power loss between BS and UE."""
        dist = bs.point.distance(ue.point)
        loss = 10 * self.gamma * np.log10(4 * np.pi * dist * bs.frequency)
        return loss


# replace default channel model in configuration 
config = MComCore.default_config()
config['channel'] = PathLoss

# pass init parameters to custom channel class!
config['channel_params'].update({'gamma': 2.0})

# create environment with custom channel model
env = gym.make('mobile-small-central-v0', config=config)
# ...

About mobile-env

If you use mobile-env in your work, please cite with:

@misc{mobile-env,
  author = {Schneider, Stefan and Werner, Stefan and Karl, Holger},
  title = {An Open Environment for Autonomous Coordination in Mobile Networks},
  year = {2021},
  publisher = {GitHub},
  journal = {GitHub Repository},
  howpublished = {\url{https://github.com/stefanbschneider/mobile-env}},
}

mobile-env is based on DeepCoMP, providing the underlying environment as open, stand-alone platform to be used by others.

List of repositories, publications, or preprints using mobile-env (please open a pull request to add missing entries):

Contributing

Development: @stefanbschneider and @stwerner97

We happy if you find mobile-env useful. If you have feedback or want to report bugs, feel free to open an issue.

We also welcome contributions: Whether you implement a new channel model, fix a bug, or just make a minor addition elsewhere, feel free to open a pull request!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mobile-env-1.1.1.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

mobile_env-1.1.1-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

Details for the file mobile-env-1.1.1.tar.gz.

File metadata

  • Download URL: mobile-env-1.1.1.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for mobile-env-1.1.1.tar.gz
Algorithm Hash digest
SHA256 1fd59d3561dd9395b3535bfed817a2c6a7e88d8f78322fe0e1cf59ee1d98c1a3
MD5 076f9b558c3a83ef1ee338e133e61d69
BLAKE2b-256 e24e8594df86cc719056f09ad6c1525e28621e11d732354fc0b2d7655b2fb6e3

See more details on using hashes here.

File details

Details for the file mobile_env-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: mobile_env-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 27.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for mobile_env-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1d9357fc935b3baa5000e25752535fdf2bdf1a1cb291f1de725d94d5b72ff0e0
MD5 49294d7155dad5537577e1c7aba37f6f
BLAKE2b-256 99fc2e54221a93327c4affe2dfabf37c4d88dfd94fc4e394274cde2ee3099d0d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page