src/robolib/trajectory/ballistics: Use

paramComputedReset() in
GreedyBallisticCalculator
This commit is contained in:
Ray Healy 2026-02-10 20:38:56 -05:00
parent 3ddd3a5ff6
commit f6aed3036b
1 changed files with 3 additions and 4 deletions

View File

@ -22,9 +22,7 @@ public class GreedyBallisticCalculator extends BallisticCalculator {
Angle robotAngle, Angle robotAngle,
Velocity3d shooterVelocity Velocity3d shooterVelocity
) { ) {
if(initParam == null) { model.paramComputedReset();
initParam = model.getInitParam();
}
LinkedList<P> candidate_params = new LinkedList<>(); LinkedList<P> candidate_params = new LinkedList<>();
candidate_params.addFirst(initParam); candidate_params.addFirst(initParam);
@ -32,8 +30,9 @@ public class GreedyBallisticCalculator extends BallisticCalculator {
while(!candidate_params.isEmpty()) { while(!candidate_params.isEmpty()) {
// Evaluate the candidates // Evaluate the candidates
P param = candidate_params.removeFirst(); P param = candidate_params.removeFirst();
Velocity3d candidate = model.getCandidateVelocity(param); if(model.paramComputed(param)) continue;
Velocity3d candidate = model.getCandidateVelocity(param);
if(candidate != null) { if(candidate != null) {
BCEvalParams evalParams = new BCEvalParams(robotVelocity, robotAngle, shooterVelocity, candidate); BCEvalParams evalParams = new BCEvalParams(robotVelocity, robotAngle, shooterVelocity, candidate);
Double penalty = this.evaluateCandidate(model, evalParams); Double penalty = this.evaluateCandidate(model, evalParams);