Skip to content

Commit b56c91b

Browse files
committed
init
1 parent 33bfbf6 commit b56c91b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/MOI_wrapper.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,11 @@ function input_indices(model::Optimizer)
397397
end
398398

399399
function setup!(model::Optimizer)
400+
if any(isnothing, model.dynamic)
401+
error("Missing dynamics. i.e. ∂(x) = f(x, u) or Δ(x) = f(x, u)")
402+
end
403+
404+
println(">>Setting up the model")
400405
input_index = 0
401406
state_index = 0
402407
model.nlp_model = MOI.Nonlinear.Model()
@@ -420,6 +425,7 @@ function setup!(model::Optimizer)
420425
vars = MOI.VariableIndex.(eachindex(model.lower))
421426
model.evaluator = MOI.Nonlinear.Evaluator(model.nlp_model, backend, vars)
422427
MOI.initialize(model.evaluator, Symbol[])
428+
println(">>Model setup complete")
423429
return
424430
end
425431

src/optim/abstraction/uniform_grid_abstraction.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,14 @@ function discretized_system(
146146
end
147147

148148
function build_abstraction(concrete_system, model)
149+
if isnothing(model.state_grid)
150+
error("Please set the `state_grid`.")
151+
end
152+
153+
if isnothing(model.input_grid)
154+
error("Please set the `input_grid`.")
155+
end
156+
149157
Xfull = DO.DomainList(model.state_grid)
150158
DO.add_set!(Xfull, concrete_system.X, DO.INNER)
151159
Ufull = DO.DomainList(model.input_grid)

0 commit comments

Comments
 (0)