For a school project, I have to implement Simulated Annealing meta heuristic.
You have a shuffled grid and you have to find the original grid. The only operation available is to swap 2 random elements. The cost function is the distance of the point with their original neighbors.
On this one, we are given many functions and we have to find the global minimum. The challenge was to be able to display the evolution of the algorithm, as it traverses 200k points per second.
->) or optional (parenthesis, curly brackets ...) in CoffeeScript. There are also handy features such as splats, generators ...
worker.onmessage = (data: [id, rest...]) -> switch id when 'update' [cost, temperature, accepted, tried, data, force] = rest
chart = new Highcharts.Chart chart: renderTo: 'container' yAxis: [ title: text: 'Cost' ] tooltip: formatter: -> this.series.name + ': ' + this.y
Felix Abecassis wrote a report that explains everything 🙂 It's in French, sorry!