SepShr/MLCSHE

unclear parameters in `mutate_time()`

Closed this issue · 1 comments

Below is the current mutate_time():

MLCSHE/problem_utils.py

Lines 185 to 196 in e8b3ef4

def mutate_time(time_list, mutipb, duration: int = cfg.duration, min_duration: int = cfg.min_trajectory_duration):
# mutated_time = list(tools.mutUniformInt(
# time_list, low=, up=, indpb=mutgpb)[0])
# if mutated_time[0] >= mutated_time[1]:
# if mutated_time[0] < 60.0:
# mutated_time[1] += 50.0
# else:
# mutated_time[0] += -50.0
mutated_time = time_list
if random() <= mutipb:
t0_ub = duration - min_duration
mutated_time[0] = randint(0, t0_ub)

Here, I found that mutipb is coming from mutgmu as below.

MLCSHE/problem_utils.py

Lines 171 to 176 in e8b3ef4

else:
if mlco_element_label == -1:
return create_obs_traj(mutated_label[0])
else:
mutated_time = mutate_time(
mlco_element_time, mutgmu, mutgsig, mutgpb)

Something is wrong, isn't it?

For example, I also found that guassian_mutation_mean = 0 in search_config.py. Note that random() in the if-statement always returns a value between 0 and 1, and therefore the content of the if-statement will not be properly executed if you use guassian_mutation_mean = 0. Need to check this point.

Thank you for discovering the mistake. Commit 00f6cdd addresses this issue.