Skip to content

Commit

Permalink
remove some remaining print
Browse files Browse the repository at this point in the history
  • Loading branch information
g-poveda committed Nov 27, 2024
1 parent 394926e commit 0160054
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 20 deletions.
10 changes: 0 additions & 10 deletions discrete_optimization/fjsp/solvers/dp.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,6 @@ def extract_ints(word):
end = start + self.duration[t_number][choice]
schedule_per_machine[m].append((start, end))
schedules[j] = (start, end, m)
# Debug
# print("machine", m, state[self.cur_time_per_machine[m]])
# print("job", j, state[self.cur_time_per_job[j[0]]])
# print()
# print(schedule_per_machine[m])
# print(schedules[j])
# for i in range(len(self.cur_time_per_machine)):
# print("machine", i, state[self.cur_time_per_machine[i]])
# for j in range(len(self.cur_time_per_job)):
# print("job", j, state[self.cur_time_per_job[j]])
sol = FJobShopSolution(
problem=self.problem,
schedule=[
Expand Down
4 changes: 2 additions & 2 deletions discrete_optimization/generic_tools/qiskit_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def cost_func(params, ansatz, hamiltonian, estimator, callback_dict):
callback_dict["iters"] += 1
callback_dict["prev_vector"] = params
callback_dict["cost_history"].append(cost)
print(f"Iters. done: {callback_dict['iters']} [Current cost: {cost}]")
logger.info(f"Iters. done: {callback_dict['iters']} [Current cost: {cost}]")

return cost

Expand Down Expand Up @@ -188,7 +188,7 @@ def fun(x):
callback_dict["iters"] += 1
callback_dict["prev_vector"] = x
callback_dict["cost_history"].append(cost)
print(f"Iters. done: {callback_dict['iters']} [Current cost: {cost}]")
logger.info(f"Iters. done: {callback_dict['iters']} [Current cost: {cost}]")
return cost

optimizer = kwargs["optimizer"]
Expand Down
6 changes: 0 additions & 6 deletions discrete_optimization/jsp/solvers/dp.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,6 @@ def extract_ints(word):

for transition in sol.transitions:
state = transition.apply(state, self.model)
# for i in range(len(self.cur_time_per_machine)):
# print("machine", i, state[self.cur_time_per_machine[i]])
# for j in range(len(self.cur_time_per_job)):
# print("job", j, state[self.cur_time_per_job[j]])
# print(transition.name)
if "finish" not in transition.name:
t_number = extract_ints(transition.name)[0]
m = self.machines[t_number]
Expand All @@ -170,7 +165,6 @@ def extract_ints(word):
for i in range(self.problem.n_jobs)
],
)
print(self.problem.evaluate(sol))
return sol

def set_warm_start(self, solution: JobShopSolution) -> None:
Expand Down
2 changes: 1 addition & 1 deletion discrete_optimization/rcpsp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ def get_start_bounds_from_additional_constraint(
)
ub = min(ub, ubs - min_duration)
if ub < 0:
print(ub)
logger.debug(f"ub<0, {ub}")
return int(lb), int(ub)


Expand Down
2 changes: 1 addition & 1 deletion discrete_optimization/vrp/solvers/lp_iterative.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ def retrieve_solutions(
x_solution.copy(),
)
]
print(f"quality of {s}-th solution", model.getAttr("PoolObjVal"))
logger.info(f"quality of {s}-th solution : {model.getAttr('PoolObjVal')}")
return solutions


Expand Down

0 comments on commit 0160054

Please sign in to comment.