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
d4782d0f
Verified
Commit
d4782d0f
authored
1 year ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
print named sequence
parent
14097ed2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/containers/sequences.jl
+4
-4
4 additions, 4 deletions
src/containers/sequences.jl
with
4 additions
and
4 deletions
src/containers/sequences.jl
+
4
−
4
View file @
d4782d0f
...
...
@@ -94,7 +94,7 @@ Defines an MRI sequence from a vector of building blocks.
- [`nrepeat`](@ref): how often the sequence will repeat itself (keep at default of 0 to repeat indefinetely).
- [`TR`](@ref): how long between repeats in ms (defaults to the duration of the sequence). Can be set to `nothing` to be a free variable.
"""
struct
Sequence
{
N
,
S
}
<:
BaseSequence
{
N
}
struct
Sequence
{
S
,
N
}
<:
BaseSequence
{
N
}
blocks
::
SVector
{
N
,
Pair
{
<:
Union
{
Symbol
,
Nothing
},
<:
ContainerBlock
}}
TR
::
VariableType
end
...
...
@@ -105,7 +105,7 @@ function Sequence(blocks::AbstractVector; TR=:min, name=:Sequence)
if
TR
==
:
min
TR
=
actual_duration
end
res
=
Sequence
{
length
(
blocks
)
,
name
}(
SVector
{
length
(
blocks
)}(
blocks
),
get_free_variable
(
TR
))
res
=
Sequence
{
name
,
length
(
blocks
)}(
SVector
{
length
(
blocks
)}(
blocks
),
get_free_variable
(
TR
))
if
!
(
res
.
TR
isa
Number
)
||
!
(
duration
(
res
)
isa
Number
)
@constraint
global_model
()
res
.
TR
>=
actual_duration
end
...
...
@@ -134,12 +134,12 @@ for fn in keys(variables)
if
length
(
res
)
>
0
return
NamedTuple
(
res
)
else
error
(
"None of the building blocks of
$
(typeof(seq)) define
$
(
$
fn)"
)
error
(
"None of the building blocks of
$
(typeof(seq)) define
$
(
Variables.
$
fn)"
)
end
end
end
Base
.
show
(
io
::
IO
,
::
Type
{
<:
Sequence
{
N
,
S
}})
where
{
N
,
S
}
=
print
(
io
,
S
)
Base
.
show
(
io
::
IO
,
::
Type
{
<:
Sequence
{
S
}})
where
{
S
}
=
print
(
io
,
S
)
Sequence
(
blocks
...
;
kwargs
...
)
=
Sequence
([
blocks
...
];
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