Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MRIBuilder.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michiel Cottaar
MRIBuilder.jl
Commits
a22f6ea1
Unverified
Commit
a22f6ea1
authored
7 months ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Ensure slew rate cost function is always a number
parent
d9feb511
No related branches found
No related tags found
1 merge request
!4
Resolve "Add secondary objective function"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/parts/trapezoids.jl
+2
-1
2 additions, 1 deletion
src/parts/trapezoids.jl
with
2 additions
and
1 deletion
src/parts/trapezoids.jl
+
2
−
1
View file @
a22f6ea1
...
@@ -74,6 +74,7 @@ function (::Type{Trapezoid})(; orientation=nothing, rise_time=nothing, flat_time
...
@@ -74,6 +74,7 @@ function (::Type{Trapezoid})(; orientation=nothing, rise_time=nothing, flat_time
get_free_variable
.
(
slew_rate
),
get_free_variable
.
(
slew_rate
),
group
group
)
)
add_cost_function!
(
-
sum
(
abs
(
res
.
slew_rate
)))
else
else
res
=
Trapezoid1D
(
res
=
Trapezoid1D
(
get_free_variable
(
rise_time
),
get_free_variable
(
rise_time
),
...
@@ -83,13 +84,13 @@ function (::Type{Trapezoid})(; orientation=nothing, rise_time=nothing, flat_time
...
@@ -83,13 +84,13 @@ function (::Type{Trapezoid})(; orientation=nothing, rise_time=nothing, flat_time
group
group
)
)
apply_simple_constraint!
(
res
.
slew_rate
,
:>=
,
0
)
apply_simple_constraint!
(
res
.
slew_rate
,
:>=
,
0
)
add_cost_function!
(
-
res
.
slew_rate
)
end
end
set_simple_constraints!
(
res
,
kwargs
)
set_simple_constraints!
(
res
,
kwargs
)
apply_simple_constraint!
(
res
.
flat_time
,
:>=
,
0
)
apply_simple_constraint!
(
res
.
flat_time
,
:>=
,
0
)
apply_simple_constraint!
(
res
.
rise_time
,
:>=
,
0
)
apply_simple_constraint!
(
res
.
rise_time
,
:>=
,
0
)
add_cost_function!
(
-
res
.
slew_rate
)
scanner_constraints!
(
res
)
scanner_constraints!
(
res
)
return
res
return
res
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment