Package org.nlogo.agent

Examples of org.nlogo.agent.Link


      throws LogoException {
    org.nlogo.agent.LinkManager linkManager = world.linkManager;
    AgentSet breed = breedName == null ? world.links() : world.getLinkBreed(breedName);
    mustNotBeUndirected(breed, context);
    Turtle target = argEvalTurtle(context, 0);
    Link link = linkManager.findLinkFrom(target, (Turtle) context.agent, breed, true);
    if (link == null) {
      return org.nlogo.api.Nobody$.MODULE$;
    }
    return link;
  }
View Full Code Here


        throw new EngineException
            (context, this,
                I18N.errorsJ().get("org.nlogo.prim.$common.turtleCantLinkToSelf"));
      }
      if (src.id != -1 && dest.id != -1) {
        Link link = world.linkManager.createLink(src, dest, breed);
        workspace.joinForeverButtons(link);
        if (offset - context.ip > 2) {
          AgentSet edgeset = new org.nlogo.agent.ArrayAgentSet(Link.class, 1,
              false, world);
          edgeset.add(link);
View Full Code Here

public final strictfp class _link
    extends Reporter {
  @Override
  public Object report(final Context context) throws LogoException {
    Link link = world.getLink(argEvalDouble(context, 0),
        argEvalDouble(context, 1), world.links());
    if (link == null) {
      return Nobody$.MODULE$;
    }
    return link;
View Full Code Here

    return report_1(context);
  }

  public double report_1(Context context) throws LogoException {
    try {
      Link link = (Link) context.agent;
      return world.protractor().towards(link.end1(), link.end2(), true);
    } catch (org.nlogo.api.AgentException e) {
      throw new org.nlogo.nvm.EngineException
          (context, this,
              "there is no heading of a link whose endpoints are in the same position");
    }
View Full Code Here

TOP

Related Classes of org.nlogo.agent.Link

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.