私はしばらく確率的ヒルクライマーを理解しようとしてきましたが、うまくいきませんでした。ヒューリスティックに関する本を調べて、疑似コードを入手しました。確率関数がどのように見えるべきかわかりません。新しいソリューションがランダムに抽出され、ある確率に基づいて受け入れられることを理解しています。得られないのは、この確率をプログラムする方法です。ありがとう
PSUEDO-CODE - How to Solve it: Modern Heuristics - Zbugniew Michalewicz、David Fogel より
procedure stochastic hill-climber
begin
t <- 0
select a current string vc at random
evaluate vc
repeat
select the string vn from the neighbourhood of vc
select vn with probability 1/(1+(e^(evaluation(vc) - evaluation(vn))/T))
t <- t + 1
until t=MAX
end