-
Notifications
You must be signed in to change notification settings - Fork 21
Initial implementation of Constrained GlobalOptimisation #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dps/v0.7
Are you sure you want to change the base?
Conversation
@@ -141,17 +138,30 @@ function minimise_icp(f::Function, x::IntervalBox{N, T}; reltol=1e-3, abstol=1e- | |||
return lb..global_minimum, arg_minima | |||
end | |||
|
|||
function minimise_icp_constrained(f::Function, x::IntervalBox{N, T}, constraints::Vector{Constraint{T}} = Vector{Constraint{T}}(); reltol=1e-3, abstol=1e-3) where {N, T<:Real} | |||
|
|||
struct ConstraintCond{T} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just Constraint
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Their might be more than one constraint condition thats why we need to built vector of such conditions.
|
||
Q = binary_minheap(IntervalBoxMinimum{N, T}) | ||
|
||
global_minimum = ∞ | ||
|
||
for t in constraints | ||
x = icp(t.f, x, t.c) | ||
C = Contractor(t.f, var) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is expensive to create a Contractor
, so this should be done only once for each constraint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right. We should built contractor for each constraint condition only once.
@@ -176,10 +186,13 @@ function minimise_icp_constrained(f::Function, x::IntervalBox{N, T}, constraints | |||
global_minimum = current_minimum |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this logic is not correct, since there may be no feasible points in p
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes right..!! this required more work need to be done on this case.
Note that if you took code from another commit, you should have built your commit on top of that commit to keep a record of the previous author's contributions. |
Yes I'll remember from next time. |
No description provided.