From 3e5cd413bff9de543471151c332b51e657924672 Mon Sep 17 00:00:00 2001 From: core Date: Sat, 22 Nov 2025 21:55:37 -0500 Subject: [PATCH] chore: additional debug logging --- crates/unified/src/client/ship/thrusters.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/unified/src/client/ship/thrusters.rs b/crates/unified/src/client/ship/thrusters.rs index 476b504e203e8d04f209072625daa5048e34546f..f0892cd9d6d4bd41afd78a8b133bd62ac640e7c5 100644 --- a/crates/unified/src/client/ship/thrusters.rs +++ b/crates/unified/src/client/ship/thrusters.rs @@ -125,7 +125,6 @@ fn solve_thrust( for part in &all_parts { let Ok(part_thrusters) = parts.get(*part) else { - warn!("issue while solving for thrust: part {:?} has no thrusters? skipping...", *part); continue; }; for thruster_id in &**part_thrusters { @@ -154,11 +153,15 @@ fn solve_thrust( // calculate thrust and torque values debug!("found {} thrusters, computing coefficients", all_thrusters.len()); + for thruster in &all_thrusters { + trace!("thruster on ship: {:?}", thruster); + } + let coefficients = all_thrusters.iter() .map(|u| target_unit_vector.dot(u.1)) .collect::>(); - debug!("preparing model"); + trace!("preparing model"); let mut problem = Problem::new(OptimizationDirection::Maximize); // add variables to problem @@ -166,7 +169,7 @@ fn solve_thrust( .map(|u| problem.add_binary_var(*u as f64)) .collect::>(); - debug!("prepared {} variables; solving", variables.len()); + trace!("prepared {} variables; solving", variables.len()); let ssolution = match problem.solve() { Ok(soln) => soln, @@ -200,13 +203,13 @@ fn solve_thrust( }; for thruster in all_thrusters.iter().enumerate() { - debug!("solution: thruster #{} ({:?}): {}", thruster.0, thruster.1.0, ssolution.var_value_rounded(variables[thruster.0])); + trace!("solution: thruster #{} ({:?}): {}", thruster.0, thruster.1.0, ssolution.var_value_rounded(variables[thruster.0])); if ssolution.var_value_rounded(variables[thruster.0]) == 1.0 { new_soln.thrusters_on.insert(*thruster.1.0); } } - debug!("found thrust solution in {}ms", start.elapsed().as_millis()); + debug!("found thrust solution in {:?}", start.elapsed()); *solution = new_soln; return; } \ No newline at end of file