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
Merge requests
!2
Define variables through new @defvar macro
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Define variables through new @defvar macro
new_variables
into
main
Overview
0
Commits
73
Pipelines
2
Changes
1
Merged
Michiel Cottaar
requested to merge
new_variables
into
main
9 months ago
Overview
0
Commits
73
Pipelines
2
Changes
1
Expand
0
0
Merge request reports
Viewing commit
77e34e07
Prev
Next
Show latest version
1 file
+
8
−
15
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Unverified
77e34e07
Fix scanner constraints settings
· 77e34e07
Michiel Cottaar
authored
10 months ago
src/variables.jl
+
8
−
15
Options
@@ -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
Loading