Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static Relation initialisationResponsable(){
- Relation relation = new Relation(PROFESSEURS, OPTIONS);
- for(Elt option : OPTIONS){
- Ensemble lesCours = COMPREND.imageDirecte(option);
- int[] influence = new int[NB_INDIV+1];
- for(Elt cours : lesCours){
- Ensemble ects1 = ECTS.imageDirecte(cours);
- int ects = ects1.unElement().val();
- Ensemble profs = INTERV.imageReciproque(cours);
- for(Elt prof : profs){
- influence[prof.val()] += ects;
- }
- }
- Ensemble responsable = new Ensemble();
- int temp = 0;
- for (int i = 1; i < influence.length; i++) {
- if(influence[i] > temp){
- responsable = new Ensemble();
- responsable.ajouter(new Elt(i));
- temp = influence[i];
- }else if(influence[i] == temp){
- responsable.ajouter(new Elt(i));
- }
- }
- for(Elt elt : responsable){
- System.out.println(elt);
- relation.ajouter(new Couple(elt, option));
- }
- System.out.println("");
- }
- return relation;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement