Preamble Last Column is 132 Normally Mode is undefined ... Permanent Entities ........ Every Classe has a Moyenne.Service, a Taux.Moyen, a Inter.Arrivee, a Proportion, a Temps.Service, a Temps.Attente Define Moyenne.Service, Taux.Moyen, Inter.Arrivee, Temps.Service, Proportion, Temps.Attente as real variables Resources ............ Every Cpu has a Numero Define Numero as an integer variable Processes ........... Every Generateur.Arrivee has a No.Classe Define No.Classe as an integer variable Every Tache has a Tk.Classe, a Tk.Priorite Define Tk.Classe, Tk.Priorite as integer variable Event include Fin.Simulation '' Déclaration des fonctions Define Choix.F as an Integer Function with 0 arguments The system has a Distr.Classe random step variable Define Distr.Classe as an integer stream 9 variable '' Declaration des variables statistiques Tally moy.Attente as the mean, min.Attente as the minimum, max.Attente as the maximum of Temps.Attente Tally moy.Temps.Execution as the mean of Temps.Service Accumulate Pour.Utilisation as the mean of N.X.Cpu Define Forever to mean While ( 1 = 1 ) end '' Preamble Main Call Initialiser for each Classe, do Activate a Generateur.Arrivee ( Classe ) now loop Schedule a Fin.Simulation in 720 Minutes Start Simulation end '' Main Routine Initialiser Define Prop as an integer variable use 10 for input Read N.Classe Create All Classe print 2 line thus Classe Moy Taux Prop. Inter Serv Moyen Arrivée For Each Classe, Do start new input record Read Moyenne.Service(Classe), Taux.Moyen(Classe), Proportion(Classe) Inter.Arrivee (Classe ) = 1.0 / Taux.Moyen(Classe) Print 1 line with Classe, Moyenne.Service(Classe), Taux.Moyen(Classe), Proportion(Classe), Inter.Arrivee (Classe ) thus * ****.*** ****.**** ***.**** ***.**** write Proportion(Classe), Classe as D ( 5, 3), I 5 using the buffer loop write as " * " using the buffer read Distr.Classe using the buffer skip 3 lines Print 1 line thus Prob Classe for each Prop in Distr.Classe do print 1 line with Prob.A(Prop), IValue.A(Prop) thus ****.*** ****** loop start new input record Read N.Cpu print 1 line with N.Cpu thus le nombre de cpu est **** Create all Cpu for each Cpu, do let U.Cpu(Cpu) = 1.0 let Numero ( Cpu ) = Cpu loop use 05 for input end '' Initialiser Process Tache ( No.Classe, Priorite ) Define No.Classe, Priorite as integer variable Define Temps.Arrivee as a real variable Define Le.Cpu as an integer variable for each cpu with u.Cpu(Cpu) > 0 find the first case if found, Le.Cpu = Cpu else Le.Cpu = Choix.F endif Temps.Arrivee = Time.V request 1 Cpu(Le.Cpu) with priority Priorite Temps.Attente(No.Classe) = Time.V - Temps.Arrivee Temps.Arrivee = Time.V Work Exponential.F ( Moyenne.Service (No.Classe), No.Classe) Minutes Temps.Service ( No.Classe ) = Time.V - Temps.Arrivee relinquish 1 Cpu(Le.Cpu) end '' Tache Process Generateur.Arrivee ( No.Classe ) Define No.Classe as an integer variable Forever Do Wait Exponential.F ( Inter.Arrivee (No.Classe), 5 ) Minutes Activate a Tache ( No.Classe, N.Classe - No.Classe) Now Loop end ''Generateur.Arrivee Function Choix.F return with int.F( Uniform.F ( 1.0, N.Cpu, 10)) End '' Choix.F Event Fin.Simulation print 1 line thus Moyenne Minimum Maximum Ex. moyenne for each Classe, do print 1 line with moy.Attente * Hours.v * Minutes.V, min.Attente * Hours.v * Minutes.V, max.Attente * Hours.v * Minutes.V, moy.Temps.Execution * Hours.v * Minutes. thus ****.*** ****.*** ****.*** ****.**** loop for each cpu do print 1 line with cpu, Pour.Utilisation(cpu) thus * ****.**** loop read as / Stop end ''Fin.Simulation