Package org.encog.ca.universe

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


  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

  }

  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

      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

        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

      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

  }
 
  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

Related Classes of org.encog.ca.universe.UniverseCell

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.