Package com.heatonresearch.aifh.examples.ca.mergelife.universe

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


            final int y = e.getY();
            final int row = y / MultiverseViewer.getConfig().getPaneHeight();
            final int col = x / MultiverseViewer.getConfig().getPaneWidth();

            if (this.copySource != null) {
                final UniverseRunner target = this.grid[row][col]
                        .getUniverseRunner();
                target.getPhysics().copyData(
                        this.copySource.getPhysics().getData());
                target.randomize(this.rnd);
            } else if (this.crossoverParent1 != null
                    && this.crossoverParent2 == null) {
                this.crossoverParent2 = this.grid[row][col].getUniverseRunner();
            } else  {
                final UniverseRunner target = this.grid[row][col]
                        .getUniverseRunner();
                target.crossover(this.rnd, this.crossoverParent1, this.crossoverParent2);
                target.randomize(this.rnd);
            }
        }
    }
View Full Code Here


     *
     * @param row The multiverse row.
     * @param col The multiverse column.
     */
    public synchronized void mutateSingle(final int row, final int col) {
        final UniverseRunner target = this.grid[row][col].getUniverseRunner();
        target.mutate(this.rnd, target.getPhysics(), 0.5, 0.2);
        target.randomize(this.rnd);
    }
View Full Code Here

                    final UniversePane cell = this.grid[row][col];
                    final Image img = cell.getImage();
                    this.offscreenGraphics.drawImage(img, x, y, null);

                    final UniverseRunner selected = this.grid[row][col]
                            .getUniverseRunner();

                    // Display any selection information.
                    if (this.copySource != null) {
                        if (this.copySource == selected) {
View Full Code Here

        final Physics physics = new MergePhysics(universe);

        universe.randomize(rnd);
        physics.randomize();

        this.universeRunner = new UniverseRunner(universe, physics);
        this.visualizer = new UniverseVisualizer(universe,
                MultiverseViewer.getConfig().getZoom());
    }
View Full Code Here

        final Universe universe = new Universe(height, width, 3);
        final Physics physics = new MergePhysics(universe);
        physics.copyData(this.sourceData);
        universe.randomize(this.rnd);
        this.runner = new UniverseRunner(universe, physics);
        this.visual = new UniverseVisualizer(universe, this.zoom);

        if (!this.running) {
            this.running = true;
            final Thread t = new Thread(this);
View Full Code Here

TOP

Related Classes of com.heatonresearch.aifh.examples.ca.mergelife.universe.UniverseRunner

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.