Package org.nlogo.nvm

Examples of org.nlogo.nvm.EngineException


      Agent a2 = (Agent) o2;
      if (a1.getAgentBit() == a2.getAgentBit()) {
        return a1.compareTo(a2) <= 0;
      }
    }
    throw new EngineException(context, this,
        I18N.errorsJ().getN("org.nlogo.prim._lessorequal.cannotCompareParameters",
            TypeNames.aName(o1), TypeNames.aName(o2)));
  }
View Full Code Here


  public boolean report_7(Context context, double arg0, Object arg1) throws LogoException {
    if (arg1 instanceof Double) {
      return arg0 <= ((Double) arg1).doubleValue();
    }
    throw new EngineException(context, this,
        I18N.errorsJ().getN("org.nlogo.prim._lessorequal.cannotCompareParameters",
            TypeNames.aName(arg0), TypeNames.aName(arg1)));
  }
View Full Code Here

  public boolean report_8(Context context, Object arg0, double arg1) throws LogoException {
    if (arg0 instanceof Double) {
      return ((Double) arg0).doubleValue() <= arg1;
    }
    throw new EngineException(context, this,
        I18N.errorsJ().getN("org.nlogo.prim._lessorequal.cannotCompareParameters",
            TypeNames.aName(arg0), TypeNames.aName(arg1)));
  }
View Full Code Here

  public Object report(final Context context)
      throws LogoException {
    try {
      return workspace.readFromString(argEvalString(context, 0));
    } catch (CompilerException error) {
      throw new EngineException(context, this, error.getMessage());
    }
  }
View Full Code Here

  @Override
  public Object report(final Context context) throws LogoException {
    Agent myself = context.myself();
    if (myself == null || myself instanceof Observer) {
      throw new EngineException
          (context, this, I18N.errorsJ().get("org.nlogo.prim.etc._myself.noAgentMyself"));
    }
    return myself;
  }
View Full Code Here

  }

  public Agent report_1(Context context) throws LogoException {
    Agent myself = context.myself();
    if (myself == null || myself instanceof Observer) {
      throw new EngineException
          (context, this, I18N.errorsJ().get("org.nlogo.prim.etc._myself.noAgentMyself"));
    }
    return myself;
  }
View Full Code Here

      if (obj instanceof Patch) {
        result.add((Patch) obj);
      } else if (obj instanceof AgentSet) {
        AgentSet tempSet = (AgentSet) obj;
        if (tempSet.type() != org.nlogo.agent.Patch.class) {
          throw new EngineException(context, this,
              I18N.errorsJ().getN("org.nlogo.prim.etc._patchset.listInputNonPatchAgentset",
                  this.displayName(), Dump.logoObject(tempList, true, false), Dump.logoObject(obj, true, false)));
        }
        for (AgentSet.Iterator iter2 = tempSet.iterator();
             iter2.hasNext();) {
          result.add((Patch) iter2.next());
        }
      } else if (obj instanceof LogoList) {
        descendList(context, (LogoList) obj, result);
      } else if (obj != org.nlogo.api.Nobody$.MODULE$) {
        throw new EngineException(context, this,
            I18N.errorsJ().getN("org.nlogo.prim.etc._patchset.listInputNonPatch",
                this.displayName(), Dump.logoObject(tempList, true, false), Dump.logoObject(obj, true, false)));
      }
    }
  }
View Full Code Here

        argEvalDoubleValue(context, 1));
  }

  public double report_1(Context context, double d1, double d2) throws LogoException {
    if (d1 == 0 && d2 == 0) {
      throw new EngineException(context, this, I18N.errorsJ().get("org.nlogo.prim.etc.atan.bothInputsCannotBeZero"));
    }
    if (d1 == 0) {
      return d2 > 0 ? 0 : 180;
    }
    if (d2 == 0) {
View Full Code Here

              (context.agent,
                  argEvalDoubleValue(context, 0),
                  argEvalDoubleValue(context, 1),
                  false)); // true = don't wrap
    } catch (org.nlogo.api.AgentException ex) {
      throw new EngineException
          (context, this, ex.getMessage());
    }
  }
View Full Code Here

          (workspace.fileManager().getFile
              (workspace.fileManager().attachPrefix
                  (argEvalString(context, 0))),
              world, true);
    } catch (java.io.IOException ex) {
      throw new EngineException
          (context, this,
              token().name() +
                  ": " + ex.getMessage());
    }
    context.ip = next;
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.