Examples of UniverseCell


Examples of com.heatonresearch.aifh.examples.ca.mergelife.universe.UniverseCell

        for (int dir = 0; dir < this.rowTransform.length; dir++) {
            final int otherRow = row + this.rowTransform[dir];
            final int otherCol = col + this.colTransform[dir];
            if (this.universe.isValid(otherRow, otherCol)) {
                final UniverseCell otherCell = this.universe.get(otherRow,
                        otherCol);
                total += otherCell.getAvg();
                cnt++;
            }
        }

        total /= cnt;
View Full Code Here

Examples of org.encog.ca.universe.UniverseCell

  public double calculatePercentInvalid() {
    int result = 0;
    int total = 0;
    for(int row = 0; row<getRows(); row++) {     
      for(int col=0; col<getColumns(); col++) {
        UniverseCell cell = get(row,col);
        for(int i=0;i<cell.size();i++) {
          if( cell.get(i)<-1 || cell.get(i)>1 ) {
            result++;
          }
          total++;
        }       
      }
View Full Code Here

Examples of org.encog.ca.universe.UniverseCell

  public UniverseCell getAdd2() {
    return add2;
  }

  public UniverseCell calculate(UniverseCell x) {
    UniverseCell result = this.factory.factor();
    ((ContinuousCell)result).add(x);
    ((ContinuousCell)result).add(add1);
    ((ContinuousCell)result).multiply(mult);
    ((ContinuousCell)result).add(add2);
    return result;
View Full Code Here

Examples of org.encog.ca.universe.UniverseCell

  }

  public void processCell(int row, int col) {
    Movement[] movements = getMovements();

    UniverseCell acc = this.sourceUniverse.getCellFactory().factor();
    UniverseCell thisCell = this.sourceUniverse.get(row, col);
    UniverseCell targetCell = this.targetUniverse.get(row, col);
    Trans trans = findTrans(stepTrans, thisCell);

    for (Movement movement : movements) {
      int otherRow = row + movement.getRowMovement();
      int otherCol = col + movement.getColumnmMovement();
      if (this.sourceUniverse.isValid(otherRow, otherCol)) {
        UniverseCell otherCell = this.sourceUniverse.get(otherRow,
            otherCol);
        UniverseCell tp = trans.calculate(otherCell);
        ((ContinuousCell) acc).add(tp);
      }
    }

    Trans trans2 = findTrans(finalTrans, acc);
View Full Code Here

Examples of org.encog.ca.universe.UniverseCell

      this.pixels = new int[imageSize];
    }

    for (int row = 0; row < height; row++) {
      for (int col = 0; col < width; col++) {
        UniverseCell cell = universe.get(row, col);
        fillCell(row, col, cell);
      }
    }

    raster.setPixels(0, 0, width * this.currentZoom, height
View Full Code Here

Examples of org.encog.ca.universe.UniverseCell

        int row = 0;
        for(String line : section.getLines() ) {
          double[] d = NumberList.fromList(CSVFormat.EG_FORMAT, line);
          int idx = 0;
          for(int col=0;col<cols;col++) {
            UniverseCell cell = result.get(row, col);
            for(int i=0;i<size;i++) {
              cell.set(i, d[idx++]);
            }
          }
          row++;
        }
      }
View Full Code Here

Examples of org.encog.ca.universe.UniverseCell

      throw new CellularAutomataError("Unknown cell factory: " + className);
    }
    out.addSubSection("UNIVERSE");
    for(int row = 0; row<universe.getRows(); row++) {     
      for(int col = 0; col<universe.getColumns(); col++) {
        UniverseCell cell = universe.get(row, col);
        for(int i=0;i<cell.size();i++) {
          out.addColumn(cell.get(i))
        }
       
      }
      out.writeLine();
    }
View Full Code Here

Examples of org.encog.ca.universe.UniverseCell

  }
 
  public void processCell(int row, int col) {
    Movement[] movements = getMovements();
   
    UniverseCell thisCell = this.sourceUniverse.get(row,col);
    UniverseCell targetCell = this.targetUniverse.get(row,col);
   
    int total = 0;
    for(Movement movement : movements ) {
      int otherRow = row+movement.getRowMovement();
      int otherCol = col+movement.getColumnmMovement();
      if( this.sourceUniverse.isValid(otherRow,otherCol) ) {
        UniverseCell otherCell = this.sourceUniverse.get(otherRow,otherCol);       
        if( ((int)otherCell.get(0))>0 ) {
          total++;
        }
      }
    }
   
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.