Skip to content

Commit

Permalink
Merge pull request #201 from stefanbschneider/dev
Browse files Browse the repository at this point in the history
Fix metrics writing
  • Loading branch information
Stefan Schneider authored Jan 6, 2021
2 parents b40ec18 + 3f90d94 commit 056ba61
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
'networkx==2.4',
'geopy',
'pyyaml>=5.1',
'numpy==1.16.4',
'numpy>=1.16.5',
'common-utils',
'cython', # otherwise sklearn fails
'sklearn',
'pandas',
'tensorflow==1.14.0',
Expand Down
2 changes: 2 additions & 0 deletions src/coordsim/writer/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ def write_network_state(self):
placement_output.append(placement_output_row)
self.placement_writer.writerows(placement_output)

# reset metrics for run
self.params.metrics.reset_run_metrics()
# Wait a timeout then write the states
yield self.env.timeout(self.params.run_duration)
yield self.env.process(self.write_network_state())
Expand Down
4 changes: 2 additions & 2 deletions src/siminterface/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ def apply(self, actions):
# Set it in the params of the instantiated simulator object.
# self.simulator.params.schedule = actions.scheduling

# reset metrics for steps
self.params.metrics.reset_run_metrics()
# reset metrics for steps; now done in result writer
# self.params.metrics.reset_run_metrics()

# Run the simulation again with the new params for the set duration.
# Due to SimPy restraints, we multiply the duration by the run times because SimPy does not reset when run()
Expand Down

0 comments on commit 056ba61

Please sign in to comment.