only apply static cutoff to protrusion beyond min length
This commit is contained in:
parent
17207d44e6
commit
3cb1984892
@ -39,14 +39,15 @@ public abstract class PathBase implements IPath {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPath staticCutoff(Goal destination) {
|
public IPath staticCutoff(Goal destination) {
|
||||||
if (length() < BaritoneAPI.getSettings().pathCutoffMinimumLength.get()) {
|
int min = BaritoneAPI.getSettings().pathCutoffMinimumLength.get();
|
||||||
|
if (length() < min) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
if (destination == null || destination.isInGoal(getDest())) {
|
if (destination == null || destination.isInGoal(getDest())) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
double factor = BaritoneAPI.getSettings().pathCutoffFactor.get();
|
double factor = BaritoneAPI.getSettings().pathCutoffFactor.get();
|
||||||
int newLength = (int) ((length() - 1) * factor);
|
int newLength = (int) ((length() - 1 - min) * factor) + min;
|
||||||
return new CutoffPath(this, newLength);
|
return new CutoffPath(this, newLength);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user