Examples of Splice


Examples of cascading.pipe.Splice

      {
      rhsDuct = createBoundaryStage( (Boundary) element, role );
      }
    else if( element instanceof Splice )
      {
      Splice spliceElement = (Splice) element;

      if( spliceElement.isGroupBy() )
        rhsDuct = createGroupByGate( (GroupBy) spliceElement, role );
      else if( spliceElement.isCoGroup() )
        rhsDuct = createCoGroupGate( (CoGroup) spliceElement, role );
      else if( spliceElement.isMerge() )
        rhsDuct = createMergeStage( (Merge) element, role );
      else
        rhsDuct = createHashJoinGate( (HashJoin) element );
      }
    else if( element instanceof Tap )
View Full Code Here

Examples of cascading.pipe.Splice

  private void setOrdinal( FlowElement previous, Pipe current, Scope scope )
    {
    if( current instanceof Splice )
      {
      Splice splice = (Splice) current;

      Integer ordinal;

      if( previous instanceof Tap ) // revert to pipe name
        ordinal = splice.getPipePos().get( scope.getName() );
      else // GroupBy allows for duplicate pipe names, this guarantees correct ordinality
        ordinal = FlowElements.findOrdinal( splice, (Pipe) previous );

      scope.setOrdinal( ordinal );

      Set<Scope> scopes = new HashSet<>( incomingEdgesOf( current ) );

      scopes.remove( scope );

      for( Scope other : scopes )
        {
        if( other.getOrdinal() == scope.getOrdinal() )
          throw new IllegalStateException( "duplicate ordinals" );
        }

      if( splice.isJoin() && ordinal != 0 )
        scope.setNonBlocking( false );
      }
    }
View Full Code Here

Examples of cascading.pipe.Splice

    final Pipe previous = pipe.getPrevious()[ 0 ];

    if( !( previous instanceof Splice ) )
      return null;

    final Splice splice = (Splice) previous;

    if( splice.getDeclaredFields() == null )
      return null;

    return fieldNames( splice.getDeclaredFields() );
    }
View Full Code Here

Examples of com.heatonresearch.aifh.genetic.crossover.Splice

            ScoreFunction score = new ScoreRegressionData(trainingData);

            BasicEA genetic = new BasicEA(pop, score);
            genetic.setSpeciation(new ArraySpeciation<DoubleArrayGenome>());
            genetic.setCODEC(codec);
            genetic.addOperation(0.7, new Splice(codec.size() / 5));
            genetic.addOperation(0.3, new MutatePerturb(0.1));


            performIterations(genetic, 100000, 0.05, true);
View Full Code Here

Examples of com.heatonresearch.aifh.genetic.crossover.Splice

            ScoreFunction score = new ScoreRegressionData(trainingData);

            BasicEA genetic = new BasicEA(pop, score);
            genetic.setCODEC(codec);
            genetic.addOperation(0.7, new Splice(codec.size() / 3));
            genetic.addOperation(0.3, new MutatePerturb(0.1));


            performIterations(genetic, 100000, 0.05, true);
View Full Code Here

Examples of com.heatonresearch.aifh.genetic.crossover.Splice

        this.score = new PlantScore();
        this.genetic = new BasicEA(pop, score);

        this.genetic.setSpeciation(new ArraySpeciation<DoubleArrayGenome>());

        genetic.addOperation(0.9, new Splice(PlantUniverse.GENOME_SIZE / 3));
        genetic.addOperation(0.1, new MutatePerturb(0.1));

        // Display

        this.universe = new PlantUniverse();
View Full Code Here

Examples of com.heatonresearch.aifh.genetic.crossover.Splice

                return false;
            }
        });

        // Create a splice operator, length = 5.  Use it 1.0 (100%) of the time.
        Splice opp = new Splice(5);
        train.addOperation(1.0, opp);

        // Create two parents, the genes are set to 1,2,3,4,5,7,8,9,10
        // and 10,9,8,7,6,5,4,3,2,1.
        IntegerArrayGenome[] parents = new IntegerArrayGenome[2];
        parents[0] = (IntegerArrayGenome) pop.getGenomeFactory().factor();
        parents[1] = (IntegerArrayGenome) pop.getGenomeFactory().factor();
        for (int i = 1; i <= 10; i++) {
            parents[0].getData()[i - 1] = i;
            parents[1].getData()[i - 1] = 11 - i;
        }

        // Create an array to hold the offspring.
        IntegerArrayGenome[] offspring = new IntegerArrayGenome[2];

        // Perform the operation
        opp.performOperation(rnd, parents, 0, offspring, 0);

        // Display the results
        System.out.println("Parent 1: " + Arrays.toString(parents[0].getData()));
        System.out.println("Parent 2: " + Arrays.toString(parents[1].getData()));
        System.out.println("Offspring 1: " + Arrays.toString(offspring[0].getData()));
View Full Code Here

Examples of org.encog.ml.genetic.crossover.Splice

    final Population population = new BasicPopulation(populationSize);
    getGenetic().setMutationPercent(mutationPercent);
    getGenetic().setMatingPopulation(percentToMate * 2);
    getGenetic().setPercentToMate(percentToMate);
    getGenetic().setCrossover(
        new Splice(network.getStructure().calculateSize() / 3));
    getGenetic().setMutate(new MutatePerturb(4.0));
    getGenetic().setPopulation(population);
    for (int i = 0; i < population.getPopulationSize(); i++) {
      final BasicNetwork chromosomeNetwork = (BasicNetwork) network
          .clone();
View Full Code Here

Examples of org.encog.ml.genetic.crossover.Splice

    GeneticAlgorithm genetic = new BasicGeneticAlgorithm();
    initPopulation(genetic);
    genetic.setMutationPercent(MUTATION_PERCENT);
    genetic.setPercentToMate(PERCENT_TO_MATE);
    genetic.setMatingPopulation(MATING_POPULATION_PERCENT);
    genetic.setCrossover(new Splice(CUT_LENGTH));
    genetic.setMutate(new MutateShuffle());
   
    boolean done = false;
    int iteration = 0;
   
View Full Code Here

Examples of org.encog.ml.genetic.crossover.Splice

    // create the operators
    final int s = Math
        .max(defaultSpecies.getMembers().get(0).size() / 5, 1);
    getGenetic().setPopulation(population);

    this.genetic.addOperation(0.9, new Splice(s));
    this.genetic.addOperation(0.1, new MutatePerturb(1.0));
  }
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.