Package org.nlogo.nvm

Examples of org.nlogo.nvm.EngineException


    List<Turtle> resultList = new ArrayList<Turtle>();
    AgentSet breed = world.getBreed(breedName);
    if (agentOrSet instanceof Turtle) {
      Turtle turtle = (Turtle) agentOrSet;
      if (turtle.id == -1) {
        throw new EngineException(context, this,
          I18N.errorsJ().getN("org.nlogo.$common.thatAgentIsDead", turtle.classDisplayName()));
      }
      for (Turtle t : turtle.getPatchHere().turtlesHere()) {
        if (t.getBreed() == breed) {
          resultList.add(t);
View Full Code Here


    List<Turtle> resultList = new ArrayList<Turtle>();
    AgentSet breed = world.getBreed(breedName);
    if (agent instanceof Turtle) {
      Turtle turtle = (Turtle) agent;
      if (turtle.id == -1) {
        throw new EngineException(context, this,
          I18N.errorsJ().getN("org.nlogo.$common.thatAgentIsDead", turtle.classDisplayName()));
      }
      for (Turtle t : turtle.getPatchHere().turtlesHere()) {
        if (t.getBreed() == breed) {
          resultList.add(t);
View Full Code Here

  public AgentSet report_4(Context context, Turtle turtle)
      throws LogoException {
    List<Turtle> resultList = new ArrayList<Turtle>();
    AgentSet breed = world.getBreed(breedName);
    if (turtle.id == -1) {
      throw new EngineException(context, this,
        I18N.errorsJ().getN("org.nlogo.$common.thatAgentIsDead", turtle.classDisplayName()));
    }
    for (Turtle t : turtle.getPatchHere().turtlesHere()) {
      if (t.getBreed() == breed) {
        resultList.add(t);
View Full Code Here

  @Override
  public void perform(final org.nlogo.nvm.Context context) throws LogoException {
    AgentSet agentset = argEvalAgentSet(context, 0);
    if (!(context.agent instanceof org.nlogo.agent.Observer)) {
      if (agentset == world.turtles()) {
        throw new EngineException
            (context, this, I18N.errorsJ().get("org.nlogo.prim.$common.onlyObserverCanAskAllTurtles"));
      }
      if (agentset == world.patches()) {
        throw new EngineException
            (context, this, I18N.errorsJ().get("org.nlogo.prim.$common.onlyObserverCanAskAllPatches"));
      }
    }
    if (context.makeChildrenExclusive()) {
      context.runExclusiveJob(agentset, next);
View Full Code Here

    arg1.checkAgentSetClass(sourceSet, context);
    for (AgentSet.Iterator iter = sourceSet.shufflerator(context.job.random); iter.hasNext();) {
      Agent tester = iter.next();
      Object value = freshContext.evaluateReporter(tester, arg1);
      if (!(value instanceof Boolean)) {
        throw new EngineException
            (context, this, I18N.errorsJ().getN("org.nlogo.prim.$common.withExpectedBooleanValue",
                Dump.logoObject(tester), Dump.logoObject(value)));
      }
      if (((Boolean) value).booleanValue()) {
        return tester;
View Full Code Here

      throws LogoException {
    Object value = args[0].report(context);
    try {
      context.agent.setPatchVariable(vn, value);
    } catch (org.nlogo.api.AgentException ex) {
      throw new EngineException(context, this, ex.getMessage());
    }
    context.ip = next;
  }
View Full Code Here

  public void perform_1(final Context context, Object arg0)
      throws LogoException {
    try {
      context.agent.setPatchVariable(vn, arg0);
    } catch (org.nlogo.api.AgentException ex) {
      throw new EngineException(context, this, ex.getMessage());
    }
    context.ip = next;
  }
View Full Code Here

      throws LogoException {
    Object value = args[0].report(context);
    try {
      context.agent.setLinkVariable(vn, value);
    } catch (org.nlogo.api.AgentException ex) {
      throw new EngineException(context, this, ex.getMessage());
    }
    context.ip = next;
  }
View Full Code Here

  public void perform_1(final org.nlogo.nvm.Context context, Object value) throws LogoException {
    try {
      context.agent.setLinkVariable(vn, value);
    } catch (org.nlogo.api.AgentException ex) {
      throw new EngineException(context, this, ex.getMessage());
    }
    context.ip = next;
  }
View Full Code Here

  public Object report_1(Context context) throws LogoException {
    try {
      return context.agent.getPatchVariable(vn);
    } catch (org.nlogo.api.AgentException ex) {
      throw new EngineException(context, this, ex.getMessage());
    }
  }
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.