Temperature replica exchange
18 nproc = rem.get_number_of_replicas()
20 temp = rem.create_temperatures(TEMPMIN_, TEMPMAX_, nproc)
22 myindex = rem.get_my_index()
24 rem.set_my_parameter(
"temp", [temp[myindex]])
34 d.set_coordinates_are_optimized(
True)
51 mc.set_scoring_function(sf)
52 mc.set_kt(temp[myindex])
53 mc.set_return_best(
False)
57 log = open(
"log" + str(myindex),
"w")
60 for istep
in range(0, 100):
62 score = mc.optimize(100)
65 myindex = rem.get_my_index()
66 mytemp = rem.get_my_parameter(
"temp")[0]
68 myscore = score / mytemp
71 log.write(
"%4d %2d %6.3f\n" % (istep, myindex, score))
74 findex = rem.get_friend_index(istep)
75 ftemp = rem.get_friend_parameter(
"temp", findex)[0]
77 fscore = score / ftemp
80 flag = rem.do_exchange(myscore, fscore, findex)