From 172ad243e078a18d4b9738f8f803850edab78497 Mon Sep 17 00:00:00 2001 From: spiglerg <spiglerg@gmail.com> Date: Fri, 28 Jun 2019 14:11:22 +0000 Subject: [PATCH] Update README.rst --- README.rst | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index 4d0cb2ab..7a254b97 100644 --- a/README.rst +++ b/README.rst @@ -46,6 +46,7 @@ Online Docs ------------ The documentation for the latest code on the master branch is found at `http://flatland-rl-docs.s3-website.eu-central-1.amazonaws.com/ <http://flatland-rl-docs.s3-website.eu-central-1.amazonaws.com/>`_ +The documentation includes a few tutorials in http://flatland-rl-docs.s3-website.eu-central-1.amazonaws.com/gettingstarted.html. Run Notebooks with Examples with one Click ------------------------------------------ @@ -81,12 +82,6 @@ The docs have a lot more details about how to interact with this codebase. python make_docs.py -Features --------- - -TODO - - Installation ============ @@ -115,6 +110,27 @@ Once you have a copy of the source, you can install it with :: $ python setup.py install +Basic Usage +============ + +Basic usage of the RailEnv environment used by the Flatland Challenge :: + + import numpy as np + import time + from flatland.envs.generators import complex_rail_generator + from flatland.envs.rail_env import RailEnv + from flatland.utils.rendertools import RenderTool + + env = RailEnv(width=7, height=7, rail_generator=complex_rail_generator(nr_start_goal=10, nr_extra=1, min_dist=8, max_dist=99999, seed=0), number_of_agents=2) + + env_renderer = RenderTool(env, gl="PILSVG") + + for step in range(100): + obs, all_rewards, done, _ = env.step({0:np.random.randint(0, 5), 1:np.random.randint(0, 5)}) + print("Rewards: ", all_rewards, " [done=", done, "]") + env_renderer.renderEnv(show=True, frames=False, show_observations=False) + time.sleep(0.3) + Jupyter Canvas Widget --------------------- -- GitLab