Skip to content

The gym-cityflow environment is a multiagent domain featuring large discrete state and action spaces. An environment can be created from any set of cityflow config files

License

Notifications You must be signed in to change notification settings

MaxVanDijck/gym-cityflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gym-cityflow

gym_cityflow is a custom OpenAI gym environment designed to handle any CityFlow config file.

Prerequisites

  1. OpenAI Gym
  2. CityFlow

Installation

gym_cityflow can be installed by running the following at the root directory of the repository:

pip install -e .

gym_cityflow can then be used as a python library as follows:

Note: configPath must be a valid cityflow config.json file, episodeSteps is how many steps the environment will take before it is done

import gym
import gym_cityflow

env = gym.make(
    id='cityflow-v0', 
    configPath='sample_path/sample_config.json',
    episodeSteps=3600
)

Basic Functionality

The action and observation space can be checked like so:

observationSpace = env.observation_space
actionSpace = env.action_space

env.step() can be called to step the environment, it returns an observation, reward, done and debug as specified in the OpenAI Documentation

env.reset() can be called to restart the environment

observation, reward, done, debug = env.step(action=sampleAction)

if done:
    env.reset()

About

The gym-cityflow environment is a multiagent domain featuring large discrete state and action spaces. An environment can be created from any set of cityflow config files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages