perform_1(context);
}
public void perform_1(Context context) {
Turtle turtle = (Turtle) context.agent;
MutableDouble countdown = (MutableDouble) context.getLet(let);
double distance = countdown.value();
double distanceMagnitude = StrictMath.abs(distance);
if (distanceMagnitude <= org.nlogo.api.Constants.Infinitesimal()) {
context.ip = next;
return;
}
if (distanceMagnitude <= 1.0) {
try {
turtle.jump(distance);
} catch (AgentException e) { } // NOPMD
context.ip = next;
} else {
int stepDistance = (distance > 0) ? 1 : -1;
try {
turtle.jump(stepDistance);
countdown.value_$eq(countdown.value() - stepDistance);
} catch (AgentException e) {
context.ip = next;
}
}
}