Skip to content
Snippets Groups Projects
Unverified Commit a22f6ea1 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Ensure slew rate cost function is always a number

parent d9feb511
No related branches found
No related tags found
1 merge request!4Resolve "Add secondary objective function"
......@@ -74,6 +74,7 @@ function (::Type{Trapezoid})(; orientation=nothing, rise_time=nothing, flat_time
get_free_variable.(slew_rate),
group
)
add_cost_function!(-sum(abs(res.slew_rate)))
else
res = Trapezoid1D(
get_free_variable(rise_time),
......@@ -83,13 +84,13 @@ function (::Type{Trapezoid})(; orientation=nothing, rise_time=nothing, flat_time
group
)
apply_simple_constraint!(res.slew_rate, :>=, 0)
add_cost_function!(-res.slew_rate)
end
set_simple_constraints!(res, kwargs)
apply_simple_constraint!(res.flat_time, :>=, 0)
apply_simple_constraint!(res.rise_time, :>=, 0)
add_cost_function!(-res.slew_rate)
scanner_constraints!(res)
return res
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment