Md. Sazzadur Ahamed Senior Lecturer
Dept. of CSE
Daffodil Int. University
Lecture 6
Simulation of Telephone System
Objectives
Process a given number of calls and determine what proportions of the calls are:
➢ successfully completed
➢ blocked or
➢ found to be busy calls
➢ The system has a number of telephones (6 are shown) connected to a switchboard by lines.
➢ The switchboard has a number of links which can be used to connect any two lines, subject to the condition that only one connection at a time can be made to each line.
➢ A Call is lost:
Situation
• if any of the called party is engaged, then it is a busy call.
LINES
Call Processing Condition
Successfully Completed Call:
• When an ongoing call ends which was from the beginning established.
Busy Calls:
• To establish a call, it need one link and two line. So if a call found that from the two of the line, any one of them is already in use.
Block Calls:
• To establish a call, it need one link and two line. So if a call found that from the two of the line, both are already in use.
From To Length Arrival
4 6 10 1000
➢ Each call is a separate entity having attributes
a) Source b) Destination c) Length, and d) Call finish Time
➢ 0 represents Free
➢ 1 represents Busy
➢ To keep track of event, a clock time is included. At present 1035(time unit)
➢ To generate the arrival of call, a record is kept of the time the next call is due to arrive.
➢ There are two activities causing events:
i. New calls arrive
ii. Existing calls vanish
Situation
2
1140
1
1099 0
0
0 0
0 0
0
1140