Commit 00ef3c97 authored by Julien Lin's avatar Julien Lin
Browse files

remove bit stream version of simulated annealing

parent 269a87dd
......@@ -63,7 +63,7 @@ if __name__ == "__main__":
help="Random pseudo-generator seed (none for current epoch)",
)
solvers = ["num_greedy", "bit_greedy", "num_sim_anneal", "bit_sim_anneal"]
solvers = ["num_greedy", "bit_greedy", "num_sim_anneal"]
can.add_argument(
"-m",
"--solver",
......@@ -232,50 +232,6 @@ if __name__ == "__main__":
)
sensors = num.to_sensors(sol)
elif the.solver == "bit_sim_anneal":
def temp_generator(lamda):
def f(T):
return lamda * T
return f
def proba():
def f(delta_energy, temp):
return np.exp(-delta_energy / temp)
return f
def rand():
def f():
return np.random.rand()
return f
val, sol = algo.simulated_annealing(
make.func(
bit.cover_sum,
domain_width=the.domain_width,
sensor_range=the.sensor_range,
dim=d * the.nb_sensors,
),
make.init(
bit.rand,
domain_width=d * the.nb_sensors,
nb_sensors=the.nb_sensors,
),
make.neig(
bit.neighb_square,
scale=the.variation_scale,
domain_width=the.domain_width,
),
temp_generator(0.99),
proba(),
rand(),
iters,
)
sensors = bit.to_sensors(sol)
# Fancy output.
print("\n{} : {}".format(val, sensors))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment