@@ -39,6 +39,7 @@ mutable struct StudyMultiObjectiveOptimizer{T<:Real} <: AbstractStudy
3939 dataframe:: Union{DataFrame,Missing}
4040 datafame_filtered:: Union{DataFrame,Missing}
4141 generation:: Int
42+ workflow:: Union{Function,Missing}
4243end
4344
4445function StudyMultiObjectiveOptimizer (
@@ -50,8 +51,7 @@ function StudyMultiObjectiveOptimizer(
5051 kw...
5152)
5253 sty = OverrideParameters (sty; kw... )
53- study = StudyMultiObjectiveOptimizer (sty, ini, act, constraint_functions, objective_functions, nothing , missing , missing , 0 )
54-
54+ study = StudyMultiObjectiveOptimizer (sty, ini, act, constraint_functions, objective_functions, nothing , missing , missing , 0 , missing )
5555 check_and_create_file_save_mode (sty)
5656
5757 parallel_environment (sty. server, sty. n_workers)
@@ -102,7 +102,6 @@ function _run(study::StudyMultiObjectiveOptimizer)
102102 @info " released workers"
103103
104104 else
105- setup (study)
106105 optimization_parameters = Dict (
107106 :N => sty. population_size,
108107 :iterations => sty. number_of_generations,
@@ -111,8 +110,12 @@ function _run(study::StudyMultiObjectiveOptimizer)
111110
112111 @assert ! isempty (sty. save_folder) " Specify where you would like to store your optimization results in sty.save_folder"
113112
113+ if ismissing (study. workflow)
114+ study. workflow = optimization_workflow_default
115+ end
116+
114117 study. state = workflow_multiobjective_optimization (
115- study. ini, study. act, ActorWholeFacility , study. objective_functions, study. constraint_functions;
118+ study. ini, study. act, study . workflow , study. objective_functions, study. constraint_functions;
116119 optimization_parameters... , generation_offset= study. generation, sty. database_policy,
117120 sty. number_of_generations, sty. population_size)
118121
@@ -233,4 +236,15 @@ function filter_outputs(outputs::DataFrame, constraint_symbols::Vector{Symbol})
233236 constraint_values = [outputs[i, key] for key in constraint_symbols, i in 1 : n]
234237 all_constraint_idxs = findall (i -> all (x -> x == 0.0 , constraint_values[:, i]), 1 : n)
235238 return outputs[all_constraint_idxs, :]
239+ end
240+
241+ """
242+ optimization_workflow_default(ini::ParametersAllInits, act::ParametersAllActors)
243+ Default optimization workflow when study.workflow isn't set, initializes and runs the whole facility actor
244+ """
245+ function optimization_workflow_default (ini:: ParametersAllInits , act:: ParametersAllActors )
246+ dd = FUSE. IMAS. dd ()
247+ FUSE. init (dd, ini, act)
248+ FUSE. ActorWholeFacility (dd, act)
249+ return dd
236250end
0 commit comments