Back to index

fet  5.18.0
Classes | Functions
generate.h File Reference
#include "timetable_defs.h"
#include "solution.h"
#include <QTextStream>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Generate
 This class incorporates the routines for time and space allocation of activities. More...

Functions

bool skipRandom (double weightPercentage)
bool compareFunctionGenerate (int i, int j)

Function Documentation

bool compareFunctionGenerate ( int  i,
int  j 
) [inline]

Definition at line 3274 of file generate.cpp.

Here is the caller graph for this function:

bool skipRandom ( double  weightPercentage) [inline]

Definition at line 1592 of file generate.cpp.

{
       if(weightPercentage<0)
              return true; //non-existing constraint
              
       if(weightPercentage>=100.0)
              return false;

       double t=weightPercentage/100.0;
       assert(t>=0 && t<=1);
              
       t*=double(MM);
       int tt=int(floor(t+0.5));
       assert(tt>=0 && tt<=MM);
                                          
       int r=randomKnuth1MM1();
       assert(r>0 && r<MM); //r cannot be 0
       if(tt<=r)
              return true;
       else
              return false;
}

Here is the call graph for this function:

Here is the caller graph for this function: