Gym Predator Prey Environment in Terminal

Multi Agent Environment in Terminal

Introduction

Gym is the most widely used environment framework for reinforcement learning . There are several multiagent envrionemts, but this environment has properties:

  1. The meta-learning predator-prey environment with different action space
  2. Rendering with python default library in terminal!

Demo of an environment with rendering!

This mini-project is reinforcement learning environment of task predator and prey. One particular interesting property is that there are 3 types of environments (discrete, continuous, and grid). one hot representation, continuos, and 2d spaces The environment is designed to train a model in environments with different representations but common goals. You can use different action space and observation space to represent the environment easily.

Code Examples

from gym_predator_prey import env_creator env = env_creator({ "env":"discrete", # [grid, continuous, discrete] "n_predators":4, # number of predators "n_preys": 10, # number of preys "width":20, # map width size "height":10, # map height size "predator_range":2, # the range of predator "predator_max_speed":2, # the maximum speed of predator "prey_max_speed" : 1 # the minimum speed of predator })

Basic information in Discrete environment

Predator ðŸĶ

Prey 🐔

Map 🗚

The information on rendered screen