Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some remaining print #351

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading