indent all

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@232 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
liefooga 2007-04-13 15:05:07 +00:00
commit c8049ca6cd
51 changed files with 3899 additions and 3898 deletions

View file

@ -24,41 +24,41 @@ class FlowShopInit: public eoInit<FlowShop> {
public:
/**
* constructor
* @param const unsigned _N the number of jobs to schedule
*/
FlowShopInit(const unsigned _N) {
N = _N;
}
/**
* randomize a genotype
* @param FlowShop & _genotype a genotype that has been default-constructed
*/
void operator()(FlowShop & _genotype) {
// scheduling vector
vector<unsigned> scheduling(N);
// initialisation of possible values
vector<unsigned> possibles(N);
for(unsigned i=0 ; i<N ; i++)
possibles[i] = i;
// random initialization
unsigned rInd; // random index
for (unsigned i=0; i<N; i++) {
rInd = (unsigned) rng.uniform(N-i);
scheduling[i] = possibles[rInd];
possibles[rInd] = possibles[N-i-1];
/**
* constructor
* @param const unsigned _N the number of jobs to schedule
*/
FlowShopInit(const unsigned _N) {
N = _N;
}
/**
* randomize a genotype
* @param FlowShop & _genotype a genotype that has been default-constructed
*/
void operator()(FlowShop & _genotype) {
// scheduling vector
vector<unsigned> scheduling(N);
// initialisation of possible values
vector<unsigned> possibles(N);
for (unsigned i=0 ; i<N ; i++)
possibles[i] = i;
// random initialization
unsigned rInd; // random index
for (unsigned i=0; i<N; i++) {
rInd = (unsigned) rng.uniform(N-i);
scheduling[i] = possibles[rInd];
possibles[rInd] = possibles[N-i-1];
}
_genotype.setScheduling(scheduling);
_genotype.invalidate(); // IMPORTANT in case the _genotype is old
}
_genotype.setScheduling(scheduling);
_genotype.invalidate(); // IMPORTANT in case the _genotype is old
}
private:
/** the number of jobs (size of a scheduling vector) */
unsigned N;
/** the number of jobs (size of a scheduling vector) */
unsigned N;
};
#endif /*FLOWSHOPINIT_H_*/