diff --git a/framework/Optimizers/crossOverOperators/crossovers.py b/framework/Optimizers/crossOverOperators/crossovers.py index 9414944f0a..4970b7dd36 100644 --- a/framework/Optimizers/crossOverOperators/crossovers.py +++ b/framework/Optimizers/crossOverOperators/crossovers.py @@ -40,9 +40,9 @@ def onePointCrossover(parents,**kwargs): nParents,nGenes = np.shape(parents) # Number of children = 2* (nParents choose 2) children = xr.DataArray(np.zeros((int(2*comb(nParents,2)),nGenes)), - dims=['chromosome','Gene'], - coords={'chromosome': np.arange(int(2*comb(nParents,2))), - 'Gene':kwargs['variables']}) + dims=['chromosome','Gene'], + coords={'chromosome': np.arange(int(2*comb(nParents,2))), + 'Gene':kwargs['variables']}) # defaults @@ -106,7 +106,7 @@ def uniformCrossover(parents,**kwargs): return children -def twoPointsCrossover(parents, parentIndexes,**kwargs): +def twoPointsCrossover(parents, **kwargs): """ Method designed to perform a two point crossover on 2 parents: Partition each parents in three sequences (A,B,C): @@ -116,7 +116,6 @@ def twoPointsCrossover(parents, parentIndexes,**kwargs): children1 = A1 B2 C1 children2 = A2 B1 C2 @ In, parents, xr.DataArray, parents involved in the mating process - @ In, parentIndexes, list, list containing pairs of parents @ In, kwargs, dict, dictionary of parameters for this mutation method: parents, 2D array, parents in the current mating process. Shape is nParents x len(chromosome) i.e, number of Genes/Vars @@ -129,23 +128,20 @@ def twoPointsCrossover(parents, parentIndexes,**kwargs): dims=['chromosome','Gene'], coords={'chromosome': np.arange(int(2*comb(nParents,2))), 'Gene':parents.coords['Gene'].values}) + parentPairs = list(combinations(parents,2)) index = 0 - for couples in parentIndexes: - locRangeList = list(range(0,nGenes)) - index1 = randomUtils.randomIntegers(0, len(locRangeList), caller=None, engine=None) - loc1 = locRangeList[index1] - locRangeList.pop(loc1) - index2 = randomUtils.randomIntegers(0, len(locRangeList), caller=None, engine=None) - loc2 = locRangeList[index2] - if loc1>loc2: - locL=loc2 - locU=loc1 - elif loc1=3!') + for couples in parentPairs: + [loc1,loc2] = randomUtils.randomChoice(list(range(1,nGenes)), size=2, replace=False, engine=None) + if loc1 > loc2: + locL = loc2 + locU = loc1 + else: locL=loc1 locU=loc2 - - parent1 = parents[couples[0]].values - parent2 = parents[couples[1]].values + parent1 = couples[0] + parent2 = couples[1] children1,children2 = twoPointsCrossoverMethod(parent1,parent2,locL,locU) children[index] = children1 @@ -187,14 +183,14 @@ def twoPointsCrossoverMethod(parent1,parent2,locL,locU): @ Out, children1: first generated array @ Out, children2: second generated array """ - children1 = parent1 - children2 = parent2 + children1 = parent1.copy(deep=True) + children2 = parent2.copy(deep=True) - seqB1 = parent1.values[locL:locU+1] - seqB2 = parent2.values[locL:locU+1] + seqB1 = parent1.values[locL:locU] + seqB2 = parent2.values[locL:locU] - children1[locL:locU+1] = seqB2 - children2[locL:locU+1] = seqB1 + children1[locL:locU] = seqB2 + children2[locL:locU] = seqB1 return children1,children2 def uniformCrossoverMethod(parent1,parent2,crossoverProb): diff --git a/framework/Optimizers/parentSelectors/parentSelectors.py b/framework/Optimizers/parentSelectors/parentSelectors.py index 0be3ca8396..b1ded3e431 100644 --- a/framework/Optimizers/parentSelectors/parentSelectors.py +++ b/framework/Optimizers/parentSelectors/parentSelectors.py @@ -124,9 +124,9 @@ def tournamentSelection(population,**kwargs): if not multiObjectiveRanking: # single-objective implementation of tournamentSelection for i in range(nParents): if matrixOperation[2*i,1] > matrixOperation[2*i+1,1]: - index = int(matrixOperation[i,0]) + index = int(matrixOperation[2*i,0]) else: - index = int(matrixOperation[i+1,0]) + index = int(matrixOperation[2*i+1,0]) selectedParent[i,:] = pop.values[index,:] else: # multi-objective implementation of tournamentSelection for i in range(nParents-1): @@ -147,8 +147,8 @@ def tournamentSelection(population,**kwargs): def rankSelection(population,**kwargs): """ Rank Selection mechanism for parent selection - - @ In, population, xr.DataArray, populations containing all chromosomes (individuals) candidate to be parents, i.e. population.values.shape = populationSize x nGenes. + @ In, population, xr.DataArray, populations containing all chromosomes (individuals) candidate to be parents, + i.e. population.values.shape = populationSize x nGenes. @ In, kwargs, dict, dictionary of parameters for this mutation method: fitness, np.array, fitness of each chromosome (individual) in the population, i.e., np.shape(fitness) = 1 x populationSize nParents, int, number of required parents. @@ -166,7 +166,11 @@ def rankSelection(population,**kwargs): dataOrderedByIncreasingPos = dataOrderedByDecreasingFitness[:,dataOrderedByDecreasingFitness[1].argsort()] orderedRank = dataOrderedByIncreasingPos[0,:] - selectedParent = rouletteWheel(population, fitness=orderedRank , nParents=kwargs['nParents'],variables=kwargs['variables']) + rank = xr.DataArray(orderedRank, + dims=['chromosome'], + coords={'chromosome': np.arange(np.shape(orderedRank)[0])}) + + selectedParent = rouletteWheel(population, fitness=rank , nParents=kwargs['nParents'],variables=kwargs['variables']) return selectedParent diff --git a/framework/Optimizers/survivorSelectors/survivorSelectors.py b/framework/Optimizers/survivorSelectors/survivorSelectors.py index b00fd347b2..1b754af494 100644 --- a/framework/Optimizers/survivorSelectors/survivorSelectors.py +++ b/framework/Optimizers/survivorSelectors/survivorSelectors.py @@ -123,6 +123,7 @@ def fitnessBased(newRlz,**kwargs): dims=['chromosome'], coords={'chromosome':np.arange(np.shape(newFitness)[0])}) + #return newPopulationArray,newFitness,newAge return newPopulationArray,newFitness,newAge,kwargs['popObjectiveVal'] __survivorSelectors = {} diff --git a/tests/framework/Optimizers/GeneticAlgorithms/discrete/unconstrained/testGAMaxwoRepTwoPointsCrossover.xml b/tests/framework/Optimizers/GeneticAlgorithms/discrete/unconstrained/testGAMaxwoRepTwoPointsCrossover.xml new file mode 100644 index 0000000000..13c428cf0c --- /dev/null +++ b/tests/framework/Optimizers/GeneticAlgorithms/discrete/unconstrained/testGAMaxwoRepTwoPointsCrossover.xml @@ -0,0 +1,172 @@ + + + + framework/Optimizers/GA.MaxwoReplacemenTwoPointsCrossovert + MohammadAbdo + 2020-05-16 + GeneticAlgorithm + + This test assesses the Genetic algorithm using the weighted sum found in myLocalSum.py function. + The nominal dimensionality of the test problem is 3. + The objective variable is ans. The problem in unconstrained, it is a maximization problem, and the sampling is from discrete variables without replacement. + The cross over mechanism used is the twoPointsCrossover algorithm + + + This test uses myLocalSum's analytic objective function. + + + + + MaxwoReplacementTwoPointsCrossover + optimize, print + + + + + placeholder + myLocalSum + GAopt + opt_export + optOut + + + opt_export + optOut + opt_export + optOut + + + + + + 1 + 6 + withReplacement + + + + 1 + 6 + withoutReplacement + + + + + + + 20 + 42 + every + max + + + + 20 + rouletteWheel + + + 0.8 + + + 0.9 + + + + 2.0 + 1.0 + + fitnessBased + + + + -1 + + + + uniform_dist_woRepl_1 + + + + uniform_dist_woRepl_1 + + + + uniform_dist_woRepl_1 + + + + uniform_dist_woRepl_1 + + + + uniform_dist_woRepl_1 + + + + uniform_dist_woRepl_1 + + + ans + optOut + MC_samp + + + + + + + 20 + 20021986 + + + uniform_dist_woRepl_1 + + + uniform_dist_woRepl_1 + + + uniform_dist_woRepl_1 + + + uniform_dist_woRepl_1 + + + uniform_dist_woRepl_1 + + + uniform_dist_woRepl_1 + + + + + + + x1,x2,x3,x4,x5,x6,ans + x1,x2,x3,x4,x5,x6,ans + + + + + + + x1,x2,x3,x4,x5,x6 + ans + + + trajID + x1,x2,x3,x4,x5,x6,ans,age,batchId,fitness,iteration,accepted,conv_objective + + + + + + csv + optOut + + + csv + opt_export + trajID + + + diff --git a/tests/framework/Optimizers/GeneticAlgorithms/gold/discrete/unconstrained/MaxwoReplacementTwoPointsCrossover/opt_export_0.csv b/tests/framework/Optimizers/GeneticAlgorithms/gold/discrete/unconstrained/MaxwoReplacementTwoPointsCrossover/opt_export_0.csv new file mode 100644 index 0000000000..966483f257 --- /dev/null +++ b/tests/framework/Optimizers/GeneticAlgorithms/gold/discrete/unconstrained/MaxwoReplacementTwoPointsCrossover/opt_export_0.csv @@ -0,0 +1,402 @@ +x1,x2,x3,x4,x5,x6,ans,age,batchId,fitness,iteration,accepted,conv_objective +5.0,3.0,1.0,4.0,2.0,6.0,76.0,0.0,1.0,152.0,0.0,first,0.0 +6.0,3.0,4.0,1.0,2.0,5.0,68.0,0.0,1.0,136.0,0.0,first,0.0 +3.0,2.0,5.0,6.0,1.0,4.0,75.0,0.0,1.0,150.0,0.0,first,0.0 +6.0,3.0,2.0,4.0,5.0,1.0,65.0,0.0,1.0,130.0,0.0,first,0.0 +3.0,5.0,6.0,1.0,2.0,4.0,69.0,0.0,1.0,138.0,0.0,first,0.0 +3.0,5.0,1.0,4.0,6.0,2.0,74.0,0.0,1.0,148.0,0.0,first,0.0 +3.0,6.0,1.0,4.0,2.0,5.0,74.0,0.0,1.0,148.0,0.0,first,0.0 +5.0,2.0,4.0,1.0,3.0,6.0,76.0,0.0,1.0,152.0,0.0,first,0.0 +3.0,4.0,2.0,5.0,6.0,1.0,73.0,0.0,1.0,146.0,0.0,first,0.0 +1.0,3.0,5.0,4.0,2.0,6.0,84.0,0.0,1.0,168.0,0.0,first,0.0 +6.0,5.0,2.0,1.0,4.0,3.0,64.0,0.0,1.0,128.0,0.0,first,0.0 +5.0,1.0,6.0,4.0,2.0,3.0,69.0,0.0,1.0,138.0,0.0,first,0.0 +2.0,5.0,3.0,6.0,4.0,1.0,71.0,0.0,1.0,142.0,0.0,first,0.0 +1.0,2.0,5.0,6.0,3.0,4.0,83.0,0.0,1.0,166.0,0.0,first,0.0 +6.0,2.0,4.0,3.0,1.0,5.0,69.0,0.0,1.0,138.0,0.0,first,0.0 +4.0,2.0,1.0,5.0,3.0,6.0,82.0,0.0,1.0,164.0,0.0,first,0.0 +5.0,2.0,3.0,6.0,1.0,4.0,71.0,0.0,1.0,142.0,0.0,first,0.0 +1.0,4.0,3.0,5.0,6.0,2.0,80.0,0.0,1.0,160.0,0.0,first,0.0 +3.0,5.0,1.0,6.0,4.0,2.0,72.0,0.0,1.0,144.0,0.0,first,0.0 +4.0,5.0,2.0,1.0,6.0,3.0,72.0,0.0,1.0,144.0,0.0,first,0.0 +6.0,3.0,2.0,5.0,1.0,4.0,67.0,0.0,2.0,134.0,1.0,accepted,0.0 +2.0,4.0,1.0,5.0,6.0,3.0,81.0,0.0,2.0,162.0,1.0,accepted,0.0 +6.0,5.0,1.0,4.0,3.0,2.0,62.0,0.0,2.0,124.0,1.0,accepted,0.0 +3.0,4.0,2.0,1.0,5.0,6.0,82.0,0.0,2.0,164.0,1.0,accepted,0.0 +3.0,4.0,1.0,6.0,5.0,2.0,75.0,0.0,2.0,150.0,1.0,accepted,0.0 +2.0,5.0,6.0,3.0,1.0,4.0,71.0,0.0,2.0,142.0,1.0,accepted,0.0 +6.0,4.0,5.0,1.0,3.0,2.0,60.0,0.0,2.0,120.0,1.0,accepted,0.0 +3.0,2.0,1.0,6.0,5.0,4.0,83.0,0.0,2.0,166.0,1.0,accepted,0.0 +2.0,6.0,1.0,4.0,5.0,3.0,76.0,0.0,2.0,152.0,1.0,accepted,0.0 +2.0,3.0,1.0,4.0,6.0,5.0,87.0,0.0,2.0,174.0,1.0,accepted,0.0 +2.0,5.0,3.0,6.0,4.0,1.0,71.0,0.0,2.0,142.0,1.0,accepted,0.0 +4.0,3.0,1.0,5.0,2.0,6.0,79.0,0.0,2.0,158.0,1.0,accepted,0.0 +2.0,3.0,5.0,6.0,4.0,1.0,73.0,0.0,2.0,146.0,1.0,accepted,0.0 +3.0,2.0,1.0,4.0,6.0,5.0,86.0,0.0,2.0,172.0,1.0,accepted,0.0 +4.0,6.0,1.0,2.0,3.0,5.0,72.0,0.0,2.0,144.0,1.0,accepted,0.0 +2.0,5.0,3.0,4.0,1.0,6.0,78.0,0.0,2.0,156.0,1.0,accepted,0.0 +2.0,4.0,5.0,1.0,3.0,6.0,80.0,0.0,2.0,160.0,1.0,accepted,0.0 +3.0,6.0,1.0,5.0,4.0,2.0,70.0,0.0,2.0,140.0,1.0,accepted,0.0 +3.0,5.0,1.0,6.0,2.0,4.0,74.0,0.0,2.0,148.0,1.0,accepted,0.0 +4.0,2.0,5.0,6.0,1.0,3.0,70.0,0.0,2.0,140.0,1.0,accepted,0.0 +4.0,2.0,1.0,6.0,3.0,5.0,80.0,1.0,3.0,160.0,2.0,accepted,0.0 +6.0,2.0,5.0,3.0,4.0,1.0,63.0,1.0,3.0,126.0,2.0,accepted,0.0 +4.0,6.0,1.0,5.0,2.0,3.0,67.0,1.0,3.0,134.0,2.0,accepted,0.0 +3.0,2.0,5.0,4.0,6.0,1.0,74.0,1.0,3.0,148.0,2.0,accepted,0.0 +4.0,2.0,5.0,3.0,1.0,6.0,76.0,1.0,3.0,152.0,2.0,accepted,0.0 +2.0,4.0,3.0,6.0,1.0,5.0,78.0,1.0,3.0,156.0,2.0,accepted,0.0 +4.0,2.0,1.0,6.0,5.0,3.0,78.0,1.0,3.0,156.0,2.0,accepted,0.0 +3.0,2.0,5.0,6.0,1.0,4.0,75.0,1.0,3.0,150.0,2.0,accepted,0.0 +6.0,4.0,1.0,5.0,3.0,2.0,64.0,1.0,3.0,128.0,2.0,accepted,0.0 +3.0,2.0,4.0,5.0,6.0,1.0,75.0,1.0,3.0,150.0,2.0,accepted,0.0 +6.0,4.0,3.0,1.0,5.0,2.0,64.0,1.0,3.0,128.0,2.0,accepted,0.0 +2.0,5.0,3.0,1.0,6.0,4.0,79.0,1.0,3.0,158.0,2.0,accepted,0.0 +6.0,2.0,1.0,5.0,4.0,3.0,71.0,1.0,3.0,142.0,2.0,accepted,0.0 +4.0,2.0,5.0,1.0,3.0,6.0,78.0,1.0,3.0,156.0,2.0,accepted,0.0 +2.0,6.0,3.0,5.0,4.0,1.0,69.0,1.0,3.0,138.0,2.0,accepted,0.0 +6.0,4.0,1.0,5.0,2.0,3.0,65.0,1.0,3.0,130.0,2.0,accepted,0.0 +3.0,6.0,1.0,4.0,5.0,2.0,71.0,1.0,3.0,142.0,2.0,accepted,0.0 +4.0,2.0,1.0,5.0,6.0,3.0,79.0,1.0,3.0,158.0,2.0,accepted,0.0 +2.0,4.0,3.0,6.0,1.0,5.0,78.0,1.0,3.0,156.0,2.0,accepted,0.0 +4.0,2.0,1.0,5.0,6.0,3.0,79.0,1.0,3.0,158.0,2.0,accepted,0.0 +2.0,6.0,1.0,5.0,3.0,4.0,76.0,1.0,4.0,152.0,3.0,accepted,0.0 +4.0,2.0,1.0,3.0,5.0,6.0,84.0,1.0,4.0,168.0,3.0,accepted,0.0 +2.0,6.0,1.0,4.0,3.0,5.0,78.0,1.0,4.0,156.0,3.0,accepted,0.0 +1.0,6.0,3.0,5.0,4.0,2.0,74.0,1.0,4.0,148.0,3.0,accepted,0.0 +2.0,3.0,1.0,6.0,5.0,4.0,84.0,1.0,4.0,168.0,3.0,accepted,0.0 +4.0,6.0,1.0,2.0,3.0,5.0,72.0,1.0,4.0,144.0,3.0,accepted,0.0 +2.0,6.0,5.0,4.0,3.0,1.0,66.0,1.0,4.0,132.0,3.0,accepted,0.0 +1.0,3.0,2.0,6.0,5.0,4.0,86.0,1.0,4.0,172.0,3.0,accepted,0.0 +4.0,6.0,1.0,5.0,3.0,2.0,66.0,1.0,4.0,132.0,3.0,accepted,0.0 +1.0,2.0,3.0,5.0,4.0,6.0,90.0,1.0,4.0,180.0,3.0,accepted,0.0 +4.0,2.0,1.0,6.0,5.0,3.0,78.0,1.0,4.0,156.0,3.0,accepted,0.0 +4.0,5.0,1.0,2.0,3.0,6.0,76.0,1.0,4.0,152.0,3.0,accepted,0.0 +4.0,3.0,5.0,6.0,2.0,1.0,65.0,1.0,4.0,130.0,3.0,accepted,0.0 +1.0,4.0,5.0,3.0,2.0,6.0,82.0,1.0,4.0,164.0,3.0,accepted,0.0 +1.0,6.0,4.0,5.0,2.0,3.0,73.0,1.0,4.0,146.0,3.0,accepted,0.0 +4.0,1.0,3.0,5.0,2.0,6.0,81.0,1.0,4.0,162.0,3.0,accepted,0.0 +1.0,3.0,5.0,6.0,4.0,2.0,78.0,1.0,4.0,156.0,3.0,accepted,0.0 +1.0,6.0,3.0,5.0,2.0,4.0,76.0,1.0,4.0,152.0,3.0,accepted,0.0 +4.0,3.0,1.0,6.0,2.0,5.0,77.0,1.0,4.0,154.0,3.0,accepted,0.0 +1.0,5.0,3.0,6.0,2.0,4.0,78.0,1.0,4.0,156.0,3.0,accepted,0.0 +2.0,3.0,4.0,5.0,1.0,6.0,81.0,1.0,5.0,162.0,4.0,accepted,0.0 +4.0,5.0,1.0,6.0,3.0,2.0,68.0,1.0,5.0,136.0,4.0,accepted,0.0 +2.0,3.0,4.0,5.0,1.0,6.0,81.0,1.0,5.0,162.0,4.0,accepted,0.0 +1.0,5.0,2.0,3.0,6.0,4.0,83.0,1.0,5.0,166.0,4.0,accepted,0.0 +2.0,5.0,4.0,1.0,6.0,3.0,76.0,1.0,5.0,152.0,4.0,accepted,0.0 +3.0,1.0,2.0,4.0,5.0,6.0,88.0,1.0,5.0,176.0,4.0,accepted,0.0 +2.0,1.0,4.0,5.0,3.0,6.0,87.0,1.0,5.0,174.0,4.0,accepted,0.0 +4.0,5.0,2.0,1.0,6.0,3.0,72.0,1.0,5.0,144.0,4.0,accepted,0.0 +4.0,3.0,2.0,5.0,1.0,6.0,77.0,1.0,5.0,154.0,4.0,accepted,0.0 +1.0,3.0,4.0,5.0,2.0,6.0,85.0,1.0,5.0,170.0,4.0,accepted,0.0 +4.0,1.0,3.0,2.0,6.0,5.0,83.0,1.0,5.0,166.0,4.0,accepted,0.0 +3.0,4.0,2.0,5.0,6.0,1.0,73.0,1.0,5.0,146.0,4.0,accepted,0.0 +4.0,3.0,1.0,5.0,2.0,6.0,79.0,1.0,5.0,158.0,4.0,accepted,0.0 +4.0,2.0,1.0,5.0,6.0,3.0,79.0,1.0,5.0,158.0,4.0,accepted,0.0 +1.0,3.0,2.0,4.0,6.0,5.0,89.0,1.0,5.0,178.0,4.0,accepted,0.0 +3.0,1.0,2.0,5.0,4.0,6.0,87.0,1.0,5.0,174.0,4.0,accepted,0.0 +1.0,3.0,2.0,5.0,6.0,4.0,87.0,1.0,5.0,174.0,4.0,accepted,0.0 +4.0,1.0,2.0,5.0,3.0,6.0,83.0,1.0,5.0,166.0,4.0,accepted,0.0 +3.0,1.0,2.0,5.0,6.0,4.0,85.0,1.0,5.0,170.0,4.0,accepted,0.0 +4.0,1.0,2.0,5.0,6.0,3.0,80.0,1.0,5.0,160.0,4.0,accepted,0.0 +3.0,1.0,2.0,5.0,6.0,4.0,85.0,1.0,6.0,170.0,5.0,accepted,0.0 +6.0,1.0,2.0,5.0,4.0,3.0,72.0,1.0,6.0,144.0,5.0,accepted,0.0 +6.0,5.0,2.0,4.0,3.0,1.0,59.0,1.0,6.0,118.0,5.0,accepted,0.0 +6.0,1.0,2.0,3.0,4.0,5.0,76.0,1.0,6.0,152.0,5.0,accepted,0.0 +4.0,1.0,2.0,5.0,3.0,6.0,83.0,1.0,6.0,166.0,5.0,accepted,0.0 +6.0,1.0,2.0,5.0,3.0,4.0,73.0,1.0,6.0,146.0,5.0,accepted,0.0 +6.0,1.0,4.0,5.0,3.0,2.0,67.0,1.0,6.0,134.0,5.0,accepted,0.0 +2.0,1.0,3.0,5.0,4.0,6.0,89.0,1.0,6.0,178.0,5.0,accepted,0.0 +3.0,1.0,2.0,6.0,4.0,5.0,85.0,1.0,6.0,170.0,5.0,accepted,0.0 +1.0,5.0,2.0,6.0,3.0,4.0,80.0,1.0,6.0,160.0,5.0,accepted,0.0 +2.0,1.0,3.0,5.0,4.0,6.0,89.0,1.0,6.0,178.0,5.0,accepted,0.0 +4.0,1.0,2.0,5.0,3.0,6.0,83.0,1.0,6.0,166.0,5.0,accepted,0.0 +3.0,1.0,4.0,5.0,6.0,2.0,79.0,1.0,6.0,158.0,5.0,accepted,0.0 +2.0,1.0,3.0,5.0,6.0,4.0,87.0,1.0,6.0,174.0,5.0,accepted,0.0 +4.0,1.0,2.0,5.0,6.0,3.0,80.0,1.0,6.0,160.0,5.0,accepted,0.0 +6.0,5.0,2.0,3.0,4.0,1.0,60.0,1.0,6.0,120.0,5.0,accepted,0.0 +3.0,5.0,2.0,1.0,6.0,4.0,77.0,1.0,6.0,154.0,5.0,accepted,0.0 +6.0,1.0,4.0,3.0,2.0,5.0,72.0,1.0,6.0,144.0,5.0,accepted,0.0 +3.0,1.0,4.0,5.0,2.0,6.0,83.0,1.0,6.0,166.0,5.0,accepted,0.0 +2.0,1.0,3.0,5.0,4.0,6.0,89.0,1.0,6.0,178.0,5.0,accepted,0.0 +1.0,2.0,6.0,3.0,4.0,5.0,85.0,5.0,7.0,170.0,6.0,accepted,0.0 +4.0,3.0,2.0,6.0,5.0,1.0,71.0,5.0,7.0,142.0,6.0,accepted,0.0 +1.0,3.0,5.0,4.0,6.0,2.0,80.0,5.0,7.0,160.0,6.0,accepted,0.0 +2.0,3.0,4.0,5.0,6.0,1.0,76.0,5.0,7.0,152.0,6.0,accepted,0.0 +1.0,3.0,2.0,5.0,6.0,4.0,87.0,5.0,7.0,174.0,6.0,accepted,0.0 +3.0,1.0,2.0,4.0,6.0,5.0,87.0,5.0,7.0,174.0,6.0,accepted,0.0 +1.0,2.0,4.0,3.0,6.0,5.0,89.0,5.0,7.0,178.0,6.0,accepted,0.0 +3.0,2.0,1.0,5.0,6.0,4.0,84.0,5.0,7.0,168.0,6.0,accepted,0.0 +4.0,2.0,1.0,6.0,5.0,3.0,78.0,5.0,7.0,156.0,6.0,accepted,0.0 +2.0,3.0,1.0,5.0,6.0,4.0,85.0,5.0,7.0,170.0,6.0,accepted,0.0 +4.0,2.0,1.0,6.0,3.0,5.0,80.0,5.0,7.0,160.0,6.0,accepted,0.0 +4.0,1.0,2.0,3.0,5.0,6.0,85.0,5.0,7.0,170.0,6.0,accepted,0.0 +4.0,2.0,1.0,6.0,5.0,3.0,78.0,5.0,7.0,156.0,6.0,accepted,0.0 +3.0,2.0,1.0,5.0,6.0,4.0,84.0,5.0,7.0,168.0,6.0,accepted,0.0 +2.0,3.0,5.0,1.0,6.0,4.0,81.0,5.0,7.0,162.0,6.0,accepted,0.0 +3.0,1.0,4.0,6.0,5.0,2.0,78.0,5.0,7.0,156.0,6.0,accepted,0.0 +2.0,5.0,1.0,3.0,6.0,4.0,81.0,5.0,7.0,162.0,6.0,accepted,0.0 +3.0,5.0,1.0,2.0,6.0,4.0,78.0,5.0,7.0,156.0,6.0,accepted,0.0 +3.0,1.0,2.0,4.0,6.0,5.0,87.0,5.0,7.0,174.0,6.0,accepted,0.0 +3.0,2.0,1.0,5.0,6.0,4.0,84.0,5.0,7.0,168.0,6.0,accepted,0.0 +2.0,3.0,5.0,6.0,1.0,4.0,76.0,0.0,8.0,152.0,7.0,accepted,0.0 +1.0,2.0,3.0,5.0,6.0,4.0,88.0,0.0,8.0,176.0,7.0,accepted,0.0 +2.0,1.0,5.0,3.0,6.0,4.0,85.0,0.0,8.0,170.0,7.0,accepted,0.0 +4.0,1.0,3.0,5.0,6.0,2.0,77.0,0.0,8.0,154.0,7.0,accepted,0.0 +2.0,1.0,3.0,4.0,6.0,5.0,89.0,0.0,8.0,178.0,7.0,accepted,0.0 +2.0,3.0,1.0,5.0,4.0,6.0,87.0,0.0,8.0,174.0,7.0,accepted,0.0 +2.0,3.0,5.0,6.0,4.0,1.0,73.0,0.0,8.0,146.0,7.0,accepted,0.0 +1.0,4.0,3.0,5.0,2.0,6.0,84.0,0.0,8.0,168.0,7.0,accepted,0.0 +1.0,6.0,2.0,5.0,4.0,3.0,77.0,0.0,8.0,154.0,7.0,accepted,0.0 +4.0,3.0,2.0,5.0,6.0,1.0,72.0,0.0,8.0,144.0,7.0,accepted,0.0 +1.0,3.0,2.0,4.0,5.0,6.0,90.0,0.0,8.0,180.0,7.0,accepted,0.0 +2.0,3.0,1.0,6.0,5.0,4.0,84.0,0.0,8.0,168.0,7.0,accepted,0.0 +1.0,3.0,2.0,5.0,4.0,6.0,89.0,0.0,8.0,178.0,7.0,accepted,0.0 +1.0,3.0,2.0,6.0,4.0,5.0,87.0,0.0,8.0,174.0,7.0,accepted,0.0 +4.0,1.0,3.0,6.0,5.0,2.0,76.0,0.0,8.0,152.0,7.0,accepted,0.0 +2.0,3.0,4.0,1.0,5.0,6.0,85.0,0.0,8.0,170.0,7.0,accepted,0.0 +4.0,3.0,2.0,5.0,6.0,1.0,72.0,0.0,8.0,144.0,7.0,accepted,0.0 +1.0,6.0,2.0,3.0,4.0,5.0,81.0,0.0,8.0,162.0,7.0,accepted,0.0 +2.0,3.0,1.0,5.0,4.0,6.0,87.0,0.0,8.0,174.0,7.0,accepted,0.0 +1.0,3.0,2.0,4.0,5.0,6.0,90.0,0.0,8.0,180.0,7.0,accepted,0.0 +6.0,3.0,1.0,5.0,4.0,2.0,67.0,3.0,9.0,134.0,8.0,accepted,0.0 +2.0,1.0,4.0,5.0,6.0,3.0,84.0,3.0,9.0,168.0,8.0,accepted,0.0 +2.0,1.0,3.0,5.0,4.0,6.0,89.0,3.0,9.0,178.0,8.0,accepted,0.0 +6.0,3.0,1.0,5.0,4.0,2.0,67.0,3.0,9.0,134.0,8.0,accepted,0.0 +6.0,3.0,4.0,1.0,2.0,5.0,68.0,3.0,9.0,136.0,8.0,accepted,0.0 +5.0,2.0,1.0,6.0,4.0,3.0,74.0,3.0,9.0,148.0,8.0,accepted,0.0 +6.0,3.0,5.0,4.0,1.0,2.0,60.0,3.0,9.0,120.0,8.0,accepted,0.0 +1.0,2.0,4.0,5.0,3.0,6.0,88.0,3.0,9.0,176.0,8.0,accepted,0.0 +6.0,1.0,3.0,5.0,4.0,2.0,69.0,3.0,9.0,138.0,8.0,accepted,0.0 +6.0,1.0,3.0,5.0,4.0,2.0,69.0,3.0,9.0,138.0,8.0,accepted,0.0 +2.0,1.0,4.0,5.0,3.0,6.0,87.0,3.0,9.0,174.0,8.0,accepted,0.0 +5.0,2.0,3.0,1.0,6.0,4.0,76.0,3.0,9.0,152.0,8.0,accepted,0.0 +6.0,1.0,3.0,5.0,4.0,2.0,69.0,3.0,9.0,138.0,8.0,accepted,0.0 +5.0,1.0,3.0,4.0,6.0,2.0,74.0,3.0,9.0,148.0,8.0,accepted,0.0 +6.0,1.0,3.0,4.0,5.0,2.0,70.0,3.0,9.0,140.0,8.0,accepted,0.0 +5.0,2.0,4.0,6.0,1.0,3.0,68.0,3.0,9.0,136.0,8.0,accepted,0.0 +6.0,1.0,3.0,4.0,5.0,2.0,70.0,3.0,9.0,140.0,8.0,accepted,0.0 +5.0,1.0,3.0,2.0,6.0,4.0,78.0,3.0,9.0,156.0,8.0,accepted,0.0 +5.0,1.0,4.0,3.0,6.0,2.0,73.0,3.0,9.0,146.0,8.0,accepted,0.0 +5.0,2.0,3.0,4.0,6.0,1.0,70.0,3.0,9.0,140.0,8.0,accepted,0.0 +1.0,3.0,6.0,2.0,5.0,4.0,82.0,2.0,10.0,164.0,9.0,accepted,0.0 +1.0,3.0,4.0,2.0,6.0,5.0,87.0,2.0,10.0,174.0,9.0,accepted,0.0 +1.0,3.0,4.0,5.0,2.0,6.0,85.0,2.0,10.0,170.0,9.0,accepted,0.0 +3.0,1.0,6.0,5.0,2.0,4.0,77.0,2.0,10.0,154.0,9.0,accepted,0.0 +1.0,6.0,4.0,5.0,3.0,2.0,72.0,2.0,10.0,144.0,9.0,accepted,0.0 +2.0,3.0,4.0,5.0,6.0,1.0,76.0,2.0,10.0,152.0,9.0,accepted,0.0 +1.0,3.0,2.0,6.0,4.0,5.0,87.0,2.0,10.0,174.0,9.0,accepted,0.0 +1.0,3.0,5.0,4.0,2.0,6.0,84.0,2.0,10.0,168.0,9.0,accepted,0.0 +1.0,3.0,6.0,4.0,2.0,5.0,81.0,2.0,10.0,162.0,9.0,accepted,0.0 +3.0,1.0,6.0,4.0,2.0,5.0,79.0,2.0,10.0,158.0,9.0,accepted,0.0 +1.0,3.0,6.0,5.0,2.0,4.0,79.0,2.0,10.0,158.0,9.0,accepted,0.0 +2.0,1.0,4.0,6.0,3.0,5.0,85.0,2.0,10.0,170.0,9.0,accepted,0.0 +1.0,3.0,5.0,4.0,2.0,6.0,84.0,2.0,10.0,168.0,9.0,accepted,0.0 +1.0,3.0,2.0,5.0,6.0,4.0,87.0,2.0,10.0,174.0,9.0,accepted,0.0 +3.0,1.0,4.0,5.0,2.0,6.0,83.0,2.0,10.0,166.0,9.0,accepted,0.0 +2.0,1.0,6.0,4.0,3.0,5.0,83.0,2.0,10.0,166.0,9.0,accepted,0.0 +3.0,6.0,4.0,5.0,2.0,1.0,63.0,2.0,10.0,126.0,9.0,accepted,0.0 +1.0,6.0,5.0,4.0,2.0,3.0,72.0,2.0,10.0,144.0,9.0,accepted,0.0 +2.0,3.0,5.0,4.0,1.0,6.0,80.0,2.0,10.0,160.0,9.0,accepted,0.0 +1.0,4.0,5.0,2.0,3.0,6.0,83.0,2.0,10.0,166.0,9.0,accepted,0.0 +1.0,3.0,2.0,6.0,5.0,4.0,86.0,2.0,11.0,172.0,10.0,accepted,0.0 +1.0,2.0,3.0,5.0,4.0,6.0,90.0,2.0,11.0,180.0,10.0,accepted,0.0 +1.0,3.0,2.0,5.0,6.0,4.0,87.0,2.0,11.0,174.0,10.0,accepted,0.0 +1.0,4.0,2.0,3.0,6.0,5.0,87.0,2.0,11.0,174.0,10.0,accepted,0.0 +1.0,3.0,6.0,5.0,2.0,4.0,79.0,2.0,11.0,158.0,10.0,accepted,0.0 +2.0,3.0,1.0,5.0,4.0,6.0,87.0,2.0,11.0,174.0,10.0,accepted,0.0 +1.0,3.0,6.0,5.0,4.0,2.0,77.0,2.0,11.0,154.0,10.0,accepted,0.0 +2.0,3.0,1.0,5.0,4.0,6.0,87.0,2.0,11.0,174.0,10.0,accepted,0.0 +1.0,2.0,3.0,6.0,5.0,4.0,87.0,2.0,11.0,174.0,10.0,accepted,0.0 +1.0,4.0,2.0,3.0,5.0,6.0,88.0,2.0,11.0,176.0,10.0,accepted,0.0 +6.0,2.0,3.0,5.0,4.0,1.0,65.0,2.0,11.0,130.0,10.0,accepted,0.0 +2.0,3.0,1.0,6.0,4.0,5.0,85.0,2.0,11.0,170.0,10.0,accepted,0.0 +6.0,2.0,3.0,5.0,4.0,1.0,65.0,2.0,11.0,130.0,10.0,accepted,0.0 +2.0,3.0,1.0,6.0,4.0,5.0,85.0,2.0,11.0,170.0,10.0,accepted,0.0 +1.0,4.0,6.0,3.0,5.0,2.0,76.0,2.0,11.0,152.0,10.0,accepted,0.0 +2.0,3.0,6.0,5.0,4.0,1.0,72.0,2.0,11.0,144.0,10.0,accepted,0.0 +6.0,3.0,2.0,5.0,4.0,1.0,64.0,2.0,11.0,128.0,10.0,accepted,0.0 +2.0,4.0,1.0,3.0,6.0,5.0,85.0,2.0,11.0,170.0,10.0,accepted,0.0 +6.0,3.0,1.0,5.0,4.0,2.0,67.0,2.0,11.0,134.0,10.0,accepted,0.0 +6.0,3.0,1.0,5.0,4.0,2.0,67.0,2.0,11.0,134.0,10.0,accepted,0.0 +2.0,3.0,6.0,5.0,4.0,1.0,72.0,0.0,12.0,144.0,11.0,accepted,0.0 +1.0,4.0,3.0,5.0,2.0,6.0,84.0,0.0,12.0,168.0,11.0,accepted,0.0 +2.0,1.0,4.0,5.0,6.0,3.0,84.0,0.0,12.0,168.0,11.0,accepted,0.0 +3.0,4.0,5.0,1.0,2.0,6.0,76.0,0.0,12.0,152.0,11.0,accepted,0.0 +2.0,3.0,4.0,5.0,1.0,6.0,81.0,0.0,12.0,162.0,11.0,accepted,0.0 +1.0,2.0,4.0,5.0,3.0,6.0,88.0,0.0,12.0,176.0,11.0,accepted,0.0 +2.0,3.0,6.0,5.0,1.0,4.0,75.0,0.0,12.0,150.0,11.0,accepted,0.0 +1.0,2.0,4.0,5.0,3.0,6.0,88.0,0.0,12.0,176.0,11.0,accepted,0.0 +1.0,4.0,6.0,2.0,3.0,5.0,80.0,0.0,12.0,160.0,11.0,accepted,0.0 +3.0,1.0,5.0,4.0,2.0,6.0,82.0,0.0,12.0,164.0,11.0,accepted,0.0 +1.0,4.0,6.0,5.0,2.0,3.0,75.0,0.0,12.0,150.0,11.0,accepted,0.0 +1.0,2.0,4.0,3.0,5.0,6.0,90.0,0.0,12.0,180.0,11.0,accepted,0.0 +1.0,4.0,6.0,3.0,5.0,2.0,76.0,0.0,12.0,152.0,11.0,accepted,0.0 +1.0,2.0,6.0,5.0,3.0,4.0,82.0,0.0,12.0,164.0,11.0,accepted,0.0 +3.0,1.0,2.0,4.0,5.0,6.0,88.0,0.0,12.0,176.0,11.0,accepted,0.0 +1.0,2.0,5.0,4.0,3.0,6.0,87.0,0.0,12.0,174.0,11.0,accepted,0.0 +3.0,2.0,5.0,4.0,6.0,1.0,74.0,0.0,12.0,148.0,11.0,accepted,0.0 +1.0,4.0,6.0,5.0,3.0,2.0,74.0,0.0,12.0,148.0,11.0,accepted,0.0 +1.0,2.0,6.0,5.0,3.0,4.0,82.0,0.0,12.0,164.0,11.0,accepted,0.0 +1.0,3.0,4.0,5.0,2.0,6.0,85.0,0.0,12.0,170.0,11.0,accepted,0.0 +1.0,4.0,3.0,5.0,2.0,6.0,84.0,7.0,13.0,168.0,12.0,accepted,0.0 +1.0,3.0,2.0,5.0,4.0,6.0,89.0,7.0,13.0,178.0,12.0,accepted,0.0 +1.0,5.0,2.0,3.0,6.0,4.0,83.0,7.0,13.0,166.0,12.0,accepted,0.0 +1.0,4.0,2.0,5.0,3.0,6.0,86.0,7.0,13.0,172.0,12.0,accepted,0.0 +1.0,4.0,2.0,3.0,6.0,5.0,87.0,7.0,13.0,174.0,12.0,accepted,0.0 +1.0,6.0,2.0,5.0,3.0,4.0,78.0,7.0,13.0,156.0,12.0,accepted,0.0 +1.0,4.0,2.0,5.0,3.0,6.0,86.0,7.0,13.0,172.0,12.0,accepted,0.0 +2.0,6.0,3.0,5.0,1.0,4.0,72.0,7.0,13.0,144.0,12.0,accepted,0.0 +1.0,3.0,4.0,2.0,5.0,6.0,88.0,7.0,13.0,176.0,12.0,accepted,0.0 +1.0,5.0,2.0,6.0,4.0,3.0,79.0,7.0,13.0,158.0,12.0,accepted,0.0 +1.0,3.0,4.0,5.0,2.0,6.0,85.0,7.0,13.0,170.0,12.0,accepted,0.0 +1.0,6.0,4.0,3.0,2.0,5.0,77.0,7.0,13.0,154.0,12.0,accepted,0.0 +1.0,6.0,3.0,4.0,2.0,5.0,78.0,7.0,13.0,156.0,12.0,accepted,0.0 +2.0,3.0,4.0,5.0,1.0,6.0,81.0,7.0,13.0,162.0,12.0,accepted,0.0 +1.0,5.0,4.0,3.0,6.0,2.0,77.0,7.0,13.0,154.0,12.0,accepted,0.0 +1.0,6.0,2.0,3.0,4.0,5.0,81.0,7.0,13.0,162.0,12.0,accepted,0.0 +1.0,5.0,2.0,4.0,3.0,6.0,84.0,7.0,13.0,168.0,12.0,accepted,0.0 +2.0,6.0,3.0,4.0,1.0,5.0,74.0,7.0,13.0,148.0,12.0,accepted,0.0 +1.0,6.0,3.0,4.0,2.0,5.0,78.0,7.0,13.0,156.0,12.0,accepted,0.0 +2.0,6.0,4.0,3.0,1.0,5.0,73.0,7.0,13.0,146.0,12.0,accepted,0.0 +3.0,1.0,4.0,5.0,6.0,2.0,79.0,4.0,14.0,158.0,13.0,accepted,0.0 +2.0,3.0,6.0,4.0,1.0,5.0,77.0,4.0,14.0,154.0,13.0,accepted,0.0 +1.0,3.0,2.0,5.0,4.0,6.0,89.0,4.0,14.0,178.0,13.0,accepted,0.0 +3.0,2.0,1.0,4.0,5.0,6.0,87.0,4.0,14.0,174.0,13.0,accepted,0.0 +1.0,3.0,2.0,4.0,6.0,5.0,89.0,4.0,14.0,178.0,13.0,accepted,0.0 +1.0,2.0,3.0,4.0,5.0,6.0,91.0,4.0,14.0,182.0,13.0,accepted,0.0 +2.0,3.0,1.0,5.0,4.0,6.0,87.0,4.0,14.0,174.0,13.0,accepted,0.0 +3.0,1.0,2.0,4.0,5.0,6.0,88.0,4.0,14.0,176.0,13.0,accepted,0.0 +3.0,1.0,2.0,5.0,4.0,6.0,87.0,4.0,14.0,174.0,13.0,accepted,0.0 +3.0,2.0,1.0,5.0,4.0,6.0,86.0,4.0,14.0,172.0,13.0,accepted,0.0 +2.0,3.0,1.0,4.0,6.0,5.0,87.0,4.0,14.0,174.0,13.0,accepted,0.0 +3.0,1.0,5.0,2.0,4.0,6.0,84.0,4.0,14.0,168.0,13.0,accepted,0.0 +3.0,1.0,2.0,5.0,4.0,6.0,87.0,4.0,14.0,174.0,13.0,accepted,0.0 +3.0,1.0,2.0,5.0,4.0,6.0,87.0,4.0,14.0,174.0,13.0,accepted,0.0 +2.0,3.0,1.0,4.0,6.0,5.0,87.0,4.0,14.0,174.0,13.0,accepted,0.0 +3.0,2.0,1.0,5.0,4.0,6.0,86.0,4.0,14.0,172.0,13.0,accepted,0.0 +1.0,4.0,2.0,5.0,3.0,6.0,86.0,4.0,14.0,172.0,13.0,accepted,0.0 +3.0,1.0,2.0,5.0,4.0,6.0,87.0,4.0,14.0,174.0,13.0,accepted,0.0 +3.0,1.0,4.0,5.0,6.0,2.0,79.0,4.0,14.0,158.0,13.0,accepted,0.0 +2.0,3.0,6.0,4.0,5.0,1.0,73.0,4.0,14.0,146.0,13.0,accepted,0.0 +5.0,3.0,2.0,1.0,4.0,6.0,77.0,2.0,15.0,154.0,14.0,accepted,0.0 +5.0,2.0,4.0,1.0,3.0,6.0,76.0,2.0,15.0,152.0,14.0,accepted,0.0 +5.0,2.0,4.0,1.0,6.0,3.0,73.0,2.0,15.0,146.0,14.0,accepted,0.0 +5.0,2.0,3.0,1.0,4.0,6.0,78.0,2.0,15.0,156.0,14.0,accepted,0.0 +5.0,3.0,2.0,1.0,4.0,6.0,77.0,2.0,15.0,154.0,14.0,accepted,0.0 +5.0,2.0,4.0,1.0,6.0,3.0,73.0,2.0,15.0,146.0,14.0,accepted,0.0 +4.0,2.0,1.0,5.0,3.0,6.0,82.0,2.0,15.0,164.0,14.0,accepted,0.0 +5.0,3.0,4.0,1.0,6.0,2.0,69.0,2.0,15.0,138.0,14.0,accepted,0.0 +5.0,2.0,1.0,6.0,4.0,3.0,74.0,2.0,15.0,148.0,14.0,accepted,0.0 +5.0,3.0,6.0,1.0,4.0,2.0,65.0,2.0,15.0,130.0,14.0,accepted,0.0 +5.0,3.0,2.0,1.0,4.0,6.0,77.0,2.0,15.0,154.0,14.0,accepted,0.0 +5.0,3.0,2.0,1.0,4.0,6.0,77.0,2.0,15.0,154.0,14.0,accepted,0.0 +5.0,3.0,2.0,1.0,4.0,6.0,77.0,2.0,15.0,154.0,14.0,accepted,0.0 +4.0,3.0,2.0,1.0,6.0,5.0,80.0,2.0,15.0,160.0,14.0,accepted,0.0 +5.0,2.0,3.0,1.0,4.0,6.0,78.0,2.0,15.0,156.0,14.0,accepted,0.0 +5.0,3.0,2.0,1.0,4.0,6.0,77.0,2.0,15.0,154.0,14.0,accepted,0.0 +5.0,3.0,6.0,1.0,4.0,2.0,65.0,2.0,15.0,130.0,14.0,accepted,0.0 +4.0,2.0,3.0,1.0,6.0,5.0,81.0,2.0,15.0,162.0,14.0,accepted,0.0 +5.0,3.0,2.0,1.0,4.0,6.0,77.0,2.0,15.0,154.0,14.0,accepted,0.0 +4.0,3.0,2.0,1.0,6.0,5.0,80.0,2.0,15.0,160.0,14.0,accepted,0.0 +1.0,5.0,4.0,3.0,6.0,2.0,77.0,3.0,16.0,154.0,15.0,accepted,0.0 +1.0,6.0,4.0,3.0,5.0,2.0,74.0,3.0,16.0,148.0,15.0,accepted,0.0 +1.0,5.0,3.0,4.0,6.0,2.0,78.0,3.0,16.0,156.0,15.0,accepted,0.0 +2.0,6.0,4.0,3.0,5.0,1.0,69.0,3.0,16.0,138.0,15.0,accepted,0.0 +1.0,5.0,4.0,2.0,6.0,3.0,79.0,3.0,16.0,158.0,15.0,accepted,0.0 +1.0,6.0,2.0,3.0,5.0,4.0,80.0,3.0,16.0,160.0,15.0,accepted,0.0 +1.0,5.0,4.0,6.0,2.0,3.0,75.0,3.0,16.0,150.0,15.0,accepted,0.0 +3.0,6.0,2.0,4.0,5.0,1.0,68.0,3.0,16.0,136.0,15.0,accepted,0.0 +1.0,6.0,4.0,3.0,2.0,5.0,77.0,3.0,16.0,154.0,15.0,accepted,0.0 +2.0,6.0,3.0,5.0,4.0,1.0,69.0,3.0,16.0,138.0,15.0,accepted,0.0 +1.0,2.0,4.0,5.0,3.0,6.0,88.0,3.0,16.0,176.0,15.0,accepted,0.0 +2.0,3.0,1.0,4.0,5.0,6.0,88.0,3.0,16.0,176.0,15.0,accepted,0.0 +1.0,6.0,2.0,3.0,5.0,4.0,80.0,3.0,16.0,160.0,15.0,accepted,0.0 +3.0,6.0,4.0,2.0,5.0,1.0,66.0,3.0,16.0,132.0,15.0,accepted,0.0 +2.0,6.0,1.0,4.0,5.0,3.0,76.0,3.0,16.0,152.0,15.0,accepted,0.0 +1.0,6.0,3.0,5.0,4.0,2.0,74.0,3.0,16.0,148.0,15.0,accepted,0.0 +2.0,6.0,5.0,3.0,4.0,1.0,67.0,3.0,16.0,134.0,15.0,accepted,0.0 +3.0,6.0,5.0,4.0,1.0,2.0,63.0,3.0,16.0,126.0,15.0,accepted,0.0 +1.0,6.0,2.0,4.0,5.0,3.0,78.0,3.0,16.0,156.0,15.0,accepted,0.0 +3.0,2.0,1.0,4.0,5.0,6.0,87.0,3.0,16.0,174.0,15.0,accepted,0.0 +4.0,1.0,3.0,6.0,5.0,2.0,76.0,2.0,17.0,152.0,16.0,accepted,0.0 +2.0,3.0,1.0,5.0,4.0,6.0,87.0,2.0,17.0,174.0,16.0,accepted,0.0 +3.0,2.0,6.0,5.0,1.0,4.0,74.0,2.0,17.0,148.0,16.0,accepted,0.0 +2.0,1.0,3.0,4.0,5.0,6.0,90.0,2.0,17.0,180.0,16.0,accepted,0.0 +2.0,1.0,3.0,4.0,5.0,6.0,90.0,2.0,17.0,180.0,16.0,accepted,0.0 +3.0,1.0,2.0,5.0,4.0,6.0,87.0,2.0,17.0,174.0,16.0,accepted,0.0 +2.0,1.0,3.0,5.0,4.0,6.0,89.0,2.0,17.0,178.0,16.0,accepted,0.0 +2.0,3.0,1.0,4.0,5.0,6.0,88.0,2.0,17.0,176.0,16.0,accepted,0.0 +3.0,2.0,1.0,5.0,4.0,6.0,86.0,2.0,17.0,172.0,16.0,accepted,0.0 +4.0,2.0,1.0,5.0,3.0,6.0,82.0,2.0,17.0,164.0,16.0,accepted,0.0 +4.0,2.0,1.0,5.0,3.0,6.0,82.0,2.0,17.0,164.0,16.0,accepted,0.0 +3.0,1.0,2.0,5.0,4.0,6.0,87.0,2.0,17.0,174.0,16.0,accepted,0.0 +2.0,3.0,1.0,5.0,6.0,4.0,85.0,2.0,17.0,170.0,16.0,accepted,0.0 +4.0,2.0,1.0,5.0,3.0,6.0,82.0,2.0,17.0,164.0,16.0,accepted,0.0 +3.0,2.0,1.0,5.0,4.0,6.0,86.0,2.0,17.0,172.0,16.0,accepted,0.0 +2.0,1.0,4.0,5.0,3.0,6.0,87.0,2.0,17.0,174.0,16.0,accepted,0.0 +2.0,3.0,1.0,5.0,4.0,6.0,87.0,2.0,17.0,174.0,16.0,accepted,0.0 +3.0,4.0,1.0,5.0,2.0,6.0,80.0,2.0,17.0,160.0,16.0,accepted,0.0 +2.0,3.0,6.0,5.0,4.0,1.0,72.0,2.0,17.0,144.0,16.0,accepted,0.0 +3.0,1.0,5.0,6.0,4.0,2.0,76.0,2.0,17.0,152.0,16.0,accepted,0.0 +2.0,5.0,3.0,1.0,4.0,6.0,81.0,12.0,18.0,162.0,17.0,accepted,0.0 +2.0,5.0,3.0,1.0,4.0,6.0,81.0,12.0,18.0,162.0,17.0,accepted,0.0 +2.0,5.0,3.0,1.0,4.0,6.0,81.0,12.0,18.0,162.0,17.0,accepted,0.0 +1.0,4.0,3.0,5.0,6.0,2.0,80.0,12.0,18.0,160.0,17.0,accepted,0.0 +2.0,5.0,3.0,1.0,4.0,6.0,81.0,12.0,18.0,162.0,17.0,accepted,0.0 +2.0,4.0,3.0,1.0,6.0,5.0,83.0,12.0,18.0,166.0,17.0,accepted,0.0 +2.0,4.0,3.0,1.0,6.0,5.0,83.0,12.0,18.0,166.0,17.0,accepted,0.0 +1.0,5.0,2.0,3.0,4.0,6.0,85.0,12.0,18.0,170.0,17.0,accepted,0.0 +2.0,5.0,3.0,1.0,4.0,6.0,81.0,12.0,18.0,162.0,17.0,accepted,0.0 +1.0,4.0,3.0,2.0,5.0,6.0,87.0,12.0,18.0,174.0,17.0,accepted,0.0 +2.0,4.0,3.0,1.0,6.0,5.0,83.0,12.0,18.0,166.0,17.0,accepted,0.0 +2.0,5.0,3.0,1.0,6.0,4.0,79.0,12.0,18.0,158.0,17.0,accepted,0.0 +2.0,3.0,4.0,5.0,1.0,6.0,81.0,12.0,18.0,162.0,17.0,accepted,0.0 +1.0,4.0,3.0,6.0,2.0,5.0,82.0,12.0,18.0,164.0,17.0,accepted,0.0 +1.0,4.0,3.0,2.0,5.0,6.0,87.0,12.0,18.0,174.0,17.0,accepted,0.0 +2.0,4.0,3.0,1.0,6.0,5.0,83.0,12.0,18.0,166.0,17.0,accepted,0.0 +1.0,4.0,3.0,2.0,6.0,5.0,86.0,12.0,18.0,172.0,17.0,accepted,0.0 +1.0,4.0,2.0,3.0,5.0,6.0,88.0,12.0,18.0,176.0,17.0,accepted,0.0 +2.0,4.0,3.0,1.0,6.0,5.0,83.0,12.0,18.0,166.0,17.0,accepted,0.0 +3.0,1.0,2.0,4.0,6.0,5.0,87.0,12.0,18.0,174.0,17.0,accepted,0.0 +1.0,2.0,3.0,5.0,6.0,4.0,88.0,13.0,19.0,176.0,18.0,accepted,0.0 +2.0,1.0,3.0,5.0,6.0,4.0,87.0,13.0,19.0,174.0,18.0,accepted,0.0 +1.0,2.0,3.0,5.0,4.0,6.0,90.0,13.0,19.0,180.0,18.0,accepted,0.0 +1.0,2.0,3.0,4.0,6.0,5.0,90.0,13.0,19.0,180.0,18.0,accepted,0.0 +1.0,3.0,2.0,5.0,4.0,6.0,89.0,13.0,19.0,178.0,18.0,accepted,0.0 +1.0,2.0,3.0,4.0,6.0,5.0,90.0,13.0,19.0,180.0,18.0,accepted,0.0 +1.0,2.0,3.0,4.0,6.0,5.0,90.0,13.0,19.0,180.0,18.0,accepted,0.0 +2.0,1.0,3.0,5.0,6.0,4.0,87.0,13.0,19.0,174.0,18.0,accepted,0.0 +2.0,4.0,3.0,5.0,6.0,1.0,75.0,13.0,19.0,150.0,18.0,accepted,0.0 +1.0,3.0,2.0,4.0,6.0,5.0,89.0,13.0,19.0,178.0,18.0,accepted,0.0 +2.0,1.0,3.0,5.0,6.0,4.0,87.0,13.0,19.0,174.0,18.0,accepted,0.0 +4.0,3.0,2.0,1.0,5.0,6.0,81.0,13.0,19.0,162.0,18.0,accepted,0.0 +2.0,1.0,3.0,5.0,6.0,4.0,87.0,13.0,19.0,174.0,18.0,accepted,0.0 +4.0,1.0,3.0,2.0,6.0,5.0,83.0,13.0,19.0,166.0,18.0,accepted,0.0 +1.0,3.0,4.0,5.0,6.0,2.0,81.0,13.0,19.0,162.0,18.0,accepted,0.0 +1.0,2.0,5.0,4.0,6.0,3.0,84.0,13.0,19.0,168.0,18.0,accepted,0.0 +1.0,2.0,3.0,4.0,6.0,5.0,90.0,13.0,19.0,180.0,18.0,accepted,0.0 +4.0,1.0,3.0,2.0,6.0,5.0,83.0,13.0,19.0,166.0,18.0,accepted,0.0 +4.0,3.0,2.0,1.0,6.0,5.0,80.0,13.0,19.0,160.0,18.0,accepted,0.0 +4.0,1.0,3.0,2.0,6.0,5.0,83.0,13.0,19.0,166.0,18.0,accepted,0.0 +6.0,3.0,2.0,4.0,1.0,5.0,69.0,10.0,20.0,138.0,19.0,accepted,0.0 +5.0,2.0,3.0,1.0,4.0,6.0,78.0,10.0,20.0,156.0,19.0,accepted,0.0 +6.0,2.0,3.0,4.0,5.0,1.0,66.0,10.0,20.0,132.0,19.0,accepted,0.0 +6.0,2.0,3.0,5.0,4.0,1.0,65.0,10.0,20.0,130.0,19.0,accepted,0.0 +6.0,2.0,3.0,5.0,4.0,1.0,65.0,10.0,20.0,130.0,19.0,accepted,0.0 +2.0,1.0,3.0,5.0,4.0,6.0,89.0,10.0,20.0,178.0,19.0,accepted,0.0 +6.0,2.0,3.0,5.0,4.0,1.0,65.0,10.0,20.0,130.0,19.0,accepted,0.0 +6.0,1.0,3.0,5.0,4.0,2.0,69.0,10.0,20.0,138.0,19.0,accepted,0.0 +5.0,2.0,3.0,4.0,6.0,1.0,70.0,10.0,20.0,140.0,19.0,accepted,0.0 +6.0,3.0,2.0,4.0,5.0,1.0,65.0,10.0,20.0,130.0,19.0,accepted,0.0 +5.0,3.0,4.0,2.0,6.0,1.0,67.0,10.0,20.0,134.0,19.0,accepted,0.0 +6.0,1.0,2.0,5.0,4.0,3.0,72.0,10.0,20.0,144.0,19.0,accepted,0.0 +5.0,1.0,2.0,4.0,6.0,3.0,77.0,10.0,20.0,154.0,19.0,accepted,0.0 +2.0,3.0,4.0,5.0,1.0,6.0,81.0,10.0,20.0,162.0,19.0,accepted,0.0 +6.0,2.0,3.0,5.0,1.0,4.0,68.0,10.0,20.0,136.0,19.0,accepted,0.0 +6.0,1.0,3.0,4.0,5.0,2.0,70.0,10.0,20.0,140.0,19.0,accepted,0.0 +6.0,1.0,3.0,5.0,2.0,4.0,71.0,10.0,20.0,142.0,19.0,accepted,0.0 +6.0,2.0,3.0,4.0,1.0,5.0,70.0,10.0,20.0,140.0,19.0,accepted,0.0 +6.0,1.0,3.0,5.0,4.0,2.0,69.0,10.0,20.0,138.0,19.0,accepted,0.0 +6.0,1.0,3.0,5.0,4.0,2.0,69.0,10.0,20.0,138.0,19.0,accepted,0.0 +1.0,2.0,3.0,4.0,5.0,6.0,91.0,7.0,20.0,182.0,19.0,final,0.0 diff --git a/tests/framework/Optimizers/GeneticAlgorithms/gold/discrete/unconstrained/simpleKnapsackTournament/PrintOptOut_1.csv b/tests/framework/Optimizers/GeneticAlgorithms/gold/discrete/unconstrained/simpleKnapsackTournament/PrintOptOut_1.csv index 5141343acb..2750e6a825 100644 --- a/tests/framework/Optimizers/GeneticAlgorithms/gold/discrete/unconstrained/simpleKnapsackTournament/PrintOptOut_1.csv +++ b/tests/framework/Optimizers/GeneticAlgorithms/gold/discrete/unconstrained/simpleKnapsackTournament/PrintOptOut_1.csv @@ -1,71 +1,71 @@ -proj1,proj2,proj3,proj4,proj5,proj6,proj7,proj8,proj9,proj10,planValue,validPlan,PointProbability,ProbabilityWeight-proj2,ProbabilityWeight-proj7,ProbabilityWeight-proj8,ProbabilityWeight-proj9,ProbabilityWeight-proj4,ProbabilityWeight-proj1,ProbabilityWeight-proj10,batchId,ProbabilityWeight,ProbabilityWeight-proj3,prefix,ProbabilityWeight-proj5,ProbabilityWeight-proj6 -0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,5,0.0,0.0009765625,0.5,0.5,0.5,0.5,0.5,0.5,0.5,1,1,0.5,1,0.5,0.5 -0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,4,0.0,0.0009765625,0.5,0.5,0.5,0.5,0.5,0.5,0.5,1,1,0.5,1,0.5,0.5 -0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,8,0.0,0.0009765625,0.5,0.5,0.5,0.5,0.5,0.5,0.5,1,1,0.5,1,0.5,0.5 -0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,6,0.0,0.0009765625,0.5,0.5,0.5,0.5,0.5,0.5,0.5,1,1,0.5,1,0.5,0.5 -1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,3,0.0,0.0009765625,0.5,0.5,0.5,0.5,0.5,0.5,0.5,1,1,0.5,1,0.5,0.5 -0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,5,0.0,0.0009765625,0.5,0.5,0.5,0.5,0.5,0.5,0.5,1,1,0.5,1,0.5,0.5 -0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,4,0.0,0.0009765625,0.5,0.5,0.5,0.5,0.5,0.5,0.5,1,1,0.5,1,0.5,0.5 -0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,8,0.0,0.0009765625,0.5,0.5,0.5,0.5,0.5,0.5,0.5,1,1,0.5,1,0.5,0.5 -0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,6,0.0,0.0009765625,0.5,0.5,0.5,0.5,0.5,0.5,0.5,1,1,0.5,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8,proj9,proj10,planValue,validPlan,ProbabilityWeight-proj1,PointProbability,ProbabilityWeight,prefix,ProbabilityWeight-proj6,ProbabilityWeight-proj2,ProbabilityWeight-proj7,ProbabilityWeight-proj8,ProbabilityWeight-proj9,ProbabilityWeight-proj4,batchId,ProbabilityWeight-proj5,ProbabilityWeight-proj10,ProbabilityWeight-proj3 +0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,5,0.0,0.5,0.0009765625,1,1,0.5,0.5,0.5,0.5,0.5,0.5,1,0.5,0.5,0.5 +0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,4,0.0,0.5,0.0009765625,1,1,0.5,0.5,0.5,0.5,0.5,0.5,1,0.5,0.5,0.5 +0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,8,0.0,0.5,0.0009765625,1,1,0.5,0.5,0.5,0.5,0.5,0.5,1,0.5,0.5,0.5 +0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,6,0.0,0.5,0.0009765625,1,1,0.5,0.5,0.5,0.5,0.5,0.5,1,0.5,0.5,0.5 +1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,3,0.0,0.5,0.0009765625,1,1,0.5,0.5,0.5,0.5,0.5,0.5,1,0.5,0.5,0.5 +0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,5,0.0,0.5,0.0009765625,1,1,0.5,0.5,0.5,0.5,0.5,0.5,1,0.5,0.5,0.5 +0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,4,0.0,0.5,0.0009765625,1,1,0.5,0.5,0.5,0.5,0.5,0.5,1,0.5,0.5,0.5 +0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,8,0.0,0.5,0.0009765625,1,1,0.5,0.5,0.5,0.5,0.5,0.5,1,0.5,0.5,0.5 +0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,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,5,0.5,0.5,0.5 diff --git a/tests/framework/Optimizers/GeneticAlgorithms/tests b/tests/framework/Optimizers/GeneticAlgorithms/tests index 21d889dcc2..ed99c51711 100644 --- a/tests/framework/Optimizers/GeneticAlgorithms/tests +++ b/tests/framework/Optimizers/GeneticAlgorithms/tests @@ -103,6 +103,17 @@ [../] [../] + [./MaxwoReplacementTwoPointsCrossover] + type = 'RavenFramework' + input = 'discrete/unconstrained/testGAMaxwoRepTwoPointsCrossover.xml' + [./data] + type = OrderedCSV + output = 'discrete/unconstrained/MaxwoReplacementTwoPointsCrossover/opt_export_0.csv' + rel_err = 1e-3 + zero_threshold = 1e-5 + [../] + [../] + [./MaxwoReplacementDiffDist] type = 'RavenFramework' input = 'discrete/unconstrained/testGAMaxwoRepDifferentDist.xml' diff --git a/tests/framework/unit_tests/Optimizers/test1pointCrossover.py b/tests/framework/unit_tests/Optimizers/test1pointCrossover.py new file mode 100644 index 0000000000..41409c12a4 --- /dev/null +++ b/tests/framework/unit_tests/Optimizers/test1pointCrossover.py @@ -0,0 +1,89 @@ +# Copyright 2017 Battelle Energy Alliance, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" + Testing for the onePointCrossover method + @authors: Mohammad Abdo, Diego Mandelli, Andrea Alfonsi +""" +import os +import sys +import xarray as xr +import numpy as np + +ravenPath = os.path.abspath(os.path.join(__file__, *['..'] * 5, 'framework')) +print('... located RAVEN at:', ravenPath) +sys.path.append(ravenPath) +import Driver +from Optimizers.crossOverOperators.crossovers import returnInstance + +onePointCrossover = returnInstance('tester', 'onePointCrossover') + +# +# +# checkers +# +def checkSameDataArrays(comment, resultedDA, expectedDA, update=True): + """ + This method compares two identical things + @ In, comment, string, a comment printed out if it fails + @ In, resultedDA, xr.DataArray, the resulted DataArray to be tested + @ In, expectedDA, xr.DataArray, the expected DataArray + @ In, update, bool, optional, if False then don't update results counter + @ Out, res, bool, True if same + """ + res = resultedDA.identical(expectedDA) + if update: + if res: + results["pass"] += 1 + else: + print("checking string", comment, '|', resultedDA, "!=", expectedDA) + results["fail"] += 1 + return res + +results = {'pass': 0, 'fail': 0} +# +# +# initialization +# +optVars = ['x1', 'x2', 'x3', 'x4', 'x5', 'x6', 'x7', 'x8'] +population = [[11,12,13,14,15,16,17,18], + [21,22,23,24,25,26,27,28], + [31,32,33,34,35,36,37,38]] +population = xr.DataArray(population, + dims = ['chromosome','Gene'], + coords = {'chromosome': np.arange(np.shape(population)[0]), + 'Gene':optVars}) +nParents = 2 +children = onePointCrossover(population, crossoverProb=1.0, variables=optVars, points=None) + +print('onePointCrossover') +print('*'*19) +print('generated children are: {}'.format(children)) +expectedChildren = xr.DataArray([[ 11., 22., 23., 24., 25., 26., 27., 28.], + [ 21., 12., 13., 14., 15., 16., 17., 18.], + [ 11., 12., 13., 14., 15., 16., 37., 38.], + [ 31., 32., 33., 34., 35., 36., 17., 18.], + [ 21., 22., 23., 24., 25., 26., 27., 38.], + [ 31., 32., 33., 34., 35., 36., 37., 28.]], + dims = ['chromosome','Gene'], + coords = {'chromosome': np.arange(6), + 'Gene' : optVars}) + +## TESTING +# Test survivor population +checkSameDataArrays('Check survived population data array',children,expectedChildren) +# +# end +# +print('Results:', results) +sys.exit(results['fail']) diff --git a/tests/framework/unit_tests/Optimizers/test2pointsCrossover.py b/tests/framework/unit_tests/Optimizers/test2pointsCrossover.py new file mode 100644 index 0000000000..0389a0574b --- /dev/null +++ b/tests/framework/unit_tests/Optimizers/test2pointsCrossover.py @@ -0,0 +1,96 @@ +# Copyright 2017 Battelle Energy Alliance, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" + Testing for the twoPointsCrossover method + @authors: Mohammad Abdo, Diego Mandelli, Andrea Alfonsi +""" +import os +import sys +import xarray as xr +import numpy as np + +ravenPath = os.path.abspath(os.path.join(__file__, *['..'] * 5, 'framework')) +print('... located RAVEN at:', ravenPath) +sys.path.append(ravenPath) +import Driver +from Optimizers.crossOverOperators.crossovers import returnInstance + +twoPointsCrossover = returnInstance('tester', 'twoPointsCrossover') + +# +# +# checkers +# +def checkSameDataArrays(comment, resultedDA, expectedDA, update=True): + """ + This method compares two identical things + @ In, comment, string, a comment printed out if it fails + @ In, resultedDA, xr.DataArray, the resulted DataArray to be tested + @ In, expectedDA, xr.DataArray, the expected DataArray + @ In, update, bool, optional, if False then don't update results counter + @ Out, res, bool, True if same + """ + res = resultedDA.identical(expectedDA) + if update: + if res: + results["pass"] += 1 + else: + print("checking string", comment, '|', resultedDA, "!=", expectedDA) + results["fail"] += 1 + return res + +results = {'pass': 0, 'fail': 0} +# +# +# initialization +# +optVars = ['x1', 'x2', 'x3', 'x4', 'x5', 'x6', 'x7', 'x8'] +population = [[11,12,13,14,15,16,17,18], + [21,22,23,24,25,26,27,28], + [31,32,33,34,35,36,37,38], + [41,42,43,44,45,46,47,48]] +population = xr.DataArray(population, + dims = ['chromosome','Gene'], + coords = {'chromosome': np.arange(np.shape(population)[0]), + 'Gene':optVars}) +nParents = 2 +children = twoPointsCrossover(population) + +print('twoPointsCrossover') +print('*'*19) +print('generated children are: {}'.format(children)) +expectedChildren = xr.DataArray([[ 11., 22., 23., 24., 25., 26., 17., 18.], + [ 21., 12., 13., 14., 15., 16., 27., 28.], + [ 11., 12., 13., 14., 15., 16., 37., 18.], + [ 31., 32., 33., 34., 35., 36., 17., 38.], + [ 11., 42., 43., 44., 45., 46., 47., 18.], + [ 41., 12., 13., 14., 15., 16., 17., 48.], + [ 21., 22., 33., 34., 35., 36., 37., 28.], + [ 31., 32., 23., 24., 25., 26., 27., 38.], + [ 21., 22., 43., 44., 45., 26., 27., 28.], + [ 41., 42., 23., 24., 25., 46., 47., 48.], + [ 31., 42., 43., 44., 45., 36., 37., 38.], + [ 41., 32., 33., 34., 35., 46., 47., 48.]], + dims = ['chromosome','Gene'], + coords = {'chromosome': np.arange(12), + 'Gene' : optVars}) + +## TESTING +# Test survivor population +checkSameDataArrays('Check survived population data array',children,expectedChildren) +# +# end +# +print('Results:', results) +sys.exit(results['fail']) diff --git a/tests/framework/unit_tests/Optimizers/test2pointsCrossoverSmallArray.py b/tests/framework/unit_tests/Optimizers/test2pointsCrossoverSmallArray.py new file mode 100644 index 0000000000..720c57ef44 --- /dev/null +++ b/tests/framework/unit_tests/Optimizers/test2pointsCrossoverSmallArray.py @@ -0,0 +1,89 @@ +# Copyright 2017 Battelle Energy Alliance, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" + Testing for the twoPointsCrossover method + @authors: Mohammad Abdo, Diego Mandelli, Andrea Alfonsi +""" +import os +import sys +import xarray as xr +import numpy as np + +ravenPath = os.path.abspath(os.path.join(__file__, *['..'] * 5, 'framework')) +print('... located RAVEN at:', ravenPath) +sys.path.append(ravenPath) +import Driver +from Optimizers.crossOverOperators.crossovers import returnInstance + +twoPointsCrossover = returnInstance('tester', 'twoPointsCrossover') + +# +# +# checkers +# +def checkSameDataArrays(comment, resultedDA, expectedDA, update=True): + """ + This method compares two identical things + @ In, comment, string, a comment printed out if it fails + @ In, resultedDA, xr.DataArray, the resulted DataArray to be tested + @ In, expectedDA, xr.DataArray, the expected DataArray + @ In, update, bool, optional, if False then don't update results counter + @ Out, res, bool, True if same + """ + res = resultedDA.identical(expectedDA) + if update: + if res: + results["pass"] += 1 + else: + print("checking string", comment, '|', resultedDA, "!=", expectedDA) + results["fail"] += 1 + return res + +results = {'pass': 0, 'fail': 0} +# +# +# initialization +# +optVars = ['x1', 'x2', 'x3'] +population = [[11,12,13], + [21,22,23], + [31,32,33]] +population = xr.DataArray(population, + dims = ['chromosome','Gene'], + coords = {'chromosome': np.arange(np.shape(population)[0]), + 'Gene':optVars}) +nParents = 2 +children = twoPointsCrossover(population) + +print('twoPointsCrossover') +print('*'*19) +print('generated children are: {}'.format(children)) +expectedChildren = xr.DataArray([[ 11., 22., 13.], + [ 21., 12., 23.], + [ 11., 32., 13.], + [ 31., 12., 33.], + [ 21., 32., 23.], + [ 31., 22., 33.]], + dims = ['chromosome','Gene'], + coords = {'chromosome': np.arange(6), + 'Gene' : optVars}) + +## TESTING +# Test survivor population +checkSameDataArrays('Check survived population data array',children,expectedChildren) +# +# end +# +print('Results:', results) +sys.exit(results['fail']) diff --git a/tests/framework/unit_tests/Optimizers/testAgeBased.py b/tests/framework/unit_tests/Optimizers/testAgeBased.py index 4e7ddcf53b..6a388f0172 100644 --- a/tests/framework/unit_tests/Optimizers/testAgeBased.py +++ b/tests/framework/unit_tests/Optimizers/testAgeBased.py @@ -64,7 +64,7 @@ def checkSameDataArrays(comment, resultedDA, expectedDA, update=True): if res: results["pass"] += 1 else: - print("checking string", comment, '|', value, "!=", expected) + print("checking string", comment, '|', resultedDA, "!=", expectedDA) results["fail"] += 1 return res @@ -82,17 +82,27 @@ def formatSample(vars): # initialization # optVars = ['x1', 'x2', 'x3', 'x4', 'x5', 'x6'] -population =[[1,2,3,4,5,6],[2,1,3,4,6,5],[6,5,4,3,2,1],[3,5,6,2,1,4]] +population =[[1,2,3,4,5,6], + [2,1,3,4,6,5], + [6,5,4,3,2,1], + [3,5,6,2,1,4]] + population = xr.DataArray(population, - dims=['chromosome','Gene'], - coords={'chromosome': np.arange(np.shape(population)[0]), - 'Gene':optVars}) + dims=['chromosome','Gene'], + coords={'chromosome': np.arange(np.shape(population)[0]), + 'Gene':optVars}) + popFitness = [7.2,1.3,9.5,2.0] popFitness = xr.DataArray(popFitness, - dims=['chromosome'], - coords={'chromosome': np.arange(np.shape(popFitness)[0])}) + dims=['chromosome'], + coords={'chromosome': np.arange(np.shape(popFitness)[0])}) + popAge = [3,1,7,1] -offSprings = [[2,3,4,5,6,1],[1,3,5,2,4,6],[1,2,4,3,6,5]] + +offSprings = [[2,3,4,5,6,1], + [1,3,5,2,4,6], + [1,2,4,3,6,5]] + offSpringsFitness = [1.1,2.0,3.2] rlz =[] for i in range(np.shape(offSprings)[0]): @@ -102,8 +112,17 @@ def formatSample(vars): val = offSprings[i][j] d[var] = {'dims':() ,'data': val} rlz.append(xr.Dataset.from_dict(d)) -rlz = xr.concat(rlz) -newPop2,newFit2,newAge2 = ageBased(rlz, age=popAge, popSize=np.shape(population)[0], variables=optVars, population=population, fitness=popFitness, offSpringsFitness=offSpringsFitness) +rlz = xr.concat(rlz,dim='data') + +newPop2,newFit2,newAge2,popObjVal2 = ageBased(rlz, + age=popAge, + popSize=np.shape(population)[0], + variables=optVars, + population=population, + fitness=popFitness, + offSpringsFitness=offSpringsFitness, + popObjectiveVal=popFitness) + print('Age Based Selection') print('*'*19) print('new population: {}, \n new Fitness {}, \n new age'.format(newPop2,newFit2,newAge2)) @@ -112,9 +131,10 @@ def formatSample(vars): [1,2,4,3,6,5], [1,3,5,2,4,6], [2,3,4,5,6,1]], - dims=['chromosome','Gene'], - coords={'chromosome':np.arange(np.shape(population)[0]), - 'Gene': optVars}) + dims=['chromosome','Gene'], + coords={'chromosome':np.arange(np.shape(population)[0]), + 'Gene': optVars}) + expectedFit = xr.DataArray([2.0,3.2,2.0,1.1], dims=['chromosome'], coords={'chromosome':np.arange(np.shape(population)[0])}) diff --git a/tests/framework/unit_tests/Optimizers/testFitnessBased.py b/tests/framework/unit_tests/Optimizers/testFitnessBased.py index 351ee4fe5a..38b7f96890 100644 --- a/tests/framework/unit_tests/Optimizers/testFitnessBased.py +++ b/tests/framework/unit_tests/Optimizers/testFitnessBased.py @@ -102,8 +102,8 @@ def formatSample(vars): val = offSprings[i][j] d[var] = {'dims':() ,'data': val} rlz.append(xr.Dataset.from_dict(d)) -rlz = xr.concat(rlz) -newPop2,newFit2,newAge2 = fitnessBased(rlz, age=popAge, variables=optVars, population=population, fitness=popFitness, offSpringsFitness=offSpringsFitness) +rlz = xr.concat(rlz,dim='data') +newPop2,newFit2,newAge2,popFitness2 = fitnessBased(rlz, age=popAge, variables=optVars, population=population, fitness=popFitness, offSpringsFitness=offSpringsFitness, popObjectiveVal=popFitness) print('Fitness Based Selection') print('*'*19) print('new population: {}, \n new Fitness {}, \n new age'.format(newPop2,newFit2,newAge2)) diff --git a/tests/framework/unit_tests/Optimizers/testRankSelection.py b/tests/framework/unit_tests/Optimizers/testRankSelection.py index e0154f78a2..0770b6493c 100644 --- a/tests/framework/unit_tests/Optimizers/testRankSelection.py +++ b/tests/framework/unit_tests/Optimizers/testRankSelection.py @@ -82,25 +82,30 @@ def formatSample(vars): # initialization # optVars = ['x1', 'x2', 'x3', 'x4', 'x5', 'x6'] -population =[[1,2,3,4,5,6],[2,1,3,4,6,5],[6,5,4,3,2,1],[3,5,6,2,1,4]] +population =[[1,2,3,4,5,6], + [2,1,3,4,6,5], + [6,5,4,3,2,1], + [3,5,6,2,1,4]] + population = xr.DataArray(population, - dims=['chromosome','Gene'], - coords={'chromosome': np.arange(np.shape(population)[0]), - 'Gene':optVars}) + dims=['chromosome','Gene'], + coords={'chromosome': np.arange(np.shape(population)[0]), + 'Gene':optVars}) + popFitness = [7.2,1.3,9.5,2.0] popFitness = xr.DataArray(popFitness, - dims=['chromosome'], - coords={'chromosome': np.arange(np.shape(popFitness)[0])}) + dims=['chromosome'], + coords={'chromosome': np.arange(np.shape(popFitness)[0])}) nParents = 2 parents = rankSelection(population, variables=optVars, fitness=popFitness, nParents=nParents) -print('Roulette Wheel Parent Selection') +print('Rank based Parent Selection') print('*'*19) print('selected parents are: {}'.format(parents)) expectedParents = xr.DataArray([[3,5,6,2,1,4], - [1,2,3,4,5,6]], - dims=['chromosome','Gene'], - coords={'chromosome':np.arange(nParents), - 'Gene': optVars}) + [1,2,3,4,5,6]], + dims=['chromosome','Gene'], + coords={'chromosome':np.arange(nParents), + 'Gene': optVars}) ## TESTING # Test survivor population diff --git a/tests/framework/unit_tests/Optimizers/testTournamentSelection.py b/tests/framework/unit_tests/Optimizers/testTournamentSelection.py index c63780690b..d1b9954139 100644 --- a/tests/framework/unit_tests/Optimizers/testTournamentSelection.py +++ b/tests/framework/unit_tests/Optimizers/testTournamentSelection.py @@ -85,23 +85,24 @@ def formatSample(vars): optVars = ['x1', 'x2', 'x3', 'x4', 'x5', 'x6'] population =[[1,2,3,4,5,6],[2,1,3,4,6,5],[6,5,4,3,2,1],[3,5,6,2,1,4]] population = xr.DataArray(population, - dims=['chromosome','Gene'], - coords={'chromosome': np.arange(np.shape(population)[0]), - 'Gene':optVars}) + dims=['chromosome','Gene'], + coords={'chromosome': np.arange(np.shape(population)[0]), + 'Gene':optVars}) + popFitness = [7.2,1.3,9.5,2.0] popFitness = xr.DataArray(popFitness, - dims=['chromosome'], - coords={'chromosome': np.arange(np.shape(popFitness)[0])}) + dims=['chromosome'], + coords={'chromosome': np.arange(np.shape(popFitness)[0])}) nParents = 2 parents = tournamentSelection(population, variables=optVars, fitness=popFitness, nParents=nParents) print('Roulette Wheel Parent Selection') print('*'*19) print('selected parents are: {}'.format(parents)) -expectedParents = xr.DataArray([[6,5,4,3,2,1], - [3,5,6,2,1,4]], - dims=['chromosome','Gene'], - coords={'chromosome':np.arange(nParents), - 'Gene': optVars}) +expectedParents = xr.DataArray([[1,2,3,4,5,6], + [6,5,4,3,2,1]], + dims=['chromosome','Gene'], + coords={'chromosome':np.arange(nParents), + 'Gene': optVars}) ## TESTING # Test survivor population diff --git a/tests/framework/unit_tests/Optimizers/tests b/tests/framework/unit_tests/Optimizers/tests index b02f8a8388..1385267b09 100644 --- a/tests/framework/unit_tests/Optimizers/tests +++ b/tests/framework/unit_tests/Optimizers/tests @@ -5,4 +5,39 @@ type = 'RavenPython' input = 'testFiniteDifference.py' [../] + + # GAs + [./testRouletteWheel] + type = 'RavenPython' + input = 'testRouletteWheel.py' + [../] + [./test2pointsCrossover] + type = 'RavenPython' + input = 'test2pointsCrossover.py' + [../] + [./test2pointsCrossoverSmallArray] + type = 'RavenPython' + input = 'test2pointsCrossoverSmallArray.py' + [../] + [./testTournamentSelection] + type = 'RavenPython' + input = 'testTournamentSelection.py' + [../] + [./testFitnessBased] + type = 'RavenPython' + input = 'testFitnessBased.py' + [../] + [./testAgeBased] + type = 'RavenPython' + input = 'testAgeBased.py' + [../] + [./testRankSelection] + type = 'RavenPython' + input = 'testRankSelection.py' + [../] + + [./test1pointCrossover] + type = 'RavenPython' + input = 'test1pointCrossover.py' + [../] []