Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. private static Relation initialisationResponsable(){
  2.  
  3. Relation relation = new Relation(PROFESSEURS, OPTIONS);
  4.  
  5. for(Elt option : OPTIONS){
  6.  
  7. Ensemble lesCours = COMPREND.imageDirecte(option);
  8. int[] influence = new int[NB_INDIV+1];
  9. for(Elt cours : lesCours){
  10. Ensemble ects1 = ECTS.imageDirecte(cours);
  11. int ects = ects1.unElement().val();
  12. Ensemble profs = INTERV.imageReciproque(cours);
  13.  
  14. for(Elt prof : profs){
  15. influence[prof.val()] += ects;
  16. }
  17.  
  18. }
  19.  
  20. Ensemble responsable = new Ensemble();
  21. int temp = 0;
  22. for (int i = 1; i < influence.length; i++) {
  23. if(influence[i] > temp){
  24. responsable = new Ensemble();
  25. responsable.ajouter(new Elt(i));
  26. temp = influence[i];
  27. }else if(influence[i] == temp){
  28. responsable.ajouter(new Elt(i));
  29. }
  30. }
  31.  
  32. for(Elt elt : responsable){
  33. System.out.println(elt);
  34. relation.ajouter(new Couple(elt, option));
  35. }
  36. System.out.println("");
  37.  
  38. }
  39.  
  40. return relation;
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement