fixed some random seg fault
This commit is contained in:
parent
80d4ec4ef0
commit
c59f0e9a51
|
@ -321,16 +321,16 @@ bool is_allowed_MP2I(creneau* edt, int len_edt, int grp, date end) {
|
|||
// Detect colles
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
int heuristique_MP2I(creneau* edt,int len_edt, int grp, date end) {
|
||||
/*
|
||||
|
||||
A - Both colles end at 7PM : -10
|
||||
B - Having the same colleur two weeks in a row : -45
|
||||
C - Having the same colleur at a 3w interval : -25
|
||||
D - Having the same colleur at a 4w interval : -10
|
||||
E - Two colles the same day : -20
|
||||
F - Same date over 2 weeks : -20
|
||||
*/
|
||||
|
||||
int end_id = get_next_friday(edt, len_edt, end); // index of first date that is later than end
|
||||
|
||||
if(end_id == -1) {
|
||||
|
@ -444,7 +444,7 @@ int heuristique_MP2I(creneau* edt,int len_edt, int grp, date end) {
|
|||
free(temp);
|
||||
return score;
|
||||
}
|
||||
|
||||
*/
|
||||
// typedef struct colleur {char* name; int namelen; topic mat; date* disp; int n_disp;} colleur;
|
||||
colleur* get_colleurs(colleur* cl, int len_cl, date d, int* how_many) {
|
||||
colleur* res = malloc(sizeof(colleur)*30); // max. 3 colles per creneau
|
||||
|
|
|
@ -34,7 +34,7 @@ int get_fst_offset(creneau* edt, date d);
|
|||
|
||||
//bool is_allowed_MP2I(creneau* edt, int len_edt, int grp, date end);
|
||||
|
||||
int heuristique_MP2I(creneau* edt, int len_edt, int grp, date end);
|
||||
//int heuristique_MP2I(creneau* edt, int len_edt, int grp, date end);
|
||||
|
||||
colleur *get_colleurs(colleur *cl, int len_cl, date d, int *how_many);
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ int main(int argc, char **argv) {
|
|||
char* path_creneaux = argv[1+offset];
|
||||
int n_creneaux = str_to_int(argv[2+offset]);
|
||||
char* path_colleurs = argv[3+offset];
|
||||
int n_colleurs = str_to_int(argv[6+offset]);
|
||||
int n_colleurs = str_to_int(argv[4+offset]);
|
||||
int n_weeks = str_to_int(argv[5+offset]);
|
||||
int n_groups = str_to_int(argv[6+offset]);
|
||||
char* path_output = argv[7+offset];
|
||||
|
@ -110,7 +110,7 @@ int main(int argc, char **argv) {
|
|||
int len_edt = n_creneaux*n_weeks;
|
||||
|
||||
//colleur* dudes = import_colleurs("some_data.txt", 13, len_creneau);
|
||||
colleur* dudes = import_colleurs_oneweek(path_colleurs, 16, 6, 33);
|
||||
colleur* dudes = import_colleurs_oneweek(path_colleurs, n_colleurs, n_weeks, n_creneaux);
|
||||
|
||||
aux_2(edt, len_edt, dudes, n_colleurs, n_groups, n_weeks, 5000, path_output);
|
||||
|
||||
|
|
Loading…
Reference in New Issue