I've been trying to understand the stochastic hill climber for a while, but not having any luck with it. I've looked through a book on heuristics and got a pseudo code. I don't understand what the probability function should look like. I understand that the new solution is piked randomly and accepted based on some probability, what I don't get is how to program this probability. Thanks
PSUEDO-CODE - from 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