Commit 43c97b73 authored by HUMEAU Jéremie's avatar HUMEAU Jéremie

last exp

parent bc4663c8
...@@ -154,7 +154,8 @@ int main(int argc, char* argv[]){ ...@@ -154,7 +154,8 @@ int main(int argc, char* argv[]){
eoSGATransform<Cursus> transform(cross, PCROSS, mut, PMUT); eoSGATransform<Cursus> transform(cross, PCROSS, mut, PMUT);
eoDetTournamentSelect<Cursus> selectOne(SIZET); eoDetTournamentSelect<Cursus> selectOne(SIZET);
eoSelectPerc<Cursus> select(selectOne); eoSelectPerc<Cursus> select(selectOne);
eoGenerationalReplacement<Cursus> replace; eoGenerationalReplacement<Cursus> genReplace;
eoWeakElitistReplacement<Cursus> replace(genReplace);
//POPULATION INITIALISATION //POPULATION INITIALISATION
eoPop<Cursus> pop; eoPop<Cursus> pop;
...@@ -265,7 +266,6 @@ int main(int argc, char* argv[]){ ...@@ -265,7 +266,6 @@ int main(int argc, char* argv[]){
std::cout << pb.coursesCatalogue().at(i) << std::endl; std::cout << pb.coursesCatalogue().at(i) << std::endl;
} }
*/ */
std::cout << job << std::endl;
// ======================== TEST ZONE END======================== // ======================== TEST ZONE END========================
...@@ -278,7 +278,27 @@ int main(int argc, char* argv[]){ ...@@ -278,7 +278,27 @@ int main(int argc, char* argv[]){
filename+=oss.str(); filename+=oss.str();
std::ofstream outputfile(filename.c_str(), std::ios::app); std::ofstream outputfile(filename.c_str(), std::ios::app);
std::cout << "===== CURRENT POP =====" << std::endl; oss.str("");
filename=_outputFile + "/pop.";
oss << _seedParam;
filename+=oss.str();
std::ofstream outputfile2(filename.c_str(), std::ios::app);
oss.str("");
filename=_outputFile + "/req.";
oss << _seedParam;
filename+=oss.str();
std::ofstream outputfile3(filename.c_str(), std::ios::app);
oss.str("");
filename=_outputFile + "/solsstats.";
oss << _seedParam;
filename+=oss.str();
std::ofstream outputfile4(filename.c_str(), std::ios::app);
/*std::cout << "===== CURRENT POP =====" << std::endl;
pop.best_element().printOn(std::cout); pop.best_element().printOn(std::cout);
std::cout << " fitness:" << pop.best_element().fitness() << std::endl; std::cout << " fitness:" << pop.best_element().fitness() << std::endl;
std::cout << "Stats & metrics: \n" << std::endl; std::cout << "Stats & metrics: \n" << std::endl;
...@@ -315,18 +335,56 @@ int main(int argc, char* argv[]){ ...@@ -315,18 +335,56 @@ int main(int argc, char* argv[]){
std::cout << "failed"; std::cout << "failed";
std::cout << " | value: " << resPrq.second << std::endl; std::cout << " | value: " << resPrq.second << std::endl;
std::cout << "\n==========" << std::endl; std::cout << "\n==========" << std::endl;
*/
// ---------- ALGO HERE // ---------- ALGO HERE
eoEasyEA<QUEEN> algo(cont,eval,select,transform,replace); eoEasyEA<QUEEN> algo(cont,eval,select,transform,replace);
//WRITE CURRENT POP
pop.best_element().printOn(outputfile4);
outputfile4 << " " << ctrECTS.integrityCheck(pop.best_element()).second << " " << ctrRep.integrityCheck(pop.best_element()).second << " " << ctrJob.integrityCheck(pop.best_element()).second << " " << ctrPrq.integrityCheck(pop.best_element()).second << std::endl;
outputfile2 << pop.size() << std::endl;
outputfile3 << pop.size() << std::endl;
for(int i=0; i<pop.size();i++){
//Write pop + prerequires values
pop[i].printOn(outputfile2);
outputfile2 << " " << ctrECTS.integrityCheck(pop[i]).second << " " << ctrRep.integrityCheck(pop[i]).second << " " << ctrJob.integrityCheck(pop[i]).second << " " << ctrPrq.integrityCheck(pop[i]).second << std::endl;
//Write prerequires values
outputfile3 << ctrECTS.integrityCheck(pop[i]).second << " " << ctrRep.integrityCheck(pop[i]).second << " " << ctrJob.integrityCheck(pop[i]).second << " " << ctrPrq.integrityCheck(pop[i]).second << std::endl;
}
//RUN ALGO
algo(pop); algo(pop);
//WRITE FINAL POP
pop.best_element().printOn(outputfile); pop.best_element().printOn(outputfile);
pop.best_element().printOn(outputfile4);
outputfile4 << " " << ctrECTS.integrityCheck(pop.best_element()).second << " " << ctrRep.integrityCheck(pop.best_element()).second << " " << ctrJob.integrityCheck(pop.best_element()).second << " " << ctrPrq.integrityCheck(pop.best_element()).second << std::endl;
outputfile2 << pop.size() << std::endl;
outputfile3 << pop.size() << std::endl;
for(int i=0; i<pop.size();i++){
//Write pop + prerequires values
pop[i].printOn(outputfile2);
outputfile2 << " " << ctrECTS.integrityCheck(pop[i]).second << " " << ctrRep.integrityCheck(pop[i]).second << " " << ctrJob.integrityCheck(pop[i]).second << " " << ctrPrq.integrityCheck(pop[i]).second << std::endl;
//Write prerequires values
outputfile3 << ctrECTS.integrityCheck(pop[i]).second << " " << ctrRep.integrityCheck(pop[i]).second << " " << ctrJob.integrityCheck(pop[i]).second << " " << ctrPrq.integrityCheck(pop[i]).second << std::endl;
}
outputfile.close(); outputfile.close();
outputfile2.close();
outputfile3.close();
outputfile4.close();
// ------------------- // -------------------
/*
std::cout << "\n===== BEST INDIVIDU =====" << std::endl; std::cout << "\n===== BEST INDIVIDU =====" << std::endl;
pop.best_element().printOn(std::cout); pop.best_element().printOn(std::cout);
std::cout << " fitness:" << pop.best_element().fitness() << std::endl; std::cout << " fitness:" << pop.best_element().fitness() << std::endl;
...@@ -360,14 +418,14 @@ int main(int argc, char* argv[]){ ...@@ -360,14 +418,14 @@ int main(int argc, char* argv[]){
std::cout << "Prereq: "; std::cout << "Prereq: ";
if(resPrq.first) if(resPrq.first)
std::cout << "succeed"; std::cout << "succeed";
else else
std::cout << "failed"; std::cout << "failed";
std::cout << " | value: " << resPrq.second << std::endl; std::cout << " | value: " << resPrq.second << std::endl;
std::cout << "===============" << std::endl; std::cout << "===============" << std::endl;
std::cout << "cpt: " << cross.cpt << std::endl; */
// ================================= END RUN ZONE =============================== // ================================= END RUN ZONE ===============================
return EXIT_SUCCESS; return EXIT_SUCCESS;
......
for nbCours in 15
do
for nbComps in 10 20
do
for cbyTF in 2
do
for rEngine in 50
do
for pMut in 0.25 0.5 0.75
do
for pCross in 0.25 0.5 0.75
do
for tSize in 3 7
do
RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}_${rEngine}_${pMut}_${pCross}_${tSize}"
mkdir $RESDIR
for run in 30
do
RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}_${rEngine}_${pMut}_${pCross}_${tSize}"
sbatch --array=1-${run} --job-name=${RESDIR} --output=${RESDIR}.out --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,B=$rEngine,x=$pMut,X=$pCross,F=$tSize job.sh
done
done
done
done
done
done
done
done
for nbCours in 25
do
for nbComps in 10
do
for cbyTF in 3
do
for rEngine in 50
do
for pMut in 0.25 0.5 0.75
do
for pCross in 0.25 0.5 0.75
do
for tSize in 3 7
do
RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}_${rEngine}_${pMut}_${pCross}_${tSize}"
mkdir $RESDIR
for run in 30
do
RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}_${rEngine}_${pMut}_${pCross}_${tSize}"
sbatch --array=1-${run} --job-name=${RESDIR} --output=${RESDIR}.out --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,B=$rEngine,x=$pMut,X=$pCross,F=$tSize job.sh
done
done
done
done
done
done
done
done
for nbCours in 20
do
for nbComps in 20
do
for cbyTF in 3
do
for rEngine in 50
do
for pMut in 0.25 0.5 0.75
do
for pCross in 0.25 0.5 0.75
do
for tSize in 3 7
do
RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}_${rEngine}_${pMut}_${pCross}_${tSize}"
mkdir $RESDIR
for run in 30
do
RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}_${rEngine}_${pMut}_${pCross}_${tSize}"
sbatch --array=1-${run} --job-name=${RESDIR} --output=${RESDIR}.out --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,B=$rEngine,x=$pMut,X=$pCross,F=$tSize job.sh
done
done
done
done
done
done
done
done
for nbCours in 30
do
for nbComps in 40
do
for cbyTF in 4
do
for rEngine in 50
do
for pMut in 0.25 0.5 0.75
do
for pCross in 0.25 0.5 0.75
do
for tSize in 3 7
do
RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}_${rEngine}_${pMut}_${pCross}_${tSize}"
mkdir $RESDIR
for run in 30
do
RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}_${rEngine}_${pMut}_${pCross}_${tSize}"
sbatch --array=1-${run} --job-name=${RESDIR} --output=${RESDIR}.out --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,B=$rEngine,x=$pMut,X=$pCross,F=$tSize job.sh
done
done
done
done
done
done
done
done
for nbCours in 15
do
for nbComps in 10 20
do
for cbyTF in 2
do
for rEngine in 25 50 75
do
for pMut in 0.25 0.5 0.75
do
for pCross in 0.25 0.5 0.75
do
for tSize in 2 5 7
do
RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}_${rEngine}_${pMut}_${pCross}_${tSize}"
mkdir $RESDIR
for run in 5
do
RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}_${rEngine}_${pMut}_${pCross}_${tSize}"
sbatch --array=1-${run} --job-name=${RESDIR} --output=${RESDIR}.out --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,B=$rEngine,x=$pMut,X=$pCross,F=$tSize job.sh
done
done
done
done
done
done
done
done
#!/bin/sh #!/bin/bash
#SBATCH -o main.out #SBATCH -o main.out
#SBATCH -N 1 #SBATCH -N 1
#SBATCH -n 1 #SBATCH -n 1
#SBATCH --mem=10G #SBATCH --mem=4G
#SBATCH -p defq #SBATCH -p defq
/home/jeremie.humeau/private/gitProject/csdvp-evolutionary-algorithm-optimization/build/application/ceao -B=50 -S=$S -C=$C -c=$c -A=$A --outputfile=$O -n=$A /home/jeremie.humeau/private/gitProject/csdvp-evolutionary-algorithm-optimization/build/application/ceao -G=10000 -P=100 -S=$SLURM_ARRAY_TASK_ID -C=$C -c=$c -A=$A --outputfile=$O -n=$A -B=$B -x=$x -X=$X -F=$F
exit 0 exit 0
#!/bin/sh
#SBATCH -o main.out
#SBATCH -N 1
#SBATCH -n 1
#SBATCH --mem=10G
#SBATCH -p defq
/home/jeremie.humeau/private/gitProject/csdvp-evolutionary-algorithm-optimization/build/application/ceao -B=50 -S=$S -C=$C -c=$c -A=$A --outputfile=$O
exit 0
...@@ -7,13 +7,12 @@ do ...@@ -7,13 +7,12 @@ do
do do
for cbyTF in 2 for cbyTF in 2
do do
RESDIR="${nbCours}_${nbComps}_${cbyTF}" RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}"
mkdir $RESDIR mkdir $RESDIR
for run in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 for run in 5
do do
RESDIR="${nbCours}_${nbComps}_${cbyTF}" RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}"
# sbatch --job-name=${RESDIR}_${run} --output=${RESDIR}_${run}.out --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,S=$run job.sh sbatch --array=1-${run} --job-name=${RESDIR} --output=${RESDIR}.out --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR job.sh
sbatch --job-name=${RESDIR}_${run} --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,S=$run job.sh
done done
done done
done done
...@@ -25,13 +24,12 @@ do ...@@ -25,13 +24,12 @@ do
do do
for cbyTF in 3 for cbyTF in 3
do do
RESDIR="${nbCours}_${nbComps}_${cbyTF}" RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}"
mkdir $RESDIR mkdir $RESDIR
for run in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 for run in 5
do do
RESDIR="${nbCours}_${nbComps}_${cbyTF}" RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}"
# sbatch --job-name=${RESDIR}_${run} --output=${RESDIR}_${run}.out --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,S=$run job.sh sbatch --array=1-${run} --job-name=${RESDIR} --output=${RESDIR}.out --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR job.sh
sbatch --job-name=${RESDIR}_${run} --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,S=$run job.sh
done done
done done
done done
...@@ -43,13 +41,12 @@ do ...@@ -43,13 +41,12 @@ do
do do
for cbyTF in 3 for cbyTF in 3
do do
RESDIR="${nbCours}_${nbComps}_${cbyTF}" RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}"
mkdir $RESDIR mkdir $RESDIR
for run in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 for run in 5
do do
RESDIR="${nbCours}_${nbComps}_${cbyTF}" RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}"
# sbatch --job-name=${RESDIR}_${run} --output=${RESDIR}_${run}.out --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,S=$run job.sh sbatch --array=1-${run} --job-name=${RESDIR} --output=${RESDIR}.out --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR job.sh
sbatch --job-name=${RESDIR}_${run} --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,S=$run job.sh
done done
done done
done done
...@@ -61,17 +58,15 @@ do ...@@ -61,17 +58,15 @@ do
do do
for cbyTF in 4 for cbyTF in 4
do do
RESDIR="${nbCours}_${nbComps}_${cbyTF}" RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}"
mkdir $RESDIR mkdir $RESDIR
for run in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 for run in 5
do do
RESDIR="${nbCours}_${nbComps}_${cbyTF}" RESDIR="../results/${nbCours}_${nbComps}_${cbyTF}"
sbatch --job-name=${RESDIR}_${run} --output=${RESDIR}_${run}.out --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,S=$run job.sh sbatch --array=1-${run} --job-name=${RESDIR} --output=${RESDIR}.out --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR job.sh
# sbatch --job-name=${RESDIR}_${run} --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,S=$run job.sh
done done
done done
done done
done done
exit 0 exit 0
#!/bin/bash
for nbCours in 15
do
for nbComps in 10 20
do
for cbyTF in 2
do
RESDIR="${nbCours}_${nbComps}_${cbyTF}"
mkdir $RESDIR
for run in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
do
RESDIR="${nbCours}_${nbComps}_${cbyTF}"
# sbatch --job-name=${RESDIR}_${run} --output=${RESDIR}_${run}.out --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,S=$run job.sh
sbatch --job-name=${RESDIR}_${run} --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,S=$run job.sh
done
done
done
done
for nbCours in 25
do
for nbComps in 10
do
for cbyTF in 3
do
RESDIR="${nbCours}_${nbComps}_${cbyTF}"
mkdir $RESDIR
for run in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
do
RESDIR="${nbCours}_${nbComps}_${cbyTF}"
# sbatch --job-name=${RESDIR}_${run} --output=${RESDIR}_${run}.out --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,S=$run job.sh
sbatch --job-name=${RESDIR}_${run} --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,S=$run job.sh
done
done
done
done
for nbCours in 20
do
for nbComps in 20
do
for cbyTF in 3
do
RESDIR="${nbCours}_${nbComps}_${cbyTF}"
mkdir $RESDIR
for run in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
do
RESDIR="${nbCours}_${nbComps}_${cbyTF}"
# sbatch --job-name=${RESDIR}_${run} --output=${RESDIR}_${run}.out --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,S=$run job.sh
sbatch --job-name=${RESDIR}_${run} --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,S=$run job.sh
done
done
done
done
for nbCours in 30
do
for nbComps in 40
do
for cbyTF in 4
do
RESDIR="${nbCours}_${nbComps}_${cbyTF}"
mkdir $RESDIR
for run in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
do
RESDIR="${nbCours}_${nbComps}_${cbyTF}"
# sbatch --job-name=${RESDIR}_${run} --output=${RESDIR}_${run}.out --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,S=$run job.sh
sbatch --job-name=${RESDIR}_${run} --export=C=$nbCours,c=$nbComps,A=$cbyTF,O=$RESDIR,S=$run job.sh
done
done
done
done
exit 0
...@@ -9,11 +9,10 @@ class crossCSDVP: public eoQuadOp<EOT> ...@@ -9,11 +9,10 @@ class crossCSDVP: public eoQuadOp<EOT>
public: public:
crossCSDVP(CSDVP& _pb, ConstraintsRepetition& _ctr, CursusInitConstraint& _init):pb(_pb),ctr(_ctr), init(_init), cpt(0){} crossCSDVP(CSDVP& _pb, ConstraintsRepetition& _ctr, CursusInitConstraint& _init):pb(_pb),ctr(_ctr), init(_init){}
virtual bool operator()(EOT& _chrom1, EOT& _chrom2){ virtual bool operator()(EOT& _chrom1, EOT& _chrom2){
cpt++;
//Integrity Check BEFORE CROSS //Integrity Check BEFORE CROSS
std::pair<bool, double> ctrRes1= ctr.integrityCheck(_chrom1); std::pair<bool, double> ctrRes1= ctr.integrityCheck(_chrom1);
std::pair<bool, double> ctrRes2= ctr.integrityCheck(_chrom2); std::pair<bool, double> ctrRes2= ctr.integrityCheck(_chrom2);
...@@ -137,7 +136,6 @@ class crossCSDVP: public eoQuadOp<EOT> ...@@ -137,7 +136,6 @@ class crossCSDVP: public eoQuadOp<EOT>
} }
} }
int cpt;
private: private:
CSDVP pb; CSDVP pb;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment