MECH 3550 Simulation Visualization Building Complex Systems Flow
MECH 3550 : Simulation & Visualization Building Complex Systems
Flow Chart for a Complex System Function end_CPU_run Remove job from CPU Does job require more CPU time? Yes No Place job at end of queue Compute response time of job and gather statistics Invoke start_CPU_run Schedule an arrival event for the terminal of this job Add 1 to the number of jobs processed Schedule an endsimulation even immediately Yes Are enough jobs done? No Are there any jobs in the queue? Yes Invoke start_CPU_run Return No
Arrive Depart Flow Charts for a Bank Yes Function arrive Function depart Schedule the next arrival event No Is a teller idle? Tally a delay of 0 for this customer Find the number, shortest_queue, of the leftmost shortest queue Make the teller busy Place the customer at the end of queue number shortest_queue Yes Is the queue for this teller idle? No Remove the first customer from this queue Make this teller idle Compute this customer’s delay and gather statistics Schedule a departure event for this customer Return Invoke jockey Return
Flow Chart for Bank Model Function jockey Yes Remove this customer from the tail of his or her current queue Yes Place the jockeying customer at the tail of the queue of the teller who just completed service Is the teller who just completed service now busy? No Compute the delay of the jockeying customer and gather statistics Make the teller busy Schedule a departure event for the jockeying customer Return Is there a customer to jockey? No
Flow Chart for Arrive and Depart Function arrive Yes Function depart Determine the station from which the job is departing Is this a new arrival? Schedule the next (new) arrival event Yes No Make a machine in this station idle and gather statistics Generate the job type and set task=1 for this job Is the queue for this station empty? Remove the first job from the queue Compute the delay for this job and gather statistics Determine the station for this job Yes Place the job at the end of the queue for this station Are all machines in this station busy? Schedule a departure event for this job No Tally a delay of 0 for this job Make a machine in this station busy and gather statistics Yes Does departing job have more tasks to be done? Add 1 to task of the departing job No Schedule a departure event for this job Return No Invoke arrive with new_job =2 Return
C Program Examples • https: //www. programiz. com/c-programming/examples/print-integer
Simulink Program • https: //www. mathworks. com/help/dsp/ug/generate-code-fromsimulink. html#bsz 7 w 6 g • https: //www. bing. com/images/search? view=detail. V 2&ccid=Mpi. L 1 p. G W&id=F 76719 EC 95 C 8344907468 CA 5037 DD 4 B 052 E 6 E 545&thid=OIP. Mpi. L 1 p. GWVf. V 6 Xp. EXx. TSa. AEs. DI&q=good+simulink+design+models&simid=6080142037338 68704&selected. Index=28&ajaxhist=0 Alternates
- Slides: 7