Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input: list of "new calls"
- import "new call" from queue
- update "arrival time" of "new call"
- if (any "end" of "call in progress" <= "arrival time" of "new call"){
- // process the call from "call in progress"
- turn off the flag of the sources of ended call in "lines" list;
- update "used" in "links";
- update "clock";
- remove the ended call from "call in progress";
- update "processed" & "completed" in "call counter";
- }
- else{
- if (any one source of "new call" is connected with another source in "call in progress"){
- // add the new call to busy
- update "clock";
- update "processed" & "busy" in "call counter";
- import "new call" from queue;
- update "arrival time" of "new call";
- }
- else if (all the rooms are full in "call in progress"){
- // add the new call to blocked
- update "clock";
- update "processed" & "blocked" in "call counter";
- import "new call" from queue;
- update "arrival time" of "new call";
- }
- else{
- // add the new call to "call in progress"
- turn on the flag of the sources of "new call" in "lines" list;
- update "used" in "links";
- update "clock";
- add the call to "call in progress";
- import "new call" from queue;
- update "arrival time" of "new call";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement