override public void EndPassExchange(Tram tram, int pin, int pout, bool iterate)
 {
     tram.busy = false;
     tram.tramActivitylog.WriteLine(Time.Now().ToString() + " , EndPassExchange , " + Name);
     tram.changePass(pin, pout);
     if (iterate)
     {
         ItPassEmbarking(tram);
     }
     else
     {
         logWaitingtime.WriteLine(Time.Now() + " , " + transferPassWaitStart.ToString() + " , " + (Time.Now() - lastDeparture).ToString()
                                  + " , " + transferPassNew + " , " + (Time.Now() - transferTimeLast).ToString() + "  , " + PassWaiting);
         new StartTransit(Time.Now(), tram, this, 0);
     }
 }
/*
 *      Tram Recruitment/retiring
 */
        private bool TramRetire(Tram tram)
        {
            if (depot != null)            //wrong endstation
            {
                if (((Time.Now() >= RetireTime) && (firstOpenPos() == -1)) || NextDeparture() == -1)
                {
                    RemoveTram(tram);
                    int i = 0;
                    while (i < depot.Length)
                    {
                        if (depot[i] == null)
                        {
                            EventList.checkForTram(tram);
                            int pout = PassDepart(tram.PassCurr);
                            TotalOut += pout;
                            tram.changePass(0, pout);
                            if (Simulation.EXPLICIT)
                            {
                                Console.WriteLine("Retired tram to depot");
                            }
                            depot[i] = tram;


                            tram.tramActivitylog.WriteLine(Time.Now().ToString() + " , Retired , " + Name);
                            tram.indepot = true;
                            return(true);
                        }
                        i++;
                    }
                }

/*          This was an idea, but not really necessary, since it ends after the even this belongs to is done anyhow.
 *          bool full = true;
 *          for (int i = 0; i < depot.Length; i++) {
 *              if (depot[i] == null) { full = false; break; }
 *          }
 *          if (full) //Find some way to end simulation from here...
 */
            }
            return(false);
        }
 override public void EndPassExchange(Tram tram, int pin, int pout, bool iterate)
 {
     tram.changePass(pin, pout);
     tram.tramActivitylog.WriteLine(Time.Now().ToString() + " , EndPassExchange , " + Name);
     if (Simulation.EXPLICIT)
     {
         Console.WriteLine("ending passenger exchange");
     }
     if (iterate)
     {
         ItPassEmbarking(tram);
     }
     else
     {
         tramloading        = false;
         tram.busy          = true;
         tram.cameFromDepot = false;
         tram.hasloaded     = true;
         logWaitingtime.WriteLine(Time.Now() + " , " + transferPassWaitStart.ToString() + " , " + (Time.Now() - lastDeparture).ToString()
                                  + " , " + transferPassNew + " , " + (Time.Now() - transferTimeLast).ToString() + "  , " + PassWaiting);
         planDeparture(tram);
     }
 }
/*
        Tram Recruitment/retiring
*/
	    private bool TramRetire (Tram tram) { 
		    if (depot != null ) { //wrong endstation
                if ( ( (Time.Now() >= RetireTime ) && (firstOpenPos()  == -1) ) || NextDeparture() == -1) {
        		    RemoveTram (tram);
				    int i = 0;
				    while ( i < depot.Length ) {
					    if (depot[i] == null) {
                            EventList.checkForTram(tram);
                            int pout = PassDepart(tram.PassCurr );
                            TotalOut += pout;
                            tram.changePass(0, pout);
                            if(Simulation.EXPLICIT) Console.WriteLine("Retired tram to depot");
						    depot[i] = tram;
                            
                            
                            tram.tramActivitylog.WriteLine(Time.Now().ToString() + " , Retired , " + Name);
                            tram.indepot = true;
						    return true;
					    }
					    i++;
				    }
			    }   
            
/*          This was an idea, but not really necessary, since it ends after the even this belongs to is done anyhow.
            bool full = true;
            for (int i = 0; i < depot.Length; i++) {
                if (depot[i] == null) { full = false; break; }
            }
            if (full) //Find some way to end simulation from here...
*/
            }            
		    return false;
    	}
	    override public void EndPassExchange(Tram tram, int pin, int pout, bool iterate) {
            tram.changePass(pin , pout);
            tram.tramActivitylog.WriteLine(Time.Now().ToString() + " , EndPassExchange , " + Name);
            if(Simulation.EXPLICIT) Console.WriteLine("ending passenger exchange");
    	    if (iterate) { ItPassEmbarking(tram); }
            else {  
                tramloading = false;
                tram.busy = true;
                tram.cameFromDepot = false;
                tram.hasloaded = true;
                logWaitingtime.WriteLine(Time.Now() + " , " + transferPassWaitStart.ToString() + " , " + (Time.Now() - lastDeparture).ToString() 
                                         + " , " + transferPassNew + " , "  + (Time.Now() - transferTimeLast).ToString() + "  , " + PassWaiting );
                planDeparture(tram); 
            }  
	    }
        override public void EndPassExchange(Tram tram, int pin, int pout, bool iterate) {
            tram.busy = false;
            tram.tramActivitylog.WriteLine(Time.Now().ToString() + " , EndPassExchange , " + Name);
            tram.changePass(pin , pout);
	        if (iterate) ItPassEmbarking(tram);
            else {
                logWaitingtime.WriteLine(Time.Now() + " , " + transferPassWaitStart.ToString() + " , " + (Time.Now() - lastDeparture).ToString() 
                                         + " , " + transferPassNew + " , "  + (Time.Now() - transferTimeLast).ToString() + "  , " + PassWaiting );
                new StartTransit(Time.Now(), tram, this, 0);    
            }
        }