Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 391106e8 authored by VIDEAU Mathurin's avatar VIDEAU Mathurin
Browse files

Update utils.py

parent d1d3530d
No related branches found
No related tags found
No related merge requests found
...@@ -35,9 +35,9 @@ def convert_logbook_to_dataframe(logbook): ...@@ -35,9 +35,9 @@ def convert_logbook_to_dataframe(logbook):
df[k] = d df[k] = d
return df return df
def basic_budget_scheduler(gen_threshold):# list of tuple (genertion, simulation_budget) def basic_budget_scheduler(gen_threshold):# list of tuple (generation, simulation_budget)
def scheduler(gen, population, simulation_budget, parallel_update): def scheduler(gen, population, simulation_budget, parallel_update):
for g, v in gen_threshold: for g, v in reversed(gen_threshold):
if gen>g: if gen>g:
return v, parallel_update return v, parallel_update
return simulation_budget, parallel_update return simulation_budget, parallel_update
...@@ -49,4 +49,4 @@ def save_each_generation(path, modulo=10): ...@@ -49,4 +49,4 @@ def save_each_generation(path, modulo=10):
if i%modulo == 0: if i%modulo == 0:
with open(os.path.join(path,"data-"+str(i)+".pkl"), "wb") as input_file: with open(os.path.join(path,"data-"+str(i)+".pkl"), "wb") as input_file:
pickle.dump(data, input_file, pickle.HIGHEST_PROTOCOL) pickle.dump(data, input_file, pickle.HIGHEST_PROTOCOL)
return save return save
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment