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
d9eafa60
Verified
Commit
d9eafa60
authored
1 year ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Add sensible constraints to ADC
parent
51055231
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/readouts/ADCs.jl
+7
-1
7 additions, 1 deletion
src/readouts/ADCs.jl
with
7 additions
and
1 deletion
src/readouts/ADCs.jl
+
7
−
1
View file @
d9eafa60
module
ADCs
module
ADCs
import
JuMP
:
@constraint
import
...
Variables
:
variables
,
dwell_time
,
duration
,
effective_time
,
get_free_variable
,
VariableType
import
...
Variables
:
variables
,
dwell_time
,
duration
,
effective_time
,
get_free_variable
,
VariableType
import
...
BuildingBlocks
:
BuildingBlock
,
apply_simple_constraint!
,
set_simple_constraints!
import
...
BuildingBlocks
:
BuildingBlock
,
apply_simple_constraint!
,
set_simple_constraints!
import
...
BuildSequences
:
global_model
"""
"""
ADC(nsamples; dwell_time=nothing, duration=nothing, time_to_center=duration/2)
ADC(nsamples; dwell_time=nothing, duration=nothing, time_to_center=duration/2)
...
@@ -27,7 +29,11 @@ function ADC(nsamples; dwell_time=nothing, time_to_center=nothing, kwargs...)
...
@@ -27,7 +29,11 @@ function ADC(nsamples; dwell_time=nothing, time_to_center=nothing, kwargs...)
get_free_variable
(
dwell_time
),
get_free_variable
(
dwell_time
),
time_to_center
isa
VariableType
?
time_to_center
:
nothing
time_to_center
isa
VariableType
?
time_to_center
:
nothing
)
)
if
!
(
time_to_center
isa
VariableType
)
@constraint
global_model
()
res
.
dwell_time
>=
0
if
time_to_center
isa
VariableType
@constraint
global_model
()
time_to_center
>=
0
@constraint
global_model
()
time_to_center
<=
duration
(
res
)
else
apply_simple_constraint!
(
effective_time
(
res
),
time_to_center
)
apply_simple_constraint!
(
effective_time
(
res
),
time_to_center
)
end
end
set_simple_constraints!
(
res
,
kwargs
)
set_simple_constraints!
(
res
,
kwargs
)
...
...
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