Package org.nlogo.nvm

Examples of org.nlogo.nvm.MutableDouble


    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;
      }
    }
  }
View Full Code Here


  public void perform(Context context) throws LogoException {
    perform_1(context, argEvalDoubleValue(context, 0));
  }

  public void perform_1(Context context, double d) {
    context.let(let, new MutableDouble(-d));
    context.ip = next;
  }
View Full Code Here

  public void perform(Context context) throws LogoException {
    perform_1(context, argEvalDoubleValue(context, 0));
  }

  public void perform_1(Context context, double d) {
    context.let(let, new MutableDouble(d));
    context.ip = next;
  }
View Full Code Here

TOP

Related Classes of org.nlogo.nvm.MutableDouble

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.