diff --git a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/MainLan b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/MainLan index 277666562d6fd0e3a32170fac7bf2aaca9d2bb61..094bbbfc09ac2cef31b62ee077938fffc0163e08 100755 Binary files a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/MainLan and b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/MainLan differ diff --git a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/MainSeq b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/MainSeq index 499e57d9976aa180dd79ceb3134db35870ff70e2..dd8713b98290b3ace41157b568613f79b7d41eff 100755 Binary files a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/MainSeq and b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/MainSeq differ diff --git a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/datos_columnas b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/datos_columnas index 45a9ba1e9b157a0faf014c5bb1c62cbef487cd34..93ba3a5e6fe363f759af03e069b265159ed897c7 100644 --- a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/datos_columnas +++ b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/datos_columnas @@ -1,61 +1,11 @@ -60 -4 2 2 1 4 3 1 2 1 1 1 1 1 1 1 1 6 -1 2 1 3 1 5 2 2 4 1 4 1 1 -2 1 2 1 6 4 3 3 2 1 5 1 1 -2 4 3 3 4 7 2 1 1 1 2 -1 1 1 4 3 1 1 1 1 2 1 3 3 2 3 -1 1 2 2 2 1 1 1 2 4 2 1 2 3 -1 1 1 1 2 1 1 1 1 1 1 1 4 2 3 1 -3 1 2 1 1 3 1 6 2 1 1 2 1 1 1 -4 1 3 2 3 2 1 4 1 3 2 3 1 -1 1 1 1 1 1 3 5 2 2 1 1 1 1 2 1 1 -1 1 1 2 1 5 2 3 1 1 4 2 1 2 1 2 3 -11 1 5 1 1 3 5 2 2 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2 5 2 4 2 2 3 1 4 3 3 -2 2 1 2 3 1 4 4 1 2 1 1 1 3 2 3 2 -1 3 2 7 1 1 1 1 3 1 1 1 1 7 -1 2 1 1 2 1 2 1 1 1 4 5 1 3 2 1 -2 3 1 2 1 5 1 3 3 2 1 2 1 1 1 3 -2 2 1 1 1 4 1 7 1 3 1 1 1 1 1 1 -4 3 2 1 1 2 2 1 3 1 2 2 2 1 1 1 4 -1 4 1 1 3 5 4 2 2 1 2 1 1 2 1 1 -1 2 3 1 7 2 3 2 3 1 1 1 2 -1 1 2 2 3 3 1 3 1 2 1 1 3 4 1 1 -1 4 2 4 3 2 1 1 1 4 4 1 2 -1 2 1 1 1 1 4 1 1 1 5 1 1 1 1 1 1 -4 1 2 1 1 3 3 1 5 1 1 1 1 1 1 -2 2 1 1 2 2 1 9 4 1 1 1 1 1 1 -1 4 9 4 8 2 3 1 1 2 5 -1 1 1 4 1 1 3 5 1 1 2 1 3 2 -4 5 1 4 1 2 1 2 2 2 2 2 +10 +3 +3 1 1 +5 2 +1 1 2 +2 2 3 +6 1 1 +2 1 +1 2 1 +1 1 1 +2 2 1 diff --git a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/datos_filas b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/datos_filas index 044447205b5c9fda9a3b4ee2fdcb342a5466007c..0495caa38a671ff7a6136f43e59075dbfd164309 100644 --- a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/datos_filas +++ b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/datos_filas @@ -1,62 +1,11 @@ -61 -2 1 2 3 1 1 1 1 2 1 1 2 3 1 2 1 4 1 -1 3 1 1 2 3 4 1 1 1 2 1 4 1 3 2 1 -1 1 2 7 1 1 8 3 1 1 1 1 1 2 -2 1 1 1 1 1 1 1 2 1 1 2 1 5 1 1 -4 5 1 2 1 2 1 1 3 1 1 3 1 1 1 1 1 -1 1 1 3 1 1 1 2 1 1 1 1 3 2 1 2 1 3 3 1 -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1 2 1 4 2 8 -1 2 1 3 1 3 2 3 4 2 1 1 1 1 1 2 1 -1 1 1 2 1 2 4 1 1 1 3 2 3 1 1 3 1 -3 3 2 2 1 2 1 1 3 1 1 -1 5 1 1 3 1 5 3 1 2 4 4 3 2 -1 1 1 1 1 1 1 4 1 1 5 1 2 4 2 4 -3 2 3 1 3 5 1 1 1 2 1 1 1 -1 1 1 1 4 3 1 2 2 1 2 1 1 1 1 2 -2 7 1 2 1 1 1 1 1 1 2 1 3 3 1 -1 1 3 2 2 2 3 1 1 2 1 2 1 1 1 -1 1 2 1 1 3 1 1 1 2 2 1 1 5 5 2 3 -2 1 1 1 1 1 1 2 2 2 2 2 1 2 1 1 2 -2 1 2 4 1 2 2 1 1 1 1 5 2 2 3 1 -2 2 1 1 2 1 3 1 4 2 1 2 1 2 -1 1 6 1 1 1 1 1 4 2 1 2 3 2 3 -1 1 1 1 1 5 4 1 1 2 1 2 1 1 2 -1 4 2 3 1 5 4 3 1 2 1 1 -2 1 3 1 1 2 1 1 2 2 1 1 6 2 -1 2 1 3 2 1 1 1 2 2 1 1 2 1 4 3 1 2 -2 2 1 1 1 5 3 1 1 2 2 1 2 1 2 2 2 -1 3 2 3 9 3 2 2 1 4 1 1 3 2 -1 2 1 1 6 1 1 3 1 1 2 2 1 1 1 -1 3 1 2 2 1 3 1 1 3 1 8 2 1 1 1 +10 +3 1 +6 1 +2 1 1 +2 1 +1 1 2 1 +6 1 +1 1 1 +5 +4 1 +4 2 diff --git a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.cfg b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.cfg index 681f85af314cc8bf32a74b0d48f7cb021d86c3b5..b29d6a02bac525686bd4d9e023976c7f7d138224 100644 --- a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.cfg +++ b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.cfg @@ -1,15 +1,15 @@ 10 // number of independent runs -1000 // number of generations +10000 // number of generations 100 // number of individuals -100 // size of offsprings in each generation +60 // size of offsprings in each generation 1 // if replaces parents for offsprings, or only offsprings may be new parents 1 // display state ? Selections // selections to apply -1 3 // selection of parents -2 4 // selection of offsprings +4 1 // selection of parents +2 0 // selection of offsprings Intra-Operators // operators to apply in the population -0 0.6 // crossover & its probability -1 1.0 0.01 // mutation & its probability +0 0.8 // crossover & its probability +1 1.0 0.02 // mutation & its probability Inter-Operators // operators to apply between this population and anothers 0 10 5 1 3 1 5 // operator number, operator rate, number of individuals, selection of indidivual to send and remplace LAN-configuration diff --git a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.pro.cc b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.pro.cc index 11895442d251a4bb2ba9ecb26fd6061ff173d22e..a77f5892884e1970564d97000fb6c07fe5404cd5 100644 --- a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.pro.cc +++ b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.pro.cc @@ -412,9 +412,10 @@ skeleton newGA void Population::Evaluate(Solution* sols,struct individual &_f) { if(_f.change) - { + { cout << "y luego aca" << endl; _f.change = false; _f.fitness = sols->fitness(); + cout << "estoy aca" << endl; _evaluations++; } } @@ -426,6 +427,7 @@ skeleton newGA *_parents[i]=*((pop.parents())[i]); _fitness_values[i] = pop._fitness_values[i]; _evaluations = pop._evaluations; + cout << "operador igual" << endl; } return (*this); } @@ -522,7 +524,7 @@ skeleton newGA } } - void Population::evolution() + void Population::evolution()//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------EVOLUTION { select_parents(); // selects individuals to apply operators @@ -1707,8 +1709,9 @@ skeleton newGA } void Solver::current_best_solution(const Solution& sol) - { + { cout << "current best solution entro" << endl; _current_best_solution.set_contents(sol.to_String(),1,sol.size()); + cout << "current best solution sali" << endl; } void Solver::current_best_cost(const double value) @@ -1737,8 +1740,9 @@ skeleton newGA } void Solver::best_solution_trial(const Solution& sol) - { + { cout << " best solution entro" << endl; _best_solution_trial.set_contents(sol.to_String(),1,sol.size()); + cout << " best solution entro" << endl; } void Solver::best_cost_trial(const double value) @@ -1787,8 +1791,9 @@ skeleton newGA } void Solver::global_best_solution(const Solution& sol) - { + { cout << "global best solution entro" << endl; _global_best_solution.set_contents(sol.to_String(),1,sol.size()); + cout << "global best solution entro" << endl; } void Solver::global_best_cost(const double value) @@ -2108,7 +2113,7 @@ skeleton newGA { current_iteration(current_iteration()+1); - current_population.evolution(); + current_population.evolution();//-----------------------------------------------------------------------------------------------------------------------------------------------------EVO STEP current_evaluations(current_population.evaluations()); // gets current interesting values in the current population diff --git a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.pro.o b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.pro.o index a1d400be3bd575604e811d1296553d1232146c74..8db8232fedae5ed2bcff4b1860faf8ba1500137b 100644 Binary files a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.pro.o and b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.pro.o differ diff --git a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.req.cc b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.req.cc index 11635865db5358fe1cd01bac6ee6266a22087bf6..1c97a8eef984187833a00884a0986cadf28604c3 100644 --- a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.req.cc +++ b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.req.cc @@ -67,6 +67,7 @@ skeleton newGA //CARGAR DATOS COLUMNAS ifstream inFile; + cout << "cols" << endl; inFile.open("datos_columnas"); if (!inFile) { @@ -94,6 +95,7 @@ skeleton newGA cout << pbm._cantColumnas; for(int c = 0; c < pbm.cantColumnas(); c++) { + cout << c << endl; getline(inFile, line2); std::vector<int> divided; @@ -132,6 +134,7 @@ skeleton newGA } inFile.close(); + cout << "fils" << endl; //CARGAR DATOS FILAS ifstream inFile2; inFile2.open("datos_filas"); @@ -347,7 +350,7 @@ skeleton newGA ostream& operator<< (ostream& os, const Solution& sol) { - cout << "Empieza os << sol" << endl; + //cout << "Empieza os << sol" << endl; //for (int i=0;i<sol.pbm().dimension();i++) // os << " " << sol._var[i]; stringstream ss; @@ -368,14 +371,14 @@ skeleton newGA outfile.close(); os << ss.str(); - cout << "Termina os << sol" << endl; + //cout << "Termina os << sol" << endl; return os; } NetStream& operator << (NetStream& ns, const Solution& sol) { - cout << "Empieza ns << sol" << endl; + //cout << "Empieza ns << sol" << endl; for(int i = 0; i < sol._pbm.cantColumnas(); i++) { for (int j=0; j<sol._pbm.cantFilas();j++) @@ -384,7 +387,7 @@ skeleton newGA } } - cout << "Termina ns << sol" << endl; + //cout << "Termina ns << sol" << endl; return ns; } @@ -432,7 +435,7 @@ skeleton newGA void Solution::initialize() { - //cout << "ESTOY ENTRANDO A INITIALIZE" << endl; + cout << "ESTOY ENTRANDO A INITIALIZE" << endl; _deleted = 0; @@ -501,7 +504,7 @@ skeleton newGA double Solution::fitness () { - //cout << "ESTOY ENTRANDO A FITNESS" << endl; + cout << "ESTOY ENTRANDO A FITNESS" << endl; double fitness = 0.0; std::vector<std::vector<int>> datosDeFilas = _pbm.datosFilas(); std::vector<int> cantGruposDeFila = _pbm.cantGruposFila(); @@ -534,7 +537,7 @@ skeleton newGA { resultado = cantSeguidos; } - fitness= fitness + 1000 * resultado; + fitness= fitness + 1 * resultado; terminoBloque=true; iteradorGrupos++; resultado=0; @@ -555,7 +558,7 @@ skeleton newGA { resultado = cantSeguidos; } - fitness= fitness + 1000 * resultado; + fitness= fitness + 2 * resultado; terminoBloque=true; iteradorGrupos++; resultado=0; @@ -563,7 +566,7 @@ skeleton newGA if(iteradorGrupos != cantGrupos) { int restar= abs(cantGrupos - iteradorGrupos); - fitness= fitness + 1100*restar; + fitness= fitness + 3*restar; } int totalUnos = 0; for(int j = 0; j< cantGrupos; j++) @@ -573,7 +576,7 @@ skeleton newGA if(cantUnos != totalUnos) { int restar= abs(totalUnos - cantUnos); - fitness= fitness + 300*restar; + fitness= fitness + 1*restar; } } extern int currentBestFitness; @@ -592,24 +595,24 @@ skeleton newGA //cout << sol.var(col, fil) << " "; if (_var[col][fil] != 0 && _var[col][fil] != 1) { - cout << "fitness end" << endl; + //cout << "fitness end" << endl; //exit(EXIT_FAILURE); } } //cout << endl; } - //cout << "ESTOY SALIENDO DE FITNESS" << endl; + cout << "ESTOY SALIENDO DE FITNESS" << endl; if (fitness == 0) { - cout << "found sol lmao" << endl; + //cout << "found sol lmao" << endl; } return fitness; } char *Solution::to_String() const { - cout << "EN TO STRING" << endl; + //cout << "EN TO STRING" << endl; //std::vector<int> aux = std::vector<int>(0); //std::vector<int>((_pbm.cantColumnas() + 1) * _pbm.cantFilas()); /* @@ -719,7 +722,7 @@ skeleton newGA { resultado = cantSeguidos; } - fitness= fitness + 1000 * resultado; + fitness= fitness + 1 * resultado; terminoBloque=true; iteradorGrupos++; resultado=0; @@ -740,7 +743,7 @@ skeleton newGA { resultado = cantSeguidos; } - fitness= fitness + 1000 * resultado; + fitness= fitness + 1 * resultado; terminoBloque=true; iteradorGrupos++; resultado=0; @@ -748,7 +751,7 @@ skeleton newGA if(iteradorGrupos != cantGrupos) { int restar= abs(cantGrupos - iteradorGrupos); - fitness= fitness + 1100*restar; + fitness= fitness + 2*restar; } int totalUnos = 0; for(int j = 0; j< cantGrupos; j++) @@ -758,7 +761,7 @@ skeleton newGA if(cantUnos != totalUnos) { int restar= abs(totalUnos - cantUnos); - fitness= fitness + 300*restar; + fitness= fitness + 1*restar; } } //---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -804,13 +807,15 @@ skeleton newGA //FILE--------------------------------------------------------------------------------------------------- - + //cout << "to string ex" << endl; + //char arr[1]; + //arr[0] = "c"; return new char[1]; } void Solution::to_Solution(char *_string_) { - cout << "toSolution" << endl; + //cout << "toSolution" << endl; /* int *ptr=(int *)_string_; std::vector<int> aux = std::vector<int>((_pbm.cantColumnas()+1) * _pbm.cantFilas()); @@ -917,8 +922,8 @@ skeleton newGA } unsigned int Solution::size() const - { - return (_pbm.cantColumnas() * _pbm.cantFilas() * sizeof(int)); + { cout << "pase por size" << endl; + return (_pbm.cantColumnas() * _pbm.cantFilas() * sizeof(int)+1); } @@ -1067,15 +1072,18 @@ skeleton newGA } void Crossover::cross(Solution& sol1,Solution& sol2) const // dadas dos soluciones de la poblacion, las cruza - { //cout << "ESTOY ENTRANDO A CROSSOVER" << endl; + { //Usamos cruzamiento de dos puntos (2PX) - + cout << "cross ent" << endl; int i=0; std::vector<std::vector<int>> aux(sol1.pbm().cantColumnas()); aux=sol2.array_var(); int limit=rand_int((sol1.pbm().cantColumnas()/2)+1,sol1.pbm().cantColumnas()-1); int limit2=rand_int(0,limit-1); + + int limitS=rand_int(1, sol1.pbm().cantColumnas() - 2); + /* for (i=0;i<limit2;i++) sol2.var(i)=sol1.var(i); for (i=0;i<limit2;i++) @@ -1084,9 +1092,15 @@ skeleton newGA sol2.var(i)=sol1.var(i); for (i=limit;i<sol1.pbm().cantColumnas();i++) sol1.var(i)=aux[i]; + */ + for (i=0;i<limitS;i++) + sol2.var(i)=sol1.var(i); + for (i=0;i<limitS;i++) + sol1.var(i)=aux[i]; sol1.init() = 1; sol2.init() = 1; + cout << "cross ex" << endl; //cout << "ESTOY SALIENDO DE CROSSOVER" << endl; } @@ -1137,7 +1151,7 @@ skeleton newGA /* void Mutation::mutate(Solution& sol) const - { //cout << "ESTOY ENTRANDO A MUTATION" << endl; + { cout << "ESTOY ENTRANDO A MUTATION" << endl; std::vector<std::vector<int>> _grupos = sol.pbm().datosColumnas(); for (int i=0;i<sol.pbm().cantColumnas();i++) { @@ -1185,7 +1199,7 @@ skeleton newGA */ void Mutation::mutate(Solution& sol) const { -// cout << "ESTOY ENTRANDO A MUTATION" << endl; + cout << "mut ent" << endl; // for (int fil = 0; fil < sol.pbm().cantFilas(); fil++) // { @@ -1296,7 +1310,7 @@ skeleton newGA }*/ -// cout << "ESTOY SALIENDO DE MUTATION" << endl; + cout << "mut ex" << endl; } void Mutation::execute(Rarray<Solution*>& sols) const diff --git a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.req.o b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.req.o index fbcb522b96d53657fae0919a9ac2ab2918282688..b3e0b6a87e1e8e66f50e300b2f650af529bc3070 100644 Binary files a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.req.o and b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/newGA.req.o differ diff --git a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/solution b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/solution index c3ac967cebb2dac3c8a76923ea1e26b2da3c4ec2..066ff6b5e14e6f2fc6e5cab91863d7c38fafa384 100644 --- a/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/solution +++ b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/solution @@ -1,61 +1,10 @@ -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 -0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 -0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0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000000000000000000000000000..4cf9138b7c40442615d5acbbc15601f2ea429134 --- /dev/null +++ b/ProyectoFinal/AlgoritmoGenetico/malva/rep/GA/tempsolution @@ -0,0 +1,11 @@ +5 +0 0 0 0 1 1 1 0 0 0 +0 1 1 1 0 1 0 0 1 0 +0 1 1 1 1 1 0 0 1 1 +0 1 0 0 0 1 0 0 1 1 +1 1 0 0 1 1 0 1 1 1 +1 1 1 1 1 1 0 1 0 1 +1 1 0 0 0 0 0 1 0 0 +0 0 0 0 1 0 1 1 0 1 +0 0 0 0 1 0 0 1 0 1 +0 1 1 0 0 1 1 0 1 0