Chapter 10: Bounded Simulated Annealing, Integer and Bool variables
akevan
08-10-2011, 04:22 PM
Hi all, wondering if there are any ideas on how to tune boolean, integer and bounded variables using the simulated annealing code in NR3. I have the optimization working by returning a very high value if the objective function is evaluated with a value which is out of bounds, but this seems very inefficient (it's quite slow when I activate this).
Is there a better way (or an alternative algorithm!) to optimize bounded, integer and boolean variables?
Many thanks,
akevan
kutta
09-02-2011, 02:59 AM
Hi all, wondering if there are any ideas on how to tune boolean, integer and bounded variables using the simulated annealing code in NR3. I have the optimization working by returning a very high value if the objective function is evaluated with a value which is out of bounds, but this seems very inefficient (it's quite slow when I activate this).
Is there a better way (or an alternative algorithm!) to optimize bounded, integer and boolean variables?
Many thanks,
akevan
Hello NR Colleague,
Did you try wrapper class or derived class NRVec<int>
while using the said code.
NR Recipe second edition makes this point clear on page 954
which i append bellow for your another try on the same
The std:vector class has a specialisation for vector<bool>that doesn't work with the wrapper class scheme.So implement own specialisation as a derived class of NRVec<int>
This could cause problem if you mix mtl:: vector<bool> with NRVec<bool>
Please do not alter the already established aligorithm which is under Annealing method .instead use approprite template class.So please try out as per this template <> class NRVec<bool>
in place of NR3.h. since your variables are not responding to NR3.h for proper output.
Hope to hear from you soon on this.
GoodLuck
As
C.R.Muthukumar(Kutta)