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
a6ba7e99
Unverified
Commit
a6ba7e99
authored
7 months ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Fix previous cost function before optimising again
parent
81d3e54e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4
Resolve "Add secondary objective function"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/build_sequences.jl
+5
-1
5 additions, 1 deletion
src/build_sequences.jl
with
5 additions
and
1 deletion
src/build_sequences.jl
+
5
−
1
View file @
a6ba7e99
...
@@ -71,7 +71,11 @@ function build_sequence(f::Function, scanner::Union{Nothing, Scanner}, model::Tu
...
@@ -71,7 +71,11 @@ function build_sequence(f::Function, scanner::Union{Nothing, Scanner}, model::Tu
if
optimise
if
optimise
jump_model
=
GLOBAL_MODEL
[][
1
]
jump_model
=
GLOBAL_MODEL
[][
1
]
if
!
iszero
(
num_variables
(
jump_model
))
if
!
iszero
(
num_variables
(
jump_model
))
prev_cost_func
=
nothing
for
cost_func
in
iterate_cost
()
for
cost_func
in
iterate_cost
()
if
!
isnothing
(
prev_cost_func
)
@constraint
jump_model
prev_cost_func
==
objective_value
(
jump_model
)
end
@objective
jump_model
Min
cost_func
@objective
jump_model
Min
cost_func
min_objective
=
Inf
min_objective
=
Inf
for
attempt
in
1
:
n_attempts
for
attempt
in
1
:
n_attempts
...
@@ -100,7 +104,7 @@ function build_sequence(f::Function, scanner::Union{Nothing, Scanner}, model::Tu
...
@@ -100,7 +104,7 @@ function build_sequence(f::Function, scanner::Union{Nothing, Scanner}, model::Tu
println
(
solution_summary
(
jump_model
))
println
(
solution_summary
(
jump_model
))
error
(
"Optimisation failed to converge."
)
error
(
"Optimisation failed to converge."
)
end
end
#@constraint jump_model cost_func == objective_value(jump_model)
prev_cost_func
=
cost_func
end
end
end
end
return
fixed
(
sequence
)
return
fixed
(
sequence
)
...
...
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