Commit bde8b48c authored by Alexis Lebis's avatar Alexis Lebis

threshold for prereq min or max HL

parent fe7a49cb
...@@ -440,11 +440,19 @@ int CSDVP::CSDVP_COUNTER = 0; ...@@ -440,11 +440,19 @@ int CSDVP::CSDVP_COUNTER = 0;
for(unsigned int i = 0 ; i < randomVec.size(); i++) for(unsigned int i = 0 ; i < randomVec.size(); i++)
queue.push(randomVec.at(i)); queue.push(randomVec.at(i));
int firstTF = 0; int randVal = 0;
int threshold = 30;
for(unsigned int i = 0; i < pb.coursesCatalogue().size(); i++) for(unsigned int i = 0; i < pb.coursesCatalogue().size(); i++)
{ {
x = _randomizeIn(pb.cfg_prerequisiteByCourseMin(), pb.cfg_prerequisiteByCourseMax()); x = _randomizeIn(pb.cfg_prerequisiteByCourseMin(), pb.cfg_prerequisiteByCourseMax());
lastTF = pb.coursesCatalogue().at(i).lastTimeFrame(); lastTF = pb.coursesCatalogue().at(i).lastTimeFrame();
firstTF = pb.coursesCatalogue().at(i).timeFrame().at(0);
randVal = rand() % (100);
if( x < threshold)
maxLevel = lastTF * hLevelR / nbTF; maxLevel = lastTF * hLevelR / nbTF;
else
maxLevel = firstTF * hLevelR / nbTF;
//maxLevel = lastTF * hLevelR / nbTF;
maxLevel--; // Logically, prerequisite can only be according to comp of lower HL maxLevel--; // Logically, prerequisite can only be according to comp of lower HL
if(maxLevel >= 0) // then this means we are dealing with at least a HL 1, so only HL below can serve as prereq if(maxLevel >= 0) // then this means we are dealing with at least a HL 1, so only HL below can serve as prereq
{ {
......
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