Skip to content

Commit

Permalink
Merge pull request #65 from jerryz123/coverage
Browse files Browse the repository at this point in the history
Added coverage
  • Loading branch information
jerryz123 committed Jul 9, 2018
2 parents bff2cb5 + e9b7816 commit f952bd0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
14 changes: 12 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@ python:
- "3.6"
# command to install dependencies
install:
- pip install -e .
- pip install sphinx==1.6.5 recommonmark sphinx_rtd_theme
- pip install -e .
- pip install sphinx==1.6.5 recommonmark sphinx_rtd_theme pyyaml coveralls
# command to run tests
script:
- cd docs && make html
- python -m fluids --time 100 -v 0 -o birdseye
- python -m fluids --time 100 -v 0 -o grid
- python -m fluids --time 100 -v 0 -o none
- coverage run -a --source fluids -m fluids --time 100 -v 0 -o birdseye
- coverage run -a --source fluids -m fluids --time 100 -v 0 -o grid
- coverage run -a --source fluids -m fluids --time 100 -v 0 -o none

after_success:
- coveralls


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Documentation Status](https://readthedocs.org/projects/urban-driving-simulator/badge/?version=v2)](https://urban-driving-simulator.readthedocs.io/en/v2/?badge=v2) [![Build Status](https://travis-ci.org/BerkeleyAutomation/Urban_Driving_Simulator.svg?branch=v2)](https://travis-ci.org/BerkeleyAutomation/Urban_Driving_Simulator)
[![Documentation Status](https://readthedocs.org/projects/urban-driving-simulator/badge/?version=v2)](https://urban-driving-simulator.readthedocs.io/en/v2/?badge=v2) [![Build Status](https://travis-ci.org/BerkeleyAutomation/Urban_Driving_Simulator.svg?branch=v2)](https://travis-ci.org/BerkeleyAutomation/Urban_Driving_Simulator) [![Coverage Status](https://coveralls.io/repos/github/BerkeleyAutomation/Urban_Driving_Simulator/badge.svg?branch=v2)](https://coveralls.io/github/BerkeleyAutomation/Urban_Driving_Simulator?branch=v2)

# FLUIDS 2.0

Expand Down
11 changes: 9 additions & 2 deletions fluids/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
parser.add_argument('-o', metavar='str', type=str, default="birdseye",
choices=["none", "birdseye", "grid"],
help='Observation type')
parser.add_argument('--time', metavar='N', type=int, default=0,
help="Max time to run simulation")
parser.add_argument('--state', metavar='file', type=str, default=fluids.STATE_CITY,
help='Layout file for state generation')

Expand All @@ -33,6 +35,7 @@
fluids_print(" Visualization level : {}".format(args.v))
fluids_print(" Observation type : {}".format(args.o))
fluids_print(" Scene layout : {}".format(args.state))
fluids_print(" Simulation time : {}".format("unlimited" if not args.time else args.time))
fluids_print("")


Expand All @@ -46,8 +49,12 @@
background_peds =args.p,
fps =0,
obs_space =obs,
background_control =fluids.BACKGROUND_CSP)
while True:
background_control =fluids.BACKGROUND_CSP)

t = 0
while not args.time or t < args.time:
actions = {k: fluids.KeyboardAction() for k in simulator.get_control_keys()}
rew = simulator.step(actions)
obs = simulator.get_observations(simulator.get_control_keys())
t = t + 1

0 comments on commit f952bd0

Please sign in to comment.