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
77e34e07
Unverified
Commit
77e34e07
authored
9 months ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Fix scanner constraints settings
parent
254ac18e
No related branches found
No related tags found
1 merge request
!2
Define variables through new @defvar macro
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/variables.jl
+8
-15
8 additions, 15 deletions
src/variables.jl
with
8 additions
and
15 deletions
src/variables.jl
+
8
−
15
View file @
77e34e07
...
...
@@ -453,26 +453,19 @@ function make_generic end
Constraints [`gradient_strength`](@ref) and [`slew_rate`](@ref) to be less than the [`global_scanner`](@ref) maximum.
"""
function
scanner_constraints!
(
bb
::
AbstractBlock
)
try
global_scanner
()
catch
e
return
end
for
f
in
(
slew_rate
,
gradient_strength
)
for
(
var
,
max_value
)
in
[
(
variables
.
slew_rate
,
global_scanner
()
.
slew_rate
),
(
variables
.
gradient_strength
,
global_scanner
()
.
gradient
),
]
value
=
nothing
try
value
=
f
(
bb
)
value
=
var
(
bb
)
catch
continue
end
if
value
isa
AbstractVector
for
v
in
value
@constraint
global_model
()
v
<=
f
(
global_scanner
())
@constraint
global_model
()
v
>=
-
f
(
global_scanner
())
end
else
@constraint
global_model
()
value
<=
f
(
global_scanner
())
@constraint
global_model
()
value
>=
-
f
(
global_scanner
())
for
v
in
value
@constraint
global_model
()
v
<=
max_value
@constraint
global_model
()
v
>=
-
max_value
end
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