public void decaller(List <Piste> listPConcerned) { double min = 50000; int temp = 0; Occupation Otemp = new Occupation(); System.Diagnostics.Debug.WriteLine("la premiere piste re-bouclée :" + listPConcerned[0].longueur); for (int i = 0; i < listPConcerned.Count; i++) { System.Diagnostics.Debug.WriteLine("la " + i + "ème piste re-bouclée :" + listPConcerned[i].longueur); if (!Utilitaires.checkPisteLongueur(this, listPConcerned[i])) { continue; //tsy mety aminy ilay piste eeh , miova piste } else if (listPConcerned[i].tempsMisyAvion == null) //raha tsy bola nisy nampiasa ilay piste { if (!Utilitaires.checkPisteLongueur(this, listPConcerned[i])) //raha tsy antonina azy ihany anefa ilay piste de miova piste { continue; } else //raha antonina azy kosa ilay piste tsy mbola nisy nampiasa { this.id_piste = listPConcerned[i].id_piste; Otemp = new Occupation(listPConcerned[i].id_piste, this.id_Vol, this.dateProbableArrivee, this.dateProbableArrivee.AddHours(listPConcerned[i].Degagement)); temp = i; break; } } else //Raha sady antonina ilay piste no efa nisy nampiasa tany aloha { //Alaina ny occupation farany anatinle tempsMisyAvion anle piste concerned Occupation farany = listPConcerned[i].tempsMisyAvion.Last(); for (int j = 0; j < listPConcerned[i].tempsMisyAvion.Count; j++) { System.Diagnostics.Debug.WriteLine("vol décalée pour le vol :" + this.id_Vol + "à la piste " + listPConcerned[i].id_piste + " - " + listPConcerned[i].tempsMisyAvion[j].debut_occupation + " - " + listPConcerned[i].tempsMisyAvion[j].fin_occupation); } double decallage = (farany.fin_occupation - this.dateProbableArrivee).TotalMinutes; if (decallage < min) //Iny ndray ny min vaovao anle volpiste satria inferieur amle teo aloha ny attente { min = decallage; this.id_piste = listPConcerned[i].id_piste; Otemp = new Occupation(listPConcerned[i].id_piste, this.id_Vol, farany.fin_occupation, farany.fin_occupation.AddHours(listPConcerned[i].Degagement)); temp = i; //indice anle piste this.decalage = min; } } } listPConcerned[temp].tempsMisyAvion = new List <Occupation>(); listPConcerned[temp].tempsMisyAvion.Add(Otemp); }