Skip to content

Commit

Permalink
Pass all trials to tell_trials
Browse files Browse the repository at this point in the history
  • Loading branch information
shuds13 committed Nov 8, 2024
1 parent 72fce60 commit f58ab4e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions optimas/gen_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def persistent_generator(H, persis_info, gen_specs, libE_info):
# Check how many simulations have returned
n = len(calc_in["sim_id"])
# Feed the latest simulation results to the generator
trials = []
for i in range(n):
trial_index = int(calc_in["trial_index"][i])
trial_status = calc_in["trial_status"][i]
Expand All @@ -107,8 +108,11 @@ def persistent_generator(H, persis_info, gen_specs, libE_info):
y = calc_in[par.name][i]
ev = Evaluation(parameter=par, value=y)
trial.complete_evaluation(ev)
# Register trial with unknown SEM
generator.tell_trials([trial])
trials.append(trial)

# Register trial with unknown SEM
generator.tell_trials(trials)

# Set the number of points to generate to that number:
number_of_gen_points = min(n + n_failed_gens, max_evals - n_gens)
n_failed_gens = 0
Expand Down

0 comments on commit f58ab4e

Please sign in to comment.