Skip to content

Commit

Permalink
remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Specy committed Nov 5, 2024
1 parent c0fdc35 commit 03e280f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -813,9 +813,8 @@ mod tests {
// Define variables with their objective coefficients
let x = problem.add_var(50.0, (2.0, f64::INFINITY)); // x ≥ 0
let y = problem.add_var(40.0, (0.0, 7.0)); // y ≥ 0

let z = problem.add_integer_var(45.0, (0, i32::MAX)); // z ≥ 0 and integer
// Machine time constraint: 3x + 2y + z ≤ 20
// Machine time constraint: 3x + 2y + z ≤ 20
problem.add_constraint(&[(x, 3.0), (y, 2.0), (z, 1.0)], ComparisonOp::Le, 20.0);

// Labor time constraint: 2x + y + 3z ≤ 15
Expand Down
8 changes: 4 additions & 4 deletions src/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,16 +504,16 @@ impl Solver {
f64::INFINITY
};
let mut best_solution = None;
println!("{:?}", cur_solution.iter().collect::<Vec<_>>());
debug!("{:?}", cur_solution.iter().collect::<Vec<_>>());
let mut dfs_stack =
if let Some(var) = choose_branch_var(&cur_solution, &self.orig_var_domains) {
println!(
debug!(
"starting branch&bound, current obj. value: {:.2}",
self.cur_obj_val
);
vec![new_step(cur_solution, var)]
} else {
println!(
debug!(
"found optimal solution with initial relaxation! cost: {:.2}",
self.cur_obj_val
);
Expand Down Expand Up @@ -562,7 +562,7 @@ impl Solver {
} else {
// Found integral solution
if is_solution_better(direction, best_cost, obj_val) {
println!(
debug!(
"iter {} (search depth {}): found new best solution, cost: {:.2}",
iter,
dfs_stack.len(),
Expand Down

0 comments on commit 03e280f

Please sign in to comment.