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
c2f7ede6
Unverified
Commit
c2f7ede6
authored
7 months ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Add final cost function to minimise sequence length
parent
a6ba7e99
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/containers/base_sequences.jl
+4
-3
4 additions, 3 deletions
src/containers/base_sequences.jl
with
4 additions
and
3 deletions
src/containers/base_sequences.jl
+
4
−
3
View file @
c2f7ede6
...
@@ -4,7 +4,7 @@ Defines [`BaseSequence`](@ref) and [`Sequence`](@ref)
...
@@ -4,7 +4,7 @@ Defines [`BaseSequence`](@ref) and [`Sequence`](@ref)
module
BaseSequences
module
BaseSequences
import
StaticArrays
:
SVector
import
StaticArrays
:
SVector
import
JuMP
:
@constraint
import
JuMP
:
@constraint
import
...
Variables
:
get_free_variable
,
VariableType
,
variables
,
set_simple_constraints!
,
make_generic
,
get_gradient
,
get_pulse
,
get_gradient
,
@defvar
import
...
Variables
:
get_free_variable
,
VariableType
,
variables
,
set_simple_constraints!
,
make_generic
,
get_gradient
,
get_pulse
,
get_gradient
,
@defvar
,
add_cost_function!
import
...
BuildSequences
:
global_scanner
import
...
BuildSequences
:
global_scanner
import
...
Components
:
EventComponent
,
NoGradient
,
edge_times
import
...
Components
:
EventComponent
,
NoGradient
,
edge_times
import
...
Scanners
:
Scanner
,
B0
import
...
Scanners
:
Scanner
,
B0
...
@@ -151,10 +151,11 @@ struct Sequence{S, N} <: BaseSequence{N}
...
@@ -151,10 +151,11 @@ struct Sequence{S, N} <: BaseSequence{N}
scanner
::
Scanner
scanner
::
Scanner
end
end
function
Sequence
(
blocks
::
AbstractVector
;
name
=:
Sequence
,
scanner
=
nothing
,
var
iable
s
...
)
function
Sequence
(
blocks
::
AbstractVector
;
name
=:
Sequence
,
scanner
=
nothing
,
vars
...
)
blocks
=
to_block_pair
.
(
blocks
)
blocks
=
to_block_pair
.
(
blocks
)
res
=
Sequence
{
name
,
length
(
blocks
)}(
SVector
{
length
(
blocks
)}(
blocks
),
isnothing
(
scanner
)
?
global_scanner
()
:
scanner
)
res
=
Sequence
{
name
,
length
(
blocks
)}(
SVector
{
length
(
blocks
)}(
blocks
),
isnothing
(
scanner
)
?
global_scanner
()
:
scanner
)
set_simple_constraints!
(
res
,
variables
)
set_simple_constraints!
(
res
,
vars
)
add_cost_function!
(
variables
.
duration
(
res
),
3
)
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