diff --git a/setup.py b/setup.py index 8ebefbe7a..e3f53d5af 100644 --- a/setup.py +++ b/setup.py @@ -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', diff --git a/src/coordsim/writer/writer.py b/src/coordsim/writer/writer.py index b84770230..bf5818e66 100644 --- a/src/coordsim/writer/writer.py +++ b/src/coordsim/writer/writer.py @@ -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()) diff --git a/src/siminterface/simulator.py b/src/siminterface/simulator.py index 4bb6cba81..f9674717c 100644 --- a/src/siminterface/simulator.py +++ b/src/siminterface/simulator.py @@ -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()