Commit 1fc2f9dd authored by Alexis Lebis's avatar Alexis Lebis

Solved m3tal/csdvp-evolutionary-optimization#8

Each comp has its own value  for each coruses
parent e5265b0e
......@@ -83,7 +83,7 @@ int main(int argc, char* argv[]){
pb.set_cfg_pickedCoursesByTimeFrame(2);
CSDVP::generateProblem(pb, CSDVP::GenerationType::RANDOM, 11);
CSDVP::generateProblem(pb, CSDVP::GenerationType::RANDOM, 7777);
assert(pb.checkConfig());
job.setRequiredECTS(4 * 6);
......
......@@ -362,7 +362,9 @@ int CSDVP::CSDVP_COUNTER = 0;
{
tmpComp = queue.front();
queue.pop();queue.push(tmpComp);
teachedComp = std::pair<Competency,double>(tmpComp, 1.0);
magVal = pb.cfg_magnitudeMin().value() + ( (double)rand()/RAND_MAX) * ( pb.cfg_magnitudeMax().value() - pb.cfg_magnitudeMin().value()) ;
Competency cpt = Competency::build(magVal,tmpComp.c_name());
teachedComp = std::pair<Competency,double>(cpt, 1.0);
pb.unlocked_coursesCatalogue().at(i).addTeachedComp(teachedComp);
}
}
......@@ -381,8 +383,12 @@ int CSDVP::CSDVP_COUNTER = 0;
for(int j = 0; j < x; j++)
{
tmpComp = queue.front();
queue.pop(); queue.push(tmpComp);
pb.unlocked_coursesCatalogue().at(i).addPrerequisite(tmpComp);
queue.pop();
//we change mag value for prereq
magVal = pb.cfg_magnitudeMin().value() + ( (double)rand()/RAND_MAX) * ( pb.cfg_magnitudeMax().value() - pb.cfg_magnitudeMin().value()) ;
Competency cpt = Competency::build(magVal,tmpComp.c_name());
pb.unlocked_coursesCatalogue().at(i).addPrerequisite(cpt);
queue.push(tmpComp);
}
}
......
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