Examples of CellularAutomataError


Examples of org.encog.ca.CellularAutomataError

 
  @Override
  public void copy(Universe source)
  {
    if( !(source instanceof BasicUniverse) ) {
      throw new CellularAutomataError("Can only copy another BasicUniverse");
    }
    for(int row = 0; row<getRows(); row++) {
      for(int col=0; col<getColumns(); col++) {
        this.data[row][col].copy(source.get(row, col));
      }
View Full Code Here

Examples of org.encog.ca.CellularAutomataError

  }
 
  @Override
  public double compare(Universe otherWorld) {
    if( !(otherWorld instanceof BasicUniverse) ) {
      throw new CellularAutomataError("Can only compare another BasicUniverse");
    }
   
    int result = 0;
    int total = 0;
    for(int row = 0; row<otherWorld.getRows(); row++) {
View Full Code Here

Examples of org.encog.ca.CellularAutomataError

  }

  @Override
  public void copy(UniverseCell sourceCell) {
    if( !(sourceCell instanceof BasicContinuousCell ) ) {
      throw new CellularAutomataError("Can only copy another BasicContinuousCell.");
    }
   
    for(int i=0;i<this.data.length;i++) {
      this.data[i] = sourceCell.get(i);
    }   
View Full Code Here

Examples of org.encog.ca.CellularAutomataError

          runner.getUniverse());
      Image img = visualizer.visualize();
      ImageIO.write((RenderedImage) img, "png",
          new File(FileUtil.forceExtension(f.toString(), "png")));
    } catch (IOException ex) {
      throw new CellularAutomataError(ex);
    }

  }
View Full Code Here

Examples of org.encog.ca.CellularAutomataError

      CAProgram physics = (CAProgram)SerializeObject.load(
          new File(FileUtil.forceExtension(f.toString(), "bin")));
      physics.setSourceUniverse(universe);
      runner.init(universe,physics);
    } catch (IOException ex) {
      throw new CellularAutomataError(ex);
    } catch (ClassNotFoundException ex) {
      throw new CellularAutomataError(ex);
    }
  }
View Full Code Here

Examples of org.encog.ca.CellularAutomataError

  }

  @Override
  public void copy(UniverseCell sourceCell) {
    if( !(sourceCell instanceof BasicDiscreteCell ) ) {
      throw new CellularAutomataError("Can only copy another BasicDiscreteCell.");
    }
   
    for(int i=0;i<this.data.length;i++) {
      this.data[i] = (int)sourceCell.get(i);
    }   
View Full Code Here

Examples of org.encog.ca.CellularAutomataError

      out.writeProperty(BasicUniverse.ELEMENT_COUNT, factory2.getElementCount());
      out.writeProperty(PersistConst.MAX, factory2.getMax());
      out.writeProperty(PersistConst.MIN, factory2.getMin());
      out.writeProperty(PersistConst.SIZE, factory2.size());
    } else {
      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);
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.