Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<int> crear_individuo(int days, int nurses, vector<vector<int> > c_matrix){
- vector<vector<int> > c_matrix_aux;
- vector<int> individuo(days*nurses, -1);
- for (int i = 0; i < days; i++){
- for(int j = 0; j < 4; j++){
- //turno = rand() % 4;
- while(c_matrix[i][j] > 0){
- int enfermera = rand() % (nurses - 1);
- while(individuo[enfermera + (i*nurses)] != -1){
- enfermera = rand() % (nurses - 1);
- }
- individuo[enfermera + (i*nurses)] = j;
- c_matrix[i][j] -= 1;
- }
- //individuo.push_back(turno);
- }
- }
- return individuo;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement