Package org.nlogo.nvm

Examples of org.nlogo.nvm.EngineException


      for (AgentSet.Iterator iter = sourceSet.shufflerator(context.job.random);
           iter.hasNext();) {
        result.add(iter.next().getTurtleOrLinkVariable(varName));
      }
    } catch (org.nlogo.api.AgentException ex) {
      throw new EngineException(context, this, ex.getMessage());
    }
    return result.toLogoList();
  }
View Full Code Here


  @Override
  public Object report(final Context context) throws LogoException {
    try {
      return context.agent.getLinkBreedVariable(name);
    } catch (org.nlogo.api.AgentException ex) {
      throw new EngineException(context, this, ex.getMessage());
    }
  }
View Full Code Here

  public Object report_1(final Context context) throws LogoException {
    try {
      return context.agent.getLinkBreedVariable(name);
    } catch (org.nlogo.api.AgentException ex) {
      throw new EngineException(context, this, ex.getMessage());
    }
  }
View Full Code Here

  public Object report_1(Context context) throws LogoException {
    try {
      return context.agent.getTurtleOrLinkVariable(varName);
    } catch (org.nlogo.api.AgentException ex) {
      throw new EngineException(context, this, ex.getMessage());
    }
  }
View Full Code Here

      result =
          reporter.report
              (arguments,
                  new ExtensionContext(workspace, context));
    } catch (org.nlogo.api.ExtensionException ex) {
      EngineException ee =
          new EngineException(context, this, "Extension exception: "
              + ex.getMessage());
      // it might be better to use the Java 1.4 setCause() stuff, for
      // the long term... but then i think the handler would have to
      // be changed, too.
      ee.setStackTrace(ex.getStackTrace());
      throw ee;
    }
    return result;
  }
View Full Code Here

    reporterBlock.checkAgentSetClass(sourceSet, context);
    for (AgentSet.Iterator iter = sourceSet.iterator(); iter.hasNext();) {
      Agent tester = iter.next();
      Object value = freshContext.evaluateReporter(tester, reporterBlock);
      if (!(value instanceof Boolean)) {
        throw new EngineException
            (context, this, I18N.errorsJ().getN("org.nlogo.prim.$common.expectedBooleanValue",
                displayName(), Dump.logoObject(tester), Dump.logoObject(value)));
      }
      if (((Boolean) value).booleanValue()) {
        result.add(tester);
View Full Code Here

    }
    double sum = 0;
    for (AgentSet.Iterator it = patch.getNeighbors().iterator(); it.hasNext();) {
      Object value = ((Patch) it.next()).getPatchVariable(vn);
      if (!(value instanceof Double)) {
        throw new EngineException(context, this,
            I18N.errorsJ().getN("org.nlogo.prim.$common.noSumOfListWithNonNumbers",
                Dump.logoObject(value).toString(), TypeNames.name(value)));
      }

      sum += ((Double) value).doubleValue();
View Full Code Here

    // to be random! - ST 3/15/06
    for (AgentSet.Iterator iter = agentset.shufflerator(context.job.random); iter.hasNext();) {
      Turtle dest = (Turtle) iter.next();
      if (world.linkManager.findLinkEitherWay(src, dest, breed, false) == null) {
        if (src == dest) {
          throw new EngineException
              (context, this,
                  I18N.errorsJ().get("org.nlogo.prim.$common.turtleCantLinkToSelf"));
        }
        if (src.id != -1 && dest.id != -1) {
          Link link;
View Full Code Here

    if (breed == world.links()) {
      breed.setDirected(false);
    }
    if (world.linkManager.findLinkEitherWay(src, dest, breed, false) == null) {
      if (src == dest) {
        throw new EngineException
            (context, this,
                I18N.errorsJ().get("org.nlogo.prim.$common.turtleCantLinkToSelf"));
      }
      if (src.id > dest.id) {
        Turtle tmp = src;
View Full Code Here

      if (tester == context.agent) {
        continue;
      }
      Object value = freshContext.evaluateReporter(tester, reporterBlock);
      if (!(value instanceof Boolean)) {
        throw new EngineException
            (context, this, I18N.errorsJ().getN("org.nlogo.prim.$common.expectedBooleanValue",
                displayName(), Dump.logoObject(tester), Dump.logoObject(value)));
      }
      if (((Boolean) value).booleanValue()) {
        return true;
View Full Code Here

TOP

Related Classes of org.nlogo.nvm.EngineException

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.