Giter Club home page Giter Club logo

rlevator's Introduction

RLevator

A dynamic elevator control algorithm trained using reinforcement learning.

RLevator         Karps

Created for the CS 229 Fall 2022 final project by Tejas Narayanan and Kiran Bhat. Read the paper here.

Installation instructions

RLevator was developed using Python 3.10. To install all dependencies, run pip install -r requirements.txt.

Running RLevator

Training an agent

To train an agent, run python train_elevator_agent.py. Argument details are as follows:

usage: train_elevator_agent.py [-h] [--num_floors_start NUM_FLOORS_START] [--num_floors_end NUM_FLOORS_END] [--timesteps TIMESTEPS] [--seed SEED] [--verbose VERBOSE]

options:
  -h, --help            show this help message and exit
  --num_floors_start NUM_FLOORS_START, -nfs NUM_FLOORS_START
                        Number of floors at start
  --num_floors_end NUM_FLOORS_END, -nfe NUM_FLOORS_END
                        Number of floors at end
  --timesteps TIMESTEPS, -t TIMESTEPS
                        Number of timesteps to train
  --seed SEED, -s SEED  Random seed to use
  --verbose VERBOSE, -v VERBOSE
                        Verbosity (0 or 1)

To monitor training progress, run tensorboard --logdir tensorboard.

When num_floors_end > num_floors_start, curriculum learning is applied to progressively increase the complexity of the environment.

This program will train an agent and save it to a path corresponding to the environment parameters. This path is printed at the beginning of training, and can be passed into the benchmarking script to evaluate performance.

Benchmarking agents

To compare the performance of trained agents to the standard elevator control algorithm, run python benchmark_agents.py -n NUM_FLOORS --models MODEL_1_PATH MODEL_2_PATH .... Argument details are as follows:

usage: benchmark_agents.py [-h] [--num_floors NUM_FLOORS] --models MODELS [MODELS ...]

options:
  -h, --help            show this help message and exit
  --num_floors NUM_FLOORS, -n NUM_FLOORS
                        number of floors for environment
  --models MODELS [MODELS ...], -m MODELS [MODELS ...]
                        Paths to models to be evaluated. Example path: models/env_v7/elev1-1_floor3-3_rand1/dd23f6.zip
  --animation_delay ANIMATION_DELAY, -a ANIMATION_DELAY
                        Animation delay (in seconds) between timesteps. Larger delay -> slower animation. Animation is off by default.
                        

This program will evaluate the models provided, along with the standard control algorithm, and provide the mean and standard deviation of episodic rewards for each model.

rlevator's People

Contributors

tnarayanan avatar kiranvbhat avatar

Watchers

James Cloos avatar  avatar Kostas Georgiou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.