-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
internal devModification to the code is requested and should not affect user experimentModification to the code is requested and should not affect user experiment
Description
function build_adnlp_model(
initial_guess::CTModels.AbstractOptimalControlInitialGuess;
backend,
kwargs...
)::ADNLPModels.ADNLPModel
.....
# build NLP
nlp = ADNLPModel!(
f,
init,
docp.bounds.var_l,
docp.bounds.var_u,
c!,
docp.bounds.con_l,
docp.bounds.con_u;
minimize=(!docp.flags.max),
backend_options...,
unused_backends...,
kwargs...,
)
return nlp
end
# NLP builder for ExaModels
# +++ recheck kwargs passing / default with Olivier
function build_exa_model(
::Type{BaseType},
initial_guess::CTModels.AbstractOptimalControlInitialGuess;
backend
)::ExaModels.ExaModel where {BaseType<:AbstractFloat}
# recover discretization scheme and size
scheme = Strategies.options(discretizer)[:scheme]
grid_size = Strategies.options(discretizer)[:grid_size]
# build initial guess
init = get_docp_initial_guess(:exa, docp, initial_guess)
# build Exa model and getters
# +++ later try to call Exa constructor here if possible, reusing existing functions...
build_exa = CTModels.get_build_examodel(ocp)
nlp, exa_getter = build_exa(;
grid_size=grid_size,
backend=backend,
scheme=scheme,
init=init,
base_type=BaseType,
)
return nlp
endReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
internal devModification to the code is requested and should not affect user experimentModification to the code is requested and should not affect user experiment