def plot_evolution_integrated(round, numberrOfIslands): vetorOfVetor_fitness = [] for i in range(numberrOfIslands): vetor_fitness = [] with open('results/plotting_{0}.txt'.format(i), 'r') as plott: for line in isl.nonblank_lines(plott): vetor_fitness.append(literal_eval(line)) vetorOfVetor_fitness.append(vetor_fitness) plott.close() v_min = [] v_max = [] v_ave = [] for j in range(numberrOfIslands): v_min.append([i[0] for i in vetorOfVetor_fitness[j]]) v_max.append([i[1] for i in vetorOfVetor_fitness[j]]) v_ave.append([i[2] for i in vetorOfVetor_fitness[j]]) plt.figure(1) for j in range(numberrOfIslands): plt.plot(v_min[j], label='Lowest fitness', linestyle=':', linewidth=1.0, color="red") plt.plot(v_ave[j], label='Average fitness', linewidth=2.0, color="orange") plt.plot(v_max[j], label='Highest fitness', linewidth=2.0, color="green") plt.ylabel("Fitness") plt.xlabel("Generation") plt.legend(bbox_to_anchor=(0., 1.02, 1., .102), loc=4, ncol=2, mode="expand", borderaxespad=0., prop={'size': 10}) plt.ylim([0, 1.02]) plt.draw() name = 'graphs/' 'graph-X-' + round + '-' + 'I' + '.png' plt.savefig(name) plt.clf() return
def runRound(par, parameter, population_size, numberOfGenerations, crossoverType, crossoverTasksNumPerc, crossoverProbability, mutationType, mutationTasksNumPerc, tasksMutationStartProbability, tasksMutationEndProbability, operatorsMutationStartProbability, operatorsMutationEndProbability, changeMutationRateType, changeMutationRateExpBase, drivenMutation, drivenMutationPart, limitBestFitnessRepetionCount, numberOfcyclesAfterDrivenMutation, completenessWeight, TPweight, precisenessWeight, simplicityWeight, precisenessStart, simplicityStart, evolutionEnd, completenessAttemptFactor1, completenessAttemptFactor2, elitismPerc, selectionOp, selectionTp, lambdaValue, HammingThreshold, migrationtime, percentageOfBestIndividualsForMigrationPerIsland, percentageOfIndividualsForMigrationPerIsland, alphabet, log, fitnessStrategy, logIndex, num_threads, round, broadcast, islandNumber): islandStart = datetime.now() highestValueAndPosition = [[0, 0, 0], -1] if highestValueAndPosition[0][1] >= precisenessStart: precisenessWeight = float(par[parameter][20]) (population, evaluatedPopulation, referenceCromossome, averageEnabledTasks) = iniPop.initializePopulation(islandNumber, population_size, TPweight, precisenessWeight, simplicityWeight, completenessWeight, completenessAttemptFactor1, completenessAttemptFactor2, selectionOp, alphabet, log) fitnessEvolution = [] (highestValueAndPosition, sortedEvaluatedPopulation) = cycle.chooseHighest(evaluatedPopulation) lowestValue = cycle.chooseLowest(sortedEvaluatedPopulation) averageValue = cycle.calculateAverage(evaluatedPopulation) fitnessEvolution.append([lowestValue, highestValueAndPosition[0][0], averageValue, 0, highestValueAndPosition[0][1], highestValueAndPosition[0][2], highestValueAndPosition[0][3], highestValueAndPosition[0][4], 0, 0, 0, 0]) if (fitnessEvolution[0][8] >= simplicityStart) and (precisenessWeight > 0): simplicityWeight = float(par[parameter][21]) print('LOG:', logIndex, '| PAR:', parameter, '| RND:', round, '| GEN:', 0, '| TF:', '%.5f' % highestValueAndPosition[0][0], '| C:', '%.5f' % highestValueAndPosition[0][1], '| TP:', '%.5f' % highestValueAndPosition[0][2], '| P:', '%.5f' % highestValueAndPosition[0][3], '| S:', '%.5f' % highestValueAndPosition[0][4], '| REP:', fitnessEvolution[0][3], fitnessEvolution[0][8], fitnessEvolution[0][9], fitnessEvolution[0][10], fitnessEvolution[0][11], '| ISL:', islandNumber) drivenMutatedIndividuals = [0 for _ in range(len(population))] drivenMutatedGenerations = 0 for currentGeneration in range(1, numberOfGenerations): if highestValueAndPosition[0][1] >= precisenessStart: precisenessWeight = float(par[parameter][20]) (tasksMutationProbability, operatorsMutationProbability) = op.defineMutationProbability(tasksMutationStartProbability, tasksMutationEndProbability, operatorsMutationStartProbability, operatorsMutationEndProbability, numberOfGenerations, currentGeneration, changeMutationRateType, changeMutationRateExpBase) (population, evaluatedPopulation, drivenMutatedIndividuals, drivenMutatedGenerations) = cycle.generation(population, referenceCromossome, evaluatedPopulation, crossoverType, crossoverProbability, crossoverTasksNumPerc, mutationType, mutationTasksNumPerc, tasksMutationProbability, operatorsMutationProbability, drivenMutation, drivenMutationPart, limitBestFitnessRepetionCount, fitnessEvolution[currentGeneration - 1][3], drivenMutatedIndividuals, drivenMutatedGenerations, TPweight, precisenessWeight, simplicityWeight, completenessWeight, elitismPerc, sortedEvaluatedPopulation, selectionOp, selectionTp, lambdaValue, HammingThreshold, currentGeneration, completenessAttemptFactor1, completenessAttemptFactor2, numberOfcyclesAfterDrivenMutation, alphabet, log) (highestValueAndPosition, sortedEvaluatedPopulation) = cycle.chooseHighest(evaluatedPopulation) isl.set_broadcast(population, sortedEvaluatedPopulation, islandNumber,percentageOfBestIndividualsForMigrationPerIsland, broadcast) lowestValue = cycle.chooseLowest(sortedEvaluatedPopulation) averageValue = cycle.calculateAverage(evaluatedPopulation) fitnessEvolution.append([lowestValue, highestValueAndPosition[0][0], averageValue, 0, highestValueAndPosition[0][1], highestValueAndPosition[0][2], highestValueAndPosition[0][3], highestValueAndPosition[0][4], 0, 0, 0, 0]) if fitnessEvolution[currentGeneration][1] == fitnessEvolution[currentGeneration - 1][1]: fitnessEvolution[currentGeneration][8] = fitnessEvolution[currentGeneration - 1][8] + 1 if fitnessEvolution[currentGeneration][4] == fitnessEvolution[currentGeneration - 1][4]: fitnessEvolution[currentGeneration][3] = fitnessEvolution[currentGeneration - 1][3] + 1 if fitnessEvolution[currentGeneration][5] == fitnessEvolution[currentGeneration - 1][5]: fitnessEvolution[currentGeneration][9] = fitnessEvolution[currentGeneration - 1][9] + 1 if fitnessEvolution[currentGeneration][6] == fitnessEvolution[currentGeneration - 1][6]: fitnessEvolution[currentGeneration][10] = fitnessEvolution[currentGeneration - 1][10] + 1 if fitnessEvolution[currentGeneration][7] == fitnessEvolution[currentGeneration - 1][7]: fitnessEvolution[currentGeneration][11] = fitnessEvolution[currentGeneration - 1][11] + 1 if (fitnessEvolution[currentGeneration][10] >= simplicityStart) and (precisenessWeight > 0): simplicityWeight = float(par[parameter][21]) print('LOG:', logIndex, '| PAR:', parameter, '| RND:', round, '| GEN:', currentGeneration, '| TF:', '%.6f' % highestValueAndPosition[0][0], '| C:', '%.5f' % highestValueAndPosition[0][1], '| TP:', '%.5f' % highestValueAndPosition[0][2], '| P:', '%.5f' % highestValueAndPosition[0][3], '| S:', '%.5f' % highestValueAndPosition[0][4], '| REP:', fitnessEvolution[currentGeneration][8], fitnessEvolution[currentGeneration][3], fitnessEvolution[currentGeneration][9], fitnessEvolution[currentGeneration][10], fitnessEvolution[currentGeneration][11], '| ISL:', islandNumber) if ((fitnessStrategy == 0) and ((highestValueAndPosition[0][1] >= 1.0) and (fitnessEvolution[currentGeneration][8] >= evolutionEnd))) or ((fitnessStrategy == 1) and ((highestValueAndPosition[0][1] == 1.0) and (highestValueAndPosition[0][3] > 0) and (highestValueAndPosition[0][4] > 0) and (fitnessEvolution[currentGeneration][10] >= evolutionEnd) and (fitnessEvolution[currentGeneration][11] >= evolutionEnd))): broadcast[len(broadcast)-1] = 0 if (currentGeneration > 0) and (currentGeneration % migrationtime == 0): island_fitness = [] for i in range(len(evaluatedPopulation[1])): valor = evaluatedPopulation[1][i] island_fitness.append(valor[0]) isl.do_migration2(population, islandNumber, num_threads, island_fitness, percentageOfIndividualsForMigrationPerIsland, percentageOfBestIndividualsForMigrationPerIsland, broadcast) migraNeed = [] migraNeed.append(broadcast[len(broadcast)-1]) if migraNeed[0] == 0: break evaluatedPopulation = fit.evaluationPopulation(population, referenceCromossome, TPweight, precisenessWeight, simplicityWeight, completenessWeight, completenessAttemptFactor1, completenessAttemptFactor2, selectionOp, alphabet, log) (highestValueAndPosition, sortedEvaluatedPopulation) = cycle.chooseHighest(evaluatedPopulation) cycle.postProcessing(population, alphabet) plot.plot_evolution_per_island(fitnessEvolution, str(parameter), str(round), islandNumber) prevPlot = [] with open('results/plotting_{0}.txt'.format(islandNumber), 'r') as plott: for line in isl.nonblank_lines(plott): prevPlot.append(literal_eval(line)) plott.close() prevPlot.extend(fitnessEvolution) with open('results/plotting_{0}.txt'.format(islandNumber), 'w') as plott: for ini in range(len(prevPlot)): plott.write(str(prevPlot[ini]) + '\n') plott.close() islandEnd = datetime.now() islandDuration = islandEnd - islandStart record.record_evolution(log, str(parameter), str(round), par[parameter], islandNumber, highestValueAndPosition[0], fitnessEvolution, alphabet, population[highestValueAndPosition[1]], islandStart, islandEnd, islandDuration, currentGeneration) print(islandNumber, islandDuration, '%.5f' % highestValueAndPosition[0][0], '%.5f' % highestValueAndPosition[0][1], '%.5f' % highestValueAndPosition[0][2], '%.5f' % highestValueAndPosition[0][3], alphabet, population[highestValueAndPosition[1]]) return
plott.close() prevPlot.extend(fitnessEvolution) with open('results/plotting_{0}.txt'.format(islandNumber), 'w') as plott: for ini in range(len(prevPlot)): plott.write(str(prevPlot[ini]) + '\n') plott.close() islandEnd = datetime.now() islandDuration = islandEnd - islandStart record.record_evolution(log, str(parameter), str(round), par[parameter], islandNumber, highestValueAndPosition[0], fitnessEvolution, alphabet, population[highestValueAndPosition[1]], islandStart, islandEnd, islandDuration, currentGeneration) print(islandNumber, islandDuration, '%.5f' % highestValueAndPosition[0][0], '%.5f' % highestValueAndPosition[0][1], '%.5f' % highestValueAndPosition[0][2], '%.5f' % highestValueAndPosition[0][3], alphabet, population[highestValueAndPosition[1]]) return if __name__ == '__main__': par = [] with open('input-parameters-v.csv', 'r') as parameters: for line in isl.nonblank_lines(parameters): par.append(line.split(';')) parameters.close() for parameter in range(1,len(par)): numberOfRounds = int(par[parameter][0]) population_size = int(par[parameter][1]) numberOfGenerations = int(par[parameter][2]) crossoverType = int(par[parameter][3]) crossoverTasksNumPerc = float(par[parameter][4]) crossoverProbability = float(par[parameter][5]) mutationType = int(par[parameter][6]) mutationTasksNumPerc = float(par[parameter][7]) tasksMutationStartProbability = float(par[parameter][8]) tasksMutationEndProbability = float(par[parameter][9]) operatorsMutationStartProbability = float(par[parameter][10]) operatorsMutationEndProbability = float(par[parameter][11])
def runRound(par, parComb, parCount, logIndex, numberOfThreads, round, broadcast, messenger, progressions, definitions, islandSizes, percentageOfBestIndividualsForMigrationAllIslands, islandNumber): islandStart = datetime.now() population_size = int(par[islandNumber + parCount][1]) numberOfGenerations = int(par[islandNumber + parCount][2]) crossoverType = int(par[islandNumber + parCount][3]) crossoverTasksNumPerc = float(par[islandNumber + parCount][4]) crossoverProbability = float(par[islandNumber + parCount][5]) mutationType = int(par[islandNumber + parCount][6]) mutationTasksNumPerc = float(par[islandNumber + parCount][7]) tasksMutationStartProbability = float(par[islandNumber + parCount][8]) tasksMutationEndProbability = float(par[islandNumber + parCount][9]) operatorsMutationStartProbability = float(par[islandNumber + parCount][10]) operatorsMutationEndProbability = float(par[islandNumber + parCount][11]) changeMutationRateType = int(par[islandNumber + parCount][12]) changeMutationRateExpBase = float(par[islandNumber + parCount][13]) drivenMutation = int(par[islandNumber + parCount][14]) drivenMutationPart = float(par[islandNumber + parCount][15]) limitBestFitnessRepetionCount = int(par[islandNumber + parCount][16]) numberOfcyclesAfterDrivenMutation = int(par[islandNumber + parCount][17]) completenessWeight = float(par[islandNumber + parCount][18]) TPweight = float(par[islandNumber + parCount][19]) precisenessStart = float(par[islandNumber + parCount][22]) simplicityStart = int(par[islandNumber + parCount][23]) evolutionEnd = int(par[islandNumber + parCount][24]) completenessAttemptFactor1 = int(par[islandNumber + parCount][25]) completenessAttemptFactor2 = float(par[islandNumber + parCount][26]) elitismPerc = float(par[islandNumber + parCount][27]) selectionOp = int(par[islandNumber + parCount][28]) selectionTp = int(par[islandNumber + parCount][29]) lambdaValue = int(par[islandNumber + parCount][30]) HammingThreshold = int(par[islandNumber + parCount][31]) migrationtime = int(par[islandNumber + parCount][32]) percentageOfBestIndividualsForMigrationPerIsland = float(par[islandNumber + parCount][34]) percentageOfIndividualsForMigrationPerIsland = float(par[islandNumber + parCount][35]) fitnessStrategy = int(par[islandNumber + parCount][37]) #Depois deve existir no Excel maxTempGen = 100 satime = 1 expectedProgression = 0.5 names = [ '[8] tasksMutationStartProbability', '[10] operatorsMutationStartProbability', '[32] migrationtime', '[34] percentageOfBestIndividualsForMigrationPerIsland', '[35] percentageOfIndividualsForMigrationPerIsland' ] if fitnessStrategy == 0: precisenessWeight = float(par[islandNumber + parCount][20]) simplicityWeight = float(par[islandNumber + parCount][21]) else: precisenessWeight = 0 simplicityWeight = 0 islandSizes[islandNumber] = population_size percentageOfBestIndividualsForMigrationAllIslands[ islandNumber] = percentageOfBestIndividualsForMigrationPerIsland alphabet = [] log = copy.deepcopy(logs.logList[logIndex]) logSizeAndMaxTraceSize = [0, float('inf'), 0] iniPop.createAlphabet(log, alphabet) iniPop.processLog(log, logSizeAndMaxTraceSize) highestValueAndPosition = [[0, 0, 0], -1] if highestValueAndPosition[0][1] >= precisenessStart: precisenessWeight = float(par[islandNumber + parCount][20]) (population, evaluatedPopulation, referenceCromossome, averageEnabledTasks) = iniPop.initializePopulation( islandNumber, population_size, TPweight, precisenessWeight, simplicityWeight, completenessWeight, completenessAttemptFactor1, completenessAttemptFactor2, selectionOp, alphabet, log) fitnessEvolution = [] (highestValueAndPosition, sortedEvaluatedPopulation) = cycle.chooseHighest(evaluatedPopulation) lowestValue = cycle.chooseLowest(sortedEvaluatedPopulation) averageValue = cycle.calculateAverage(evaluatedPopulation) fitnessEvolution.append([ lowestValue, highestValueAndPosition[0][0], averageValue, 0, highestValueAndPosition[0][1], highestValueAndPosition[0][2], highestValueAndPosition[0][3], highestValueAndPosition[0][4], 0, 0, 0, 0 ]) if (fitnessEvolution[0][10] >= simplicityStart) and (precisenessWeight > 0): simplicityWeight = float(par[islandNumber + parCount][21]) print('LOG:', logIndex, '| COMB:', parComb, '| RND:', round, '| GEN:', 0, '| TF:', '%.6f' % highestValueAndPosition[0][0], '| C:', '%.6f' % highestValueAndPosition[0][1], '| TP:', '%.6f' % highestValueAndPosition[0][2], '| P:', '%.6f' % highestValueAndPosition[0][3], '| S:', '%.6f' % highestValueAndPosition[0][4], '| REP:', fitnessEvolution[0][3], fitnessEvolution[0][8], fitnessEvolution[0][9], fitnessEvolution[0][10], fitnessEvolution[0][11], '| ISL:', islandNumber, '| PAR:', islandNumber) drivenMutatedIndividuals = [0 for _ in range(len(population))] drivenMutatedGenerations = 0 for currentGeneration in range(1, numberOfGenerations): if highestValueAndPosition[0][1] >= precisenessStart: precisenessWeight = float(par[islandNumber + parCount][20]) (tasksMutationProbability, operatorsMutationProbability) = op.defineMutationProbability( tasksMutationStartProbability, tasksMutationEndProbability, operatorsMutationStartProbability, operatorsMutationEndProbability, numberOfGenerations, currentGeneration, changeMutationRateType, changeMutationRateExpBase) (population, evaluatedPopulation, drivenMutatedIndividuals, drivenMutatedGenerations) = cycle.generation( population, referenceCromossome, evaluatedPopulation, crossoverType, crossoverProbability, crossoverTasksNumPerc, mutationType, mutationTasksNumPerc, tasksMutationProbability, operatorsMutationProbability, drivenMutation, drivenMutationPart, limitBestFitnessRepetionCount, fitnessEvolution[currentGeneration - 1][3], drivenMutatedIndividuals, drivenMutatedGenerations, TPweight, precisenessWeight, simplicityWeight, completenessWeight, elitismPerc, sortedEvaluatedPopulation, selectionOp, selectionTp, lambdaValue, HammingThreshold, currentGeneration, completenessAttemptFactor1, completenessAttemptFactor2, numberOfcyclesAfterDrivenMutation, alphabet, log) (highestValueAndPosition, sortedEvaluatedPopulation) = cycle.chooseHighest(evaluatedPopulation) isl.set_broadcast(population, sortedEvaluatedPopulation, islandNumber, percentageOfBestIndividualsForMigrationPerIsland, broadcast) lowestValue = cycle.chooseLowest(sortedEvaluatedPopulation) averageValue = cycle.calculateAverage(evaluatedPopulation) fitnessEvolution.append([ lowestValue, highestValueAndPosition[0][0], averageValue, 0, highestValueAndPosition[0][1], highestValueAndPosition[0][2], highestValueAndPosition[0][3], highestValueAndPosition[0][4], 0, 0, 0, 0 ]) if fitnessEvolution[currentGeneration][1] == fitnessEvolution[ currentGeneration - 1][1]: fitnessEvolution[currentGeneration][8] = fitnessEvolution[ currentGeneration - 1][8] + 1 if fitnessEvolution[currentGeneration][4] == fitnessEvolution[ currentGeneration - 1][4]: fitnessEvolution[currentGeneration][3] = fitnessEvolution[ currentGeneration - 1][3] + 1 if fitnessEvolution[currentGeneration][5] == fitnessEvolution[ currentGeneration - 1][5]: fitnessEvolution[currentGeneration][9] = fitnessEvolution[ currentGeneration - 1][9] + 1 if fitnessEvolution[currentGeneration][6] == fitnessEvolution[ currentGeneration - 1][6]: fitnessEvolution[currentGeneration][10] = fitnessEvolution[ currentGeneration - 1][10] + 1 if fitnessEvolution[currentGeneration][7] == fitnessEvolution[ currentGeneration - 1][7]: fitnessEvolution[currentGeneration][11] = fitnessEvolution[ currentGeneration - 1][11] + 1 if (fitnessEvolution[currentGeneration][10] >= simplicityStart) and (precisenessWeight > 0): simplicityWeight = float(par[islandNumber + parCount][21]) print('LOG:', logIndex, '|COMB:', parComb, '|RND:', round, '|GEN:', currentGeneration, '|TF:', '%.6f' % highestValueAndPosition[0][0], '|C:', '%.6f' % highestValueAndPosition[0][1], '|TP:', '%.6f' % highestValueAndPosition[0][2], '|P:', '%.6f' % highestValueAndPosition[0][3], '|S:', '%.6f' % highestValueAndPosition[0][4], '|REP:', fitnessEvolution[currentGeneration][8], fitnessEvolution[currentGeneration][3], fitnessEvolution[currentGeneration][9], fitnessEvolution[currentGeneration][10], fitnessEvolution[currentGeneration][11], '|ISL:', islandNumber, '|PAR:', islandNumber) if ((fitnessStrategy == 0) and ((highestValueAndPosition[0][1] >= 1.0) and (fitnessEvolution[currentGeneration][8] >= evolutionEnd))) or ( (fitnessStrategy == 1) and ((highestValueAndPosition[0][1] == 1.0) and (highestValueAndPosition[0][3] > 0) and (highestValueAndPosition[0][4] > 0) and (fitnessEvolution[currentGeneration][10] >= evolutionEnd) and (fitnessEvolution[currentGeneration][11] >= evolutionEnd))): #if (highestValueAndPosition[0][1] == 1.0) and (highestValueAndPosition[0][2] == 1.0): broadcast[-1] = 0 if broadcast[-1] == 0: break isl.send_individuals(population, sortedEvaluatedPopulation, islandNumber, numberOfThreads, messenger) if (currentGeneration > 0) and (currentGeneration % migrationtime == 0): island_fitness = [] for i in range(len(evaluatedPopulation[1])): island_fitness.append(evaluatedPopulation[1][i][0]) isl.receive_individuals(population, islandNumber, island_fitness, messenger) isl.do_migration( population, islandNumber, numberOfThreads, island_fitness, percentageOfIndividualsForMigrationPerIsland, percentageOfBestIndividualsForMigrationPerIsland, broadcast, islandSizes, percentageOfBestIndividualsForMigrationAllIslands) evaluatedPopulation = fit.evaluationPopulation( population, referenceCromossome, TPweight, precisenessWeight, simplicityWeight, completenessWeight, completenessAttemptFactor1, completenessAttemptFactor2, selectionOp, alphabet, log) (highestValueAndPosition, sortedEvaluatedPopulation ) = cycle.chooseHighest(evaluatedPopulation) if (currentGeneration > 0 and (numberOfGenerations - currentGeneration > 10) and currentGeneration % satime == 0): print("ISLAND: ", islandNumber, "currently at Simulated Annealing") #Simulated Annealing island_fitness = [] for i in range(len(evaluatedPopulation[1])): island_fitness.append(evaluatedPopulation[1][i][0]) currentFitness = max(island_fitness) parametersTP = [ tasksMutationStartProbability, operatorsMutationStartProbability, migrationtime, percentageOfBestIndividualsForMigrationPerIsland, percentageOfIndividualsForMigrationPerIsland ] sa.SA(islandNumber, expectedProgression, currentGeneration, maxTempGen, definitions, progressions, parametersTP, currentFitness) tasksMutationStartProbability = parametersTP[0] #Update altered parameters (somente para [10] operatorsMutationStartProbability) df = pd.read_csv("input-parameters.csv", sep=";") parI = 0 for name in names: df.at[islandNumber + parCount - 1, name] = parametersTP[parI] #print("changed", name, 'of island', islandNumber, 'to', parametersTP[parI]) parI += 1 df.to_csv("input-parameters.csv", sep=";", index=False) print("ISLAND: ", islandNumber, "finished with Simulated Annealing") cycle.postProcessing(population, alphabet) #plot.plot_evolution_per_island(fitnessEvolution, str(islandNumber), str(round), islandNumber) prevPlot = [] with open('results/plotting_{0}.txt'.format(islandNumber), 'r') as plott: for line in isl.nonblank_lines(plott): prevPlot.append(literal_eval(line)) plott.close() prevPlot.extend(fitnessEvolution) with open('results/plotting_{0}.txt'.format(islandNumber), 'w') as plott: for ini in range(len(prevPlot)): plott.write(str(prevPlot[ini]) + '\n') plott.close() islandEnd = datetime.now() islandDuration = islandEnd - islandStart record.record_evolution(logIndex, log, str(parComb), str(islandNumber), str(round), par[islandNumber + parCount], islandNumber, highestValueAndPosition[0], fitnessEvolution, alphabet, population[highestValueAndPosition[1]], islandStart, islandEnd, islandDuration, currentGeneration) print(islandNumber, islandDuration, '%.5f' % highestValueAndPosition[0][0], '%.5f' % highestValueAndPosition[0][1], '%.5f' % highestValueAndPosition[0][2], '%.5f' % highestValueAndPosition[0][3], alphabet, population[highestValueAndPosition[1]]) return