Gym is the most widely used environment framework for reinforcement learning . There are several multiagent envrionemts, but this environment has properties:
The meta-learning predator-prey environment with different action space
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 ðĶ
action_space : {no-op, left, bottom, up, right} x [0~max_speed]
observation_space : full information
reward : -1 for each time step / 100 when prey is caught
Prey ð
action_space : {no-op, left, bottom, up, right} x [0~max_speed]