|
5 | 5 | # --------------------------------------------------------------------------- |
6 | 6 | # Collocation discretizer |
7 | 7 | # --------------------------------------------------------------------------- |
8 | | -struct Collocation <: AbstractOptimalControlDiscretizer |
| 8 | +struct Collocation <: AbstractDiscretizer |
9 | 9 | options::Strategies.StrategyOptions |
10 | 10 | end |
11 | 11 |
|
@@ -56,7 +56,7 @@ Strategies.options(c::Collocation) = c.options |
56 | 56 | # ========================================================================================== |
57 | 57 | # Build core DOCP structure with discretization information (ADNLP) |
58 | 58 | # ========================================================================================== |
59 | | -function get_docp(discretizer::Collocation, ocp::AbstractOptimalControlProblem) |
| 59 | +function get_docp(discretizer::Collocation, ocp::AbstractModel) |
60 | 60 |
|
61 | 61 | # recover discretization scheme and options |
62 | 62 | scheme = Strategies.options(discretizer)[:scheme] |
|
77 | 77 | # Build initial guess for discretized problem |
78 | 78 | # ========================================================================================== |
79 | 79 | function get_docp_initial_guess(modeler::Symbol, docp, |
80 | | - initial_guess::Union{CTModels.AbstractOptimalControlInitialGuess,Nothing}, |
| 80 | + initial_guess::Union{CTModels.AbstractInitialGuess,Nothing}, |
81 | 81 | ) |
82 | 82 |
|
83 | 83 | ocp = ocp_model(docp) |
@@ -117,19 +117,19 @@ function get_docp_initial_guess(modeler::Symbol, docp, |
117 | 117 | # ========================================================================================== |
118 | 118 | # Build discretizer API (return sets of model/solution builders) |
119 | 119 | # ========================================================================================== |
120 | | -function (discretizer::Collocation)(ocp::AbstractOptimalControlProblem) |
| 120 | +function (discretizer::Collocation)(ocp::AbstractModel) |
121 | 121 |
|
122 | 122 | # common parts for builders |
123 | 123 | docp = get_docp(discretizer, ocp) |
124 | 124 | exa_getter = nothing # will be set in build_exa_model |
125 | 125 |
|
126 | 126 | # ========================================================================================== |
127 | | - # The needed builders for the construction of the final DiscretizedOptimalControlProblem |
| 127 | + # The needed builders for the construction of the final DiscretizedModel |
128 | 128 | # ========================================================================================== |
129 | 129 |
|
130 | 130 | # NLP builder for ADNLPModels |
131 | 131 | function build_adnlp_model( |
132 | | - initial_guess::CTModels.AbstractOptimalControlInitialGuess; |
| 132 | + initial_guess::CTModels.AbstractInitialGuess; |
133 | 133 | backend, |
134 | 134 | kwargs... |
135 | 135 | )::ADNLPModels.ADNLPModel |
@@ -211,7 +211,7 @@ function (discretizer::Collocation)(ocp::AbstractOptimalControlProblem) |
211 | 211 | # NLP builder for ExaModels |
212 | 212 | function build_exa_model( |
213 | 213 | ::Type{BaseType}, |
214 | | - initial_guess::CTModels.AbstractOptimalControlInitialGuess; |
| 214 | + initial_guess::CTModels.AbstractInitialGuess; |
215 | 215 | backend |
216 | 216 | )::ExaModels.ExaModel where {BaseType<:AbstractFloat} |
217 | 217 |
|
@@ -260,7 +260,7 @@ function (discretizer::Collocation)(ocp::AbstractOptimalControlProblem) |
260 | 260 | end |
261 | 261 |
|
262 | 262 | #NB. it would be better to return builders as model/solution pairs since they are linked |
263 | | - return CTSolvers.DiscretizedOptimalControlProblem( |
| 263 | + return CTSolvers.DiscretizedModel( |
264 | 264 | ocp, |
265 | 265 | CTSolvers.ADNLPModelBuilder(build_adnlp_model), |
266 | 266 | CTSolvers.ExaModelBuilder(build_exa_model), |
|
0 commit comments