Package org.nlogo.api

Examples of org.nlogo.api.AgentException


      throws AgentException {
    double max = maxPxcor + 0.5;
    double min = minPxcor - 0.5;
    if (!xWrap) {
      if (x >= max || x < min) {
        throw new AgentException("Cannot move turtle beyond the world's edge.");
      }
      return x;
    } else {
      return wrap(x, min, max);
    }
View Full Code Here


      throws AgentException {
    double max = maxPycor + 0.5;
    double min = minPycor - 0.5;
    if (!yWrap) {
      if (y >= max || y < min) {
        throw new AgentException("Cannot move turtle beyond the world's edge.");
      }
      return y;
    } else {
      return wrap(y, min, max);
    }
View Full Code Here

  }

  @Override
  public void setLinkVariable(int vn, double value)
      throws AgentException {
    throw new AgentException
        ("the observer can't access a link variable without specifying which link");
  }
View Full Code Here

  }

  @Override
  public void setLinkBreedVariable(String name, Object value)
      throws AgentException {
    throw new AgentException
        ("the observer can't access a link variable without specifying which link");
  }
View Full Code Here

  }

  @Override
  public void setTurtleOrLinkVariable(String varName, Object value)
      throws AgentException {
    throw new AgentException
        ("the observer can't access a turtle or link variable without specifying which agent");
  }
View Full Code Here

      oxyandzcor(t.xcor(), t.ycor(), 0);
    } else if (otherAgent instanceof Patch) {
      Patch p = (Patch) otherAgent;
      oxyandzcor(p.pxcor, p.pycor, 0);
    } else {
      throw new AgentException("you can't move-to a link");
    }
    face(rotationPoint.x(), rotationPoint.y());
  }
View Full Code Here

  public double towardsPitch(org.nlogo.api.Agent fromAgent, org.nlogo.api.Agent toAgent,
                             boolean wrap)
      throws AgentException {
    double x, y, z;
    if (fromAgent == toAgent) {
      throw new AgentException
          ("no pitch is defined from an agent to itself");
    }
    if (toAgent instanceof Turtle) {
      Turtle3D turtle = (Turtle3D) toAgent;
      x = turtle.xcor();
View Full Code Here

  public double towardsPitch(double fromX, double fromY, double fromZ,
                             double toX, double toY, double toZ,
                             boolean wrap)
      throws AgentException {
    if (fromX == toX && fromY == toY && fromZ == toZ) {
      throw new AgentException
          ("no pitch is defined from a point (" +
              fromX + "," + fromY + "," + fromZ + ") to that same point");
    }
    double dx = toX - fromX;
    double dy = toY - fromY;
View Full Code Here

  public double[] towardsVector(double fromX, double fromY, double fromZ,
                                double toX, double toY, double toZ,
                                boolean wrap)
      throws AgentException {
    if (fromX == toX && fromY == toY && fromZ == toZ) {
      throw new AgentException
          ("no pitch is defined from a point (" +
              fromX + "," + fromY + "," + fromZ + ") to that same point");
    }
    double dx = toX - fromX;
    double dy = toY - fromY;
View Full Code Here

  double wrapY(double y)
      throws AgentException {
    double max = world.maxPycor() + 0.5;
    double min = world.minPycor() - 0.5;
    if (y >= max || y < min) {
      throw new AgentException("Cannot move turtle beyond the world's edge.");
    }
    return y;
  }
View Full Code Here

TOP

Related Classes of org.nlogo.api.AgentException

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.