Examples of pcolorDouble()


Examples of org.nlogo.agent.Patch.pcolorDouble()

    int BURNED_TREES_VAR = world.program().interfaceGlobals().size() + 1;
    int patchCount = world.patches().count();
    boolean any = false;
    for (int i = 0; i < patchCount; i++) {
      Patch patch = world.getPatch(i);
      double pcolor = patch.pcolorDouble();
      if (pcolor > RED_MINUS_FOUR && pcolor < RED_PLUS_ONE) {
        any = true;
        break// in the Logo code, the compiler uses _anywith to get this optimization
      }
    }
View Full Code Here

Examples of org.nlogo.agent.Patch.pcolorDouble()

      return;
    }
    for (int i = 0; i < patchCount; i++) {
      Patch patch = world.getPatch(i);
      // if pcolor = green
      if (patch.pcolorDouble() == GREEN) {
        // set counts (nsum4 fire)
        double counts =
            ((Double) patch.getPatchNorth().variables[FIRE_VAR]).doubleValue() +
                ((Double) patch.getPatchSouth().variables[FIRE_VAR]).doubleValue() +
                ((Double) patch.getPatchEast().variables[FIRE_VAR]).doubleValue() +
View Full Code Here

Examples of org.nlogo.agent.Patch.pcolorDouble()

        patch.variables[COUNTS_VAR] = Double.valueOf(counts);
      }
    }
    for (int i = 0; i < patchCount; i++) {
      Patch patch = world.getPatch(i);
      double pcolor = patch.pcolorDouble();
      if (pcolor == GREEN) {
        if (((Double) patch.variables[COUNTS_VAR]).doubleValue() > 0) {
          // set fire 1
          patch.variables[FIRE_VAR] = World.ONE;
          // set pcolor red
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.