Programmable external evalution problem for simulated annealing and particle swarm optimization

37 views
Skip to first unread message

Lukas Preusser

unread,
Mar 15, 2021, 4:46:24 PM3/15/21
to HeuristicLab

Hi everybody,

I created a programmable external evalution problem using an IntegerVectorEncoding, which is using an Anylogic simulation to determine the quality of solutions. 
Currently I'm using a genetic algorithm with the problem, but would also like to try simulated annealing and particle swarm optimization for comparison.

Regarding movement based metaheuristics I found this old thread from 2012 (https://groups.google.com/g/heuristiclab/c/fVLh1GPS7jc/m/bZ--KEYI2PgJ), where it is explained that for simulated annealing you have to implement three operators (move generator, move evaluator, move maker). 
Is this information still up to date? In the programmable program there is the "GetNeighbors" method, where neighbors can be defined. Do I use the operators in this method? If yes, are there any implemenation examples available, especially regarding the declaration of the operators? I unfortunately can't find the the suggested implementations in HeuristicLab.Encodings.RealVector from the 2012 thread.

Regarding PSO I'm not really sure what I have to define in the programmable problem. When using PSO it runs one time through the defined amount of particles and gets the quality of the individual solutions, but after that HeuristicLab stops and no particle moves are generated. Is it also necessary to implement some sort of move generator?

All the best,
Lukas

HeuristicLab

unread,
Mar 15, 2021, 5:32:19 PM3/15/21
to HeuristicLab
PSO would not be among my choices when the encoding is discrete, especially when the size of the domain is very small or there is no ordinal relationship. But anyway, to apply PSO, you would have to provide a real-encoded version of your problem where you change from the integer to a RealVectorEncoding and then in Evaluate transform the elements of the RealVector to integers (but don't manipulate the elements in the RealVector itself). For instance, you can define the RealVector in the [0; 1]^N subspace and then transform it into your actual domain like so: int_val_d = (int)Math.Round(min_d + (max_d - min_d) * real_val_d) (for each d in {1, ..., N}). Everything else should be similar to the discrete version of your problem. You can also apply CMA-ES on the continuous problem.

For simulated annealing, yes you can implement GetNeighbors() to define your neighborhood (e.g. add and subtract one in each dimension). The programmable problem already provides the three operators for you and these will use the GetNeighbors() method that you define.
Reply all
Reply to author
Forward
0 new messages