added data for S2 and bug fixes

This commit is contained in:
alexandre 2024-04-14 11:00:05 +02:00
parent 3c0da02e3a
commit 1f2562109b
5 changed files with 235 additions and 103 deletions

View File

@ -747,7 +747,7 @@ bool is_overlap_creneau(creneau* edt, int len_edt, int id, int grp) { // detect
return false;
}
void add_colles_for_group_MP2I(int* weeks_len, creneau* edt, int len_edt, colleur* chads, int len_chads, int n_weeks, int grp, topic start_rotation, int mth, int inf) {
void add_colles_for_group_MP2I(int* weeks_len, creneau* edt, int len_edt, colleur* chads, int len_chads, int n_weeks, int grp, topic start_rotation, int mth, int inf, int* skip_count) {
topic rotation = start_rotation; // physics/english rotation
int math = mth; // math (3/4)
int info = inf; // info (1/6)
@ -794,7 +794,7 @@ void add_colles_for_group_MP2I(int* weeks_len, creneau* edt, int len_edt, colleu
info++;
// info colle
while(info == 5) {
while(info >= 8) {
if(edt[k+r%weeklen].group == 0 && edt[k+r%weeklen].length == 2) {
// if creneau is empty
// import all colleurs available
@ -812,8 +812,8 @@ void add_colles_for_group_MP2I(int* weeks_len, creneau* edt, int len_edt, colleu
// - he is a INFO colleur
// if a colle has been addded, interrupt the for and while loops
for(int dude = 0; dude < len_perm*(1-found); dude++) {
if(chads[perm[dude]].mat == INFO && !is_overlap_creneau(edt, len_edt, k+r%weeklen, grp)) {
add_colle(edt, chads, grp, k+r%weeklen, perm[dude]);
if(dudes[perm[dude]].mat == INFO && !is_overlap_creneau(edt, len_edt, k+r%weeklen, grp)) {
add_colle(edt, dudes, grp, k+r%weeklen, perm[dude]);
found = true;
info = 0;
}
@ -822,7 +822,8 @@ void add_colles_for_group_MP2I(int* weeks_len, creneau* edt, int len_edt, colleu
}
if(!found && halt > weeklen) {
info = 0;
printf("Warning : skipping info colle for week %d and group %d\n", week+1, grp);
//printf("Warning : skipping info colle for week %d and group %d\n", week+1, grp);
*skip_count += 1;
}
r++;
halt++;
@ -853,8 +854,8 @@ void add_colles_for_group_MP2I(int* weeks_len, creneau* edt, int len_edt, colleu
// - he does not have another colle at the same time (is_overlap)
// if a colle has been addded, interrupt the for andwhile loops
for(int dude = 0; dude < len_perm*(1-found); dude++) {
if(chads[perm[dude]].mat == MATH) {
add_colle(edt, chads, grp, k+r%weeklen, perm[dude]);
if(dudes[perm[dude]].mat == MATH) {
add_colle(edt, dudes, grp, k+r%weeklen, perm[dude]);
if(is_overlap(edt, len_edt, k+r%weeklen)) {
remove_colle(edt, k+r%weeklen);
} else {
@ -867,7 +868,8 @@ void add_colles_for_group_MP2I(int* weeks_len, creneau* edt, int len_edt, colleu
}
if(!found && halt > weeklen) {
remaining_to_add--;
printf("Warning : skipping math colle for week %d and group %d\n", week+1, grp);
//printf("Warning : skipping math colle for week %d and group %d\n", week+1, grp);
*skip_count += 1;
}
r++;
halt++;
@ -885,8 +887,9 @@ void add_colles_for_group_MP2I(int* weeks_len, creneau* edt, int len_edt, colleu
if(len_dudes != 0) {
generate_random_perm(perm, len_perm);
for(int dude = 0; dude < len_perm*(1-found); dude++) {
if(chads[perm[dude]].mat == rotation) {
add_colle(edt, chads, grp, k+r%16, perm[dude]);
//printf("%d\n", chads[perm[dude]]);
if(dudes[perm[dude]].mat == rotation) {
add_colle(edt, dudes, grp, k+r%16, perm[dude]);
found = true;
remaining_to_add--;
}
@ -895,7 +898,8 @@ void add_colles_for_group_MP2I(int* weeks_len, creneau* edt, int len_edt, colleu
}
if(!found && halt > weeks_len[week]) {
remaining_to_add--;
printf("Warning : skipping secondary colle for week %d and group %d\n", week+1, grp);
//printf("Warning : skipping secondary colle for week %d and group %d\n", week+1, grp);
*skip_count += 1;
}
r++;
halt++;
@ -1003,11 +1007,13 @@ void aux_2(creneau* edt, int len_edt, colleur* chads, int len_chads, int n_group
int max_score = 0;
int global_min = 0;
int global_skipped = 0;
int screwed_group = 0;
int local_score = 0;
int local_min = 0;
int local_group = 0;
int temp = 0;
int skipped = 0;
int a = n_sim/100;
for(int k = 0; k < n_sim*(1 - (max_score == n_groups*100)); k++) {
if(k >= a) {
@ -1018,9 +1024,11 @@ void aux_2(creneau* edt, int len_edt, colleur* chads, int len_chads, int n_group
}
local_score = 0;
local_min = 100;
skipped = 0;
for(int i = 0; i < n_groups; i++) {
//for(int i = 0; i < 1; i++) {
//rintf("Adding colles for group %d...\n", i+1);
add_colles_for_group_MP2I(weeks_len, edt, len_edt, chads, len_chads, n_weeks, i+1, (topic)(2+i%2), i%4,1+i%4);
add_colles_for_group_MP2I(weeks_len, edt, len_edt, chads, len_chads, n_weeks, i+1, (topic)(2+i%2), i%4,i%8, &skipped);
}
for(int i = 0; i < n_groups; i++) {
//printf("Score for group %d : %d\n", i+1, score(edt, len_edt, i+1));
@ -1031,10 +1039,12 @@ void aux_2(creneau* edt, int len_edt, colleur* chads, int len_chads, int n_group
local_group = i+1;
}
}
local_score -= skipped*35;
if(local_score > max_score) {
max_score = local_score;
screwed_group = local_group;
global_min = local_min;
global_skipped = skipped;
write_to_file("output.csv", edt, len_edt);
}
for(int r = 0; r < len_edt; r++) {
@ -1047,7 +1057,7 @@ void aux_2(creneau* edt, int len_edt, colleur* chads, int len_chads, int n_group
if(max_score == 100*n_groups) {
printf("Interrupting early due to a perfect score achieved\n");
} else {
printf("100 Completed, best score is %d/%d\n", max_score, 100*n_groups);
printf("100 Completed, best score is %d/%d with %d skipped colles\n", max_score, 100*n_groups, global_skipped);
printf("Most screwed group is %d with a score of %d/100\n", screwed_group, global_min);
}
int end = time(NULL);

View File

@ -286,4 +286,16 @@ void print_one_week(creneau* edt, int len_creneau, date start) { /*
}
updateRenderer(renderer);*/
//usleep(3000000);
}
void print_all_edt(creneau* edt, int len_edt, int n_weeks, int len_oneweek) {
for(int k = 0; k < n_weeks; k++) {
print_one_week(edt, len_edt, edt[k*len_oneweek].date);
}
}
void print_all_colleurs(colleur* chads, int n_chads) {
for(int c = 0; c < n_chads; c++) {
printf("Colleur %s with %d available :\n", chads[c].name, chads[c].n_disp);
}
}

16
main.c
View File

@ -7,20 +7,24 @@ int main() {
srand(time(NULL));
//creneau* edt = import_creneaux("file.txt", 76);
creneau* edt = import_creneaux_oneweek("file2.txt", 19, 4);
int len_creneau = 76;
creneau* edt = import_creneaux_oneweek("MP2I-creneaux.txt", 31, 6);
int len_edt = 31*6;
//colleur* dudes = import_colleurs("some_data.txt", 13, len_creneau);
colleur* dudes = import_colleurs_oneweek("some_file2.txt", 12, 4, 19);
int n_colleurs = 12;
colleur* dudes = import_colleurs_oneweek("MP2I-colleurs.txt", 16, 6, 31);
int n_colleurs = 16;
//print_all_edt(edt, len_edt, 6, 31);
//print_all_colleurs(dudes, n_colleurs);
//assert(0);
// {char* name; int namelen; topic mat; date* disp; int n_disp;} colleur;
/*int* a = malloc(sizeof(int)*10);
generate_random_perm(a, 10);
print_arr(a, 10);*/
aux_2(edt, len_creneau, dudes, n_colleurs, 7, 4, 3000);
aux_2(edt, len_edt, dudes, n_colleurs, 15, 6, 5000);
//generate_colles_v1(edt, len_creneau, dudes, n_colleurs, 9, 4);
//generate_colles_v1(edt, len_creneau, dudes, n_colleurs, 15, 4);

View File

@ -1,77 +1,187 @@
hour,day,month,year,length,group,colleur,matiere
12,5,2,2024,1,5,Le_Gourielec,Anglais
13,5,2,2024,1,2,Poupy,Physique
18,5,2,2024,1,6,Chevalier,Physique
17,6,2,2024,1,4,Carpintero,Maths
18,6,2,2024,1,7,Carpintero,Maths
14,7,2,2024,1,6,Rapin,Maths
14,7,2,2024,2,4,Jospin,Info
12,5,2,2024,1,2,Chevalier,Physique
12,5,2,2024,1,10,Chevalier,Physique
13,5,2,2024,1,15,Herbaut,Anglais
13,5,2,2024,1,3,Herbaut,Anglais
14,6,2,2024,1,1,Belaggoune,Anglais
14,6,2,2024,1,14,Chevalier,Physique
14,6,2,2024,1,10,Mullaert,Maths
17,6,2,2024,1,4,Chevalier,Physique
17,6,2,2024,1,8,Chevalier,Physique
18,6,2,2024,1,3,Rapin,Maths
13,7,2,2024,1,2,Carpintero,Maths
14,7,2,2024,1,5,Le_Gouriellec,Anglais
14,7,2,2024,1,7,Bouverot,Maths
14,7,2,2024,1,4,Carpintero,Maths
14,7,2,2024,1,6,Boully,Maths
14,7,2,2024,2,0,none,none
14,7,2,2024,2,0,none,none
15,7,2,2024,1,3,Carpintero,Maths
16,7,2,2024,1,3,Belaggoune,Anglais
17,7,2,2024,1,7,Le_Gourielec,Anglais
15,7,2,2024,1,8,Bouverot,Maths
15,7,2,2024,1,11,Boully,Maths
15,7,2,2024,1,0,none,none
16,7,2,2024,1,0,none,none
16,7,2,2024,2,8,Colleur_Dinfo,Info
17,7,2,2024,1,0,none,none
17,7,2,2024,1,0,none,none
18,7,2,2024,1,0,none,none
14,8,2,2024,1,0,none,none
15,8,2,2024,1,2,Mullaert,Maths
18,8,2,2024,1,4,Poupy,Physique
15,8,2,2024,1,0,none,none
18,8,2,2024,1,12,Rapin,Maths
18,8,2,2024,1,0,none,none
16,9,2,2024,1,0,none,none
17,9,2,2024,1,0,none,none
18,9,2,2024,1,0,none,none
12,12,2,2024,1,5,Chibani,Physique
13,12,2,2024,1,6,Mann,Anglais
18,12,2,2024,1,1,Chevalier,Physique
17,13,2,2024,1,7,Chevalier,Physique
18,13,2,2024,1,3,Chibani,Physique
14,14,2,2024,1,0,none,none
14,14,2,2024,2,3,Jospin,Info
14,14,2,2024,2,0,none,none
14,14,2,2024,2,7,Jospin,Info
15,14,2,2024,1,3,Boully,Maths
16,14,2,2024,1,4,Rapin,Maths
17,9,2,2024,1,14,Oubaha,Maths
18,9,2,2024,1,15,Oubaha,Maths
12,12,2,2024,1,3,Chevalier,Physique
12,12,2,2024,1,9,Chevalier,Physique
13,12,2,2024,1,14,Herbaut,Anglais
13,12,2,2024,1,2,Herbaut,Anglais
14,13,2,2024,1,4,Belaggoune,Anglais
14,13,2,2024,1,15,Chevalier,Physique
14,13,2,2024,1,5,Chevalier,Physique
17,13,2,2024,1,7,Colin,Physique
17,13,2,2024,1,13,Colin,Physique
18,13,2,2024,1,7,Rapin,Maths
13,14,2,2024,1,12,Carpintero,Maths
14,14,2,2024,1,6,Le_Gouriellec,Anglais
14,14,2,2024,1,8,Bouverot,Maths
14,14,2,2024,1,1,Carpintero,Maths
14,14,2,2024,1,3,Boully,Maths
14,14,2,2024,2,7,Colleur_Dinfo,Info
15,14,2,2024,1,4,Boully,Maths
15,14,2,2024,1,9,Bouverot,Maths
15,14,2,2024,1,0,none,none
16,14,2,2024,1,0,none,none
16,14,2,2024,2,15,Colleur_Dinfo,Info
17,14,2,2024,1,0,none,none
18,14,2,2024,1,5,Boully,Maths
14,15,2,2024,1,2,Belaggoune,Anglais
15,15,2,2024,1,1,Boully,Maths
18,15,2,2024,1,4,Belaggoune,Anglais
16,16,2,2024,1,7,Carpintero,Maths
17,16,2,2024,1,0,none,none
18,16,2,2024,1,0,none,none
12,19,2,2024,1,1,Belaggoune,Anglais
13,19,2,2024,1,4,Rapin,Maths
18,19,2,2024,1,2,Mullaert,Maths
17,20,2,2024,1,5,Boully,Maths
18,20,2,2024,1,6,Carpintero,Maths
14,21,2,2024,1,7,Herbaud,Anglais
14,21,2,2024,2,2,Jospin,Info
14,21,2,2024,2,6,Jospin,Info
14,21,2,2024,2,0,none,none
15,21,2,2024,1,2,Poupy,Physique
16,21,2,2024,1,5,Herbaud,Anglais
17,21,2,2024,1,3,Belaggoune,Anglais
18,21,2,2024,1,1,Rapin,Maths
14,22,2,2024,1,6,Chibani,Physique
17,14,2,2024,1,0,none,none
18,14,2,2024,1,0,none,none
14,15,2,2024,1,0,none,none
15,15,2,2024,1,0,none,none
18,15,2,2024,1,11,Rapin,Maths
18,15,2,2024,1,0,none,none
16,16,2,2024,1,0,none,none
17,16,2,2024,1,13,Oubaha,Maths
18,16,2,2024,1,15,Oubaha,Maths
12,19,2,2024,1,6,Chevalier,Physique
12,19,2,2024,1,8,Chevalier,Physique
13,19,2,2024,1,15,Herbaut,Anglais
13,19,2,2024,1,5,Herbaut,Anglais
14,20,2,2024,1,1,Mullaert,Maths
14,20,2,2024,1,10,Chevalier,Physique
14,20,2,2024,1,12,Chevalier,Physique
17,20,2,2024,1,14,Colin,Physique
17,20,2,2024,1,0,none,none
18,20,2,2024,1,5,Rapin,Maths
13,21,2,2024,1,6,Carpintero,Maths
14,21,2,2024,1,7,Le_Gouriellec,Anglais
14,21,2,2024,1,1,Le_Gouriellec,Anglais
14,21,2,2024,1,4,Carpintero,Maths
14,21,2,2024,1,2,Boully,Maths
14,21,2,2024,2,6,Colleur_Dinfo,Info
15,21,2,2024,1,8,Boully,Maths
15,21,2,2024,1,9,Bouverot,Maths
15,21,2,2024,1,0,none,none
16,21,2,2024,1,0,none,none
16,21,2,2024,2,14,Colleur_Dinfo,Info
17,21,2,2024,1,0,none,none
17,21,2,2024,1,0,none,none
18,21,2,2024,1,0,none,none
14,22,2,2024,1,0,none,none
15,22,2,2024,1,0,none,none
18,22,2,2024,1,4,Chevalier,Physique
18,22,2,2024,1,10,Rapin,Maths
18,22,2,2024,1,0,none,none
16,23,2,2024,1,0,none,none
17,23,2,2024,1,0,none,none
18,23,2,2024,1,0,none,none
12,26,2,2024,1,3,Poupy,Physique
13,26,2,2024,1,5,Chibani,Physique
18,26,2,2024,1,7,Rapin,Maths
17,27,2,2024,1,1,Chevalier,Physique
18,27,2,2024,1,3,Carpintero,Maths
14,28,2,2024,1,4,Herbaud,Anglais
14,28,2,2024,2,1,Jospin,Info
14,28,2,2024,2,5,Jospin,Info
14,28,2,2024,2,0,none,none
15,28,2,2024,1,5,Boully,Maths
16,28,2,2024,1,6,Mullaert,Maths
17,28,2,2024,1,7,Poupy,Physique
18,28,2,2024,1,2,Carpintero,Maths
14,29,2,2024,1,1,Mullaert,Maths
15,29,2,2024,1,2,Belaggoune,Anglais
18,29,2,2024,1,6,Herbaud,Anglais
17,23,2,2024,1,12,Oubaha,Maths
18,23,2,2024,1,13,Oubaha,Maths
12,26,2,2024,1,5,Chevalier,Physique
12,26,2,2024,1,7,Chevalier,Physique
13,26,2,2024,1,14,Herbaut,Anglais
13,26,2,2024,1,6,Herbaut,Anglais
14,27,2,2024,1,1,Chevalier,Physique
14,27,2,2024,1,15,Chevalier,Physique
14,27,2,2024,1,4,Belaggoune,Anglais
17,27,2,2024,1,3,Chevalier,Physique
17,27,2,2024,1,9,Colin,Physique
18,27,2,2024,1,3,Rapin,Maths
13,28,2,2024,1,7,Carpintero,Maths
14,28,2,2024,1,5,Carpintero,Maths
14,28,2,2024,1,1,Boully,Maths
14,28,2,2024,1,6,Bouverot,Maths
14,28,2,2024,1,8,Le_Gouriellec,Anglais
14,28,2,2024,2,5,Colleur_Dinfo,Info
15,28,2,2024,1,9,Boully,Maths
15,28,2,2024,1,10,Bouverot,Maths
15,28,2,2024,1,0,none,none
16,28,2,2024,1,0,none,none
16,28,2,2024,2,13,Colleur_Dinfo,Info
17,28,2,2024,1,0,none,none
17,28,2,2024,1,0,none,none
18,28,2,2024,1,0,none,none
14,29,2,2024,1,0,none,none
15,29,2,2024,1,0,none,none
18,29,2,2024,1,11,Rapin,Maths
18,29,2,2024,1,0,none,none
16,1,3,2024,1,0,none,none
17,1,3,2024,1,0,none,none
18,1,3,2024,1,0,none,none
17,1,3,2024,1,13,Oubaha,Maths
18,1,3,2024,1,14,Oubaha,Maths
12,4,3,2024,1,12,Chevalier,Physique
12,4,3,2024,1,6,Chevalier,Physique
13,4,3,2024,1,15,Herbaut,Anglais
13,4,3,2024,1,11,Herbaut,Anglais
14,5,3,2024,1,4,Chevalier,Physique
14,5,3,2024,1,14,Chevalier,Physique
14,5,3,2024,1,7,Mullaert,Maths
17,5,3,2024,1,0,none,none
17,5,3,2024,1,0,none,none
18,5,3,2024,1,2,Rapin,Maths
13,6,3,2024,1,8,Carpintero,Maths
14,6,3,2024,1,3,Bouverot,Maths
14,6,3,2024,1,3,Le_Gouriellec,Anglais
14,6,3,2024,1,9,Le_Gouriellec,Anglais
14,6,3,2024,1,6,Boully,Maths
14,6,3,2024,2,4,Colleur_Dinfo,Info
15,6,3,2024,1,4,Bouverot,Maths
15,6,3,2024,1,10,Boully,Maths
15,6,3,2024,1,0,none,none
16,6,3,2024,1,0,none,none
16,6,3,2024,2,12,Colleur_Dinfo,Info
17,6,3,2024,1,0,none,none
17,6,3,2024,1,0,none,none
18,6,3,2024,1,0,none,none
14,7,3,2024,1,0,none,none
15,7,3,2024,1,0,none,none
18,7,3,2024,1,11,Rapin,Maths
18,7,3,2024,1,0,none,none
16,8,3,2024,1,0,none,none
17,8,3,2024,1,12,Oubaha,Maths
18,8,3,2024,1,14,Oubaha,Maths
12,11,3,2024,1,5,Chevalier,Physique
12,11,3,2024,1,9,Chevalier,Physique
13,11,3,2024,1,14,Herbaut,Anglais
13,11,3,2024,1,8,Herbaut,Anglais
14,12,3,2024,1,1,Mullaert,Maths
14,12,3,2024,1,11,Chevalier,Physique
14,12,3,2024,1,12,Belaggoune,Anglais
17,12,3,2024,1,15,Colin,Physique
17,12,3,2024,1,13,Chevalier,Physique
18,12,3,2024,1,3,Rapin,Maths
13,13,3,2024,1,4,Carpintero,Maths
14,13,3,2024,1,4,Le_Gouriellec,Anglais
14,13,3,2024,1,5,Carpintero,Maths
14,13,3,2024,1,7,Boully,Maths
14,13,3,2024,1,8,Bouverot,Maths
14,13,3,2024,2,3,Colleur_Dinfo,Info
15,13,3,2024,1,9,Bouverot,Maths
15,13,3,2024,1,11,Boully,Maths
15,13,3,2024,1,0,none,none
16,13,3,2024,1,0,none,none
16,13,3,2024,2,11,Colleur_Dinfo,Info
17,13,3,2024,1,0,none,none
17,13,3,2024,1,0,none,none
18,13,3,2024,1,0,none,none
14,14,3,2024,1,0,none,none
15,14,3,2024,1,0,none,none
18,14,3,2024,1,12,Rapin,Maths
18,14,3,2024,1,0,none,none
16,15,3,2024,1,0,none,none
17,15,3,2024,1,13,Oubaha,Maths
18,15,3,2024,1,15,Oubaha,Maths

1 hour day month year length group colleur matiere
2 12 5 2 2024 1 5 2 Le_Gourielec Chevalier Anglais Physique
3 13 12 5 2 2024 1 2 10 Poupy Chevalier Physique
4 18 13 5 2 2024 1 6 15 Chevalier Herbaut Physique Anglais
5 17 13 6 5 2 2024 1 4 3 Carpintero Herbaut Maths Anglais
6 18 14 6 2 2024 1 7 1 Carpintero Belaggoune Maths Anglais
7 14 7 6 2 2024 1 6 14 Rapin Chevalier Maths Physique
8 14 7 6 2 2024 2 1 4 10 Jospin Mullaert Info Maths
9 17 6 2 2024 1 4 Chevalier Physique
10 17 6 2 2024 1 8 Chevalier Physique
11 18 6 2 2024 1 3 Rapin Maths
12 13 7 2 2024 1 2 Carpintero Maths
13 14 7 2 2024 1 5 Le_Gouriellec Anglais
14 14 7 2 2024 1 7 Bouverot Maths
15 14 7 2 2024 1 4 Carpintero Maths
16 14 7 2 2024 1 6 Boully Maths
17 14 7 2 2024 2 0 none none
18 14 15 7 2 2024 2 1 0 8 none Bouverot none Maths
19 15 7 2 2024 1 3 11 Carpintero Boully Maths
20 16 15 7 2 2024 1 3 0 Belaggoune none Anglais none
21 17 16 7 2 2024 1 7 0 Le_Gourielec none Anglais none
22 16 7 2 2024 2 8 Colleur_Dinfo Info
23 17 7 2 2024 1 0 none none
24 17 7 2 2024 1 0 none none
25 18 7 2 2024 1 0 none none
26 14 8 2 2024 1 0 none none
27 15 8 2 2024 1 2 0 Mullaert none Maths none
28 18 8 2 2024 1 4 12 Poupy Rapin Physique Maths
29 18 8 2 2024 1 0 none none
30 16 9 2 2024 1 0 none none
31 17 9 2 2024 1 0 14 none Oubaha none Maths
32 18 9 2 2024 1 0 15 none Oubaha none Maths
33 12 12 2 2024 1 5 3 Chibani Chevalier Physique
34 13 12 12 2 2024 1 6 9 Mann Chevalier Anglais Physique
35 18 13 12 2 2024 1 1 14 Chevalier Herbaut Physique Anglais
36 17 13 13 12 2 2024 1 7 2 Chevalier Herbaut Physique Anglais
37 18 14 13 2 2024 1 3 4 Chibani Belaggoune Physique Anglais
38 14 14 13 2 2024 1 0 15 none Chevalier none Physique
39 14 14 13 2 2024 2 1 3 5 Jospin Chevalier Info Physique
40 14 17 14 13 2 2024 2 1 0 7 none Colin none Physique
41 14 17 14 13 2 2024 2 1 7 13 Jospin Colin Info Physique
42 15 18 14 13 2 2024 1 3 7 Boully Rapin Maths
43 16 13 14 2 2024 1 4 12 Rapin Carpintero Maths
44 14 14 2 2024 1 6 Le_Gouriellec Anglais
45 14 14 2 2024 1 8 Bouverot Maths
46 14 14 2 2024 1 1 Carpintero Maths
47 14 14 2 2024 1 3 Boully Maths
48 14 14 2 2024 2 7 Colleur_Dinfo Info
49 15 14 2 2024 1 4 Boully Maths
50 15 14 2 2024 1 9 Bouverot Maths
51 15 14 2 2024 1 0 none none
52 16 14 2 2024 1 0 none none
53 16 14 2 2024 2 15 Colleur_Dinfo Info
54 17 14 2 2024 1 0 none none
55 18 17 14 2 2024 1 5 0 Boully none Maths none
56 14 18 15 14 2 2024 1 2 0 Belaggoune none Anglais none
57 15 14 15 2 2024 1 1 0 Boully none Maths none
58 18 15 15 2 2024 1 4 0 Belaggoune none Anglais none
59 16 18 16 15 2 2024 1 7 11 Carpintero Rapin Maths
60 17 18 16 15 2 2024 1 0 none none
61 18 16 16 2 2024 1 0 none none
62 12 17 19 16 2 2024 1 1 13 Belaggoune Oubaha Anglais Maths
63 13 18 19 16 2 2024 1 4 15 Rapin Oubaha Maths
64 18 12 19 2 2024 1 2 6 Mullaert Chevalier Maths Physique
65 17 12 20 19 2 2024 1 5 8 Boully Chevalier Maths Physique
66 18 13 20 19 2 2024 1 6 15 Carpintero Herbaut Maths Anglais
67 14 13 21 19 2 2024 1 7 5 Herbaud Herbaut Anglais
68 14 21 20 2 2024 2 1 2 1 Jospin Mullaert Info Maths
69 14 21 20 2 2024 2 1 6 10 Jospin Chevalier Info Physique
70 14 21 20 2 2024 2 1 0 12 none Chevalier none Physique
71 15 17 21 20 2 2024 1 2 14 Poupy Colin Physique
72 16 17 21 20 2 2024 1 5 0 Herbaud none Anglais none
73 17 18 21 20 2 2024 1 3 5 Belaggoune Rapin Anglais Maths
74 18 13 21 2 2024 1 1 6 Rapin Carpintero Maths
75 14 22 21 2 2024 1 6 7 Chibani Le_Gouriellec Physique Anglais
76 14 21 2 2024 1 1 Le_Gouriellec Anglais
77 14 21 2 2024 1 4 Carpintero Maths
78 14 21 2 2024 1 2 Boully Maths
79 14 21 2 2024 2 6 Colleur_Dinfo Info
80 15 21 2 2024 1 8 Boully Maths
81 15 21 2 2024 1 9 Bouverot Maths
82 15 21 2 2024 1 0 none none
83 16 21 2 2024 1 0 none none
84 16 21 2 2024 2 14 Colleur_Dinfo Info
85 17 21 2 2024 1 0 none none
86 17 21 2 2024 1 0 none none
87 18 21 2 2024 1 0 none none
88 14 22 2 2024 1 0 none none
89 15 22 2 2024 1 0 none none
90 18 22 2 2024 1 4 10 Chevalier Rapin Physique Maths
91 18 22 2 2024 1 0 none none
92 16 23 2 2024 1 0 none none
93 17 23 2 2024 1 0 12 none Oubaha none Maths
94 18 23 2 2024 1 0 13 none Oubaha none Maths
95 12 26 2 2024 1 3 5 Poupy Chevalier Physique
96 13 12 26 2 2024 1 5 7 Chibani Chevalier Physique
97 18 13 26 2 2024 1 7 14 Rapin Herbaut Maths Anglais
98 17 13 27 26 2 2024 1 1 6 Chevalier Herbaut Physique Anglais
99 18 14 27 2 2024 1 3 1 Carpintero Chevalier Maths Physique
100 14 28 27 2 2024 1 4 15 Herbaud Chevalier Anglais Physique
101 14 28 27 2 2024 2 1 1 4 Jospin Belaggoune Info Anglais
102 14 17 28 27 2 2024 2 1 5 3 Jospin Chevalier Info Physique
103 14 17 28 27 2 2024 2 1 0 9 none Colin none Physique
104 15 18 28 27 2 2024 1 5 3 Boully Rapin Maths
105 16 13 28 2 2024 1 6 7 Mullaert Carpintero Maths
106 17 14 28 2 2024 1 7 5 Poupy Carpintero Physique Maths
107 18 14 28 2 2024 1 2 1 Carpintero Boully Maths
108 14 29 28 2 2024 1 1 6 Mullaert Bouverot Maths
109 15 14 29 28 2 2024 1 2 8 Belaggoune Le_Gouriellec Anglais
110 18 14 29 28 2 2024 1 2 6 5 Herbaud Colleur_Dinfo Anglais Info
111 15 28 2 2024 1 9 Boully Maths
112 15 28 2 2024 1 10 Bouverot Maths
113 15 28 2 2024 1 0 none none
114 16 28 2 2024 1 0 none none
115 16 28 2 2024 2 13 Colleur_Dinfo Info
116 17 28 2 2024 1 0 none none
117 17 28 2 2024 1 0 none none
118 18 28 2 2024 1 0 none none
119 14 29 2 2024 1 0 none none
120 15 29 2 2024 1 0 none none
121 18 29 2 2024 1 11 Rapin Maths
122 18 29 2 2024 1 0 none none
123 16 1 3 2024 1 0 none none
124 17 1 3 2024 1 0 13 none Oubaha none Maths
125 18 1 3 2024 1 0 14 none Oubaha none Maths
126 12 4 3 2024 1 12 Chevalier Physique
127 12 4 3 2024 1 6 Chevalier Physique
128 13 4 3 2024 1 15 Herbaut Anglais
129 13 4 3 2024 1 11 Herbaut Anglais
130 14 5 3 2024 1 4 Chevalier Physique
131 14 5 3 2024 1 14 Chevalier Physique
132 14 5 3 2024 1 7 Mullaert Maths
133 17 5 3 2024 1 0 none none
134 17 5 3 2024 1 0 none none
135 18 5 3 2024 1 2 Rapin Maths
136 13 6 3 2024 1 8 Carpintero Maths
137 14 6 3 2024 1 3 Bouverot Maths
138 14 6 3 2024 1 3 Le_Gouriellec Anglais
139 14 6 3 2024 1 9 Le_Gouriellec Anglais
140 14 6 3 2024 1 6 Boully Maths
141 14 6 3 2024 2 4 Colleur_Dinfo Info
142 15 6 3 2024 1 4 Bouverot Maths
143 15 6 3 2024 1 10 Boully Maths
144 15 6 3 2024 1 0 none none
145 16 6 3 2024 1 0 none none
146 16 6 3 2024 2 12 Colleur_Dinfo Info
147 17 6 3 2024 1 0 none none
148 17 6 3 2024 1 0 none none
149 18 6 3 2024 1 0 none none
150 14 7 3 2024 1 0 none none
151 15 7 3 2024 1 0 none none
152 18 7 3 2024 1 11 Rapin Maths
153 18 7 3 2024 1 0 none none
154 16 8 3 2024 1 0 none none
155 17 8 3 2024 1 12 Oubaha Maths
156 18 8 3 2024 1 14 Oubaha Maths
157 12 11 3 2024 1 5 Chevalier Physique
158 12 11 3 2024 1 9 Chevalier Physique
159 13 11 3 2024 1 14 Herbaut Anglais
160 13 11 3 2024 1 8 Herbaut Anglais
161 14 12 3 2024 1 1 Mullaert Maths
162 14 12 3 2024 1 11 Chevalier Physique
163 14 12 3 2024 1 12 Belaggoune Anglais
164 17 12 3 2024 1 15 Colin Physique
165 17 12 3 2024 1 13 Chevalier Physique
166 18 12 3 2024 1 3 Rapin Maths
167 13 13 3 2024 1 4 Carpintero Maths
168 14 13 3 2024 1 4 Le_Gouriellec Anglais
169 14 13 3 2024 1 5 Carpintero Maths
170 14 13 3 2024 1 7 Boully Maths
171 14 13 3 2024 1 8 Bouverot Maths
172 14 13 3 2024 2 3 Colleur_Dinfo Info
173 15 13 3 2024 1 9 Bouverot Maths
174 15 13 3 2024 1 11 Boully Maths
175 15 13 3 2024 1 0 none none
176 16 13 3 2024 1 0 none none
177 16 13 3 2024 2 11 Colleur_Dinfo Info
178 17 13 3 2024 1 0 none none
179 17 13 3 2024 1 0 none none
180 18 13 3 2024 1 0 none none
181 14 14 3 2024 1 0 none none
182 15 14 3 2024 1 0 none none
183 18 14 3 2024 1 12 Rapin Maths
184 18 14 3 2024 1 0 none none
185 16 15 3 2024 1 0 none none
186 17 15 3 2024 1 13 Oubaha Maths
187 18 15 3 2024 1 15 Oubaha Maths

View File

@ -360,26 +360,22 @@ creneau* import_creneaux_oneweek(char* filename, int len_file, int n_weeks) {
return edt;
}
void expand(colleur* guy, int id, int n_horaires, int n_weeks) {
date* horaires = guy[id].disp;
date* res = malloc(sizeof(date)*n_horaires*n_weeks);
for (int i = 0; i < n_horaires; i++) {
res[i] = horaires[i];
void expand(colleur* guy, int id, int n_weeks) {
int len_1st = guy[id].n_disp;
date* new = malloc(sizeof(date)*len_1st*n_weeks);
for(int b = 0; b < len_1st; b++) {
new[b] = guy[id].disp[b];
}
for(int k = 1; k < n_weeks; k++) {
for(int i = 0; i < n_horaires; i++) {
res[k*n_horaires+i] = increment_date(res[i], 7*k);
for(int week = 1; week < n_weeks; week++) {
for(int i = 0; i < len_1st; i++) {
new[week*len_1st+i] = increment_date(guy[id].disp[i], 7*week);
}
}
/*for(int i = 0; i < n_horaires*n_weeks; i++) {
printf("%d %d %d %d\n", res[i].hour, res[i].day, res[i].month, res[i].year);
}
printf("\n\n");*/
free(guy[id].disp);
guy[id].disp = res;
guy[id].n_disp = n_weeks*n_horaires;
guy[id].n_disp *= n_weeks;
guy[id].disp = new;
}
colleur* import_colleurs_oneweek(char* filename, int n_colleurs, int n_weeks, int len_oneweek) {
@ -464,7 +460,7 @@ colleur* import_colleurs_oneweek(char* filename, int n_colleurs, int n_weeks, in
// {char* name; int namelen; topic mat; date* disp; int n_disp;}
for(int c = 0; c < n_colleurs; c++) {
expand(res, c, len_oneweek, n_weeks);
expand(res, c, n_weeks);
}
printf("Imported colleurs with no problems\n");