Skip to content

Base env cleanup#256

Merged
AboudyKreidieh merged 7 commits intomasterfrom
base_env_cleanup
Dec 4, 2018
Merged

Base env cleanup#256
AboudyKreidieh merged 7 commits intomasterfrom
base_env_cleanup

Conversation

@AboudyKreidieh
Copy link
Copy Markdown
Member

changes:

  • removed some traci calls from base_env
  • removed some things in base_env that are never used or called

@AboudyKreidieh AboudyKreidieh changed the title removed some traci calls Base env cleanup Nov 18, 2018
# check to make sure all vehicles have been spawned
if len(self.initial_ids) < self.vehicles.num_vehicles:
logging.error("Not enough vehicles have spawned! Bad start?")
exit()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this use sys.exit and return a nonzero value?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct, thanks for the catch!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eugenevinitsky

No problem!

@coveralls
Copy link
Copy Markdown

coveralls commented Nov 18, 2018

Pull Request Test Coverage Report for Build 1695

  • 10 of 12 (83.33%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.04%) to 84.507%

Changes Missing Coverage Covered Lines Changed/Added Lines %
flow/envs/base_env.py 9 11 81.82%
Files with Coverage Reduction New Missed Lines %
flow/envs/multiagent_env.py 1 69.23%
Totals Coverage Status
Change from base Build 1689: 0.04%
Covered Lines: 6671
Relevant Lines: 7894

💛 - Coveralls

vehicle in a sumo network with traci)
"""
# check to make sure all vehicles have been spawned
num_spawned_veh = self.traci_connection.simulation.getDepartedNumber()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this a bad check to have in place?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be specific, this is hit sometimes when your initial_config is invalid due to overlapping positions

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don’t worry, it was just shifted down. The check is still there.

@@ -261,7 +254,7 @@ def reset(self):
route_id,
typeID=str(type_id),
departLane=str(lane_index),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for copying this!

Copy link
Copy Markdown
Member

@eugenevinitsky eugenevinitsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM minus discussion as indicated

crystalzyan pushed a commit to crystalzyan/flow that referenced this pull request Dec 1, 2018
@AboudyKreidieh AboudyKreidieh merged commit e19d0ba into master Dec 4, 2018
@AboudyKreidieh AboudyKreidieh deleted the base_env_cleanup branch December 4, 2018 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants