Queues ?? ?? - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

Queues ?? ??

Description:

Title: Queues Author: mehriiii Last modified by: mehriiii Created Date: 7/4/2006 3:07:45 PM Document presentation format: On-screen Show Company – PowerPoint PPT presentation

Number of Views:136
Avg rating:3.0/5.0
Slides: 25
Provided by: mehr151
Category:
Tags: queues

less

Transcript and Presenter's Notes

Title: Queues ?? ??


1
Queues?? ??
  • ???? ???????
  • ???? ??????????? ?????
  • ??? ???? ?????? ????? ?????

2
?? ?? Queues
  • ?? ??????? ???? ??? ?? ????? ??? ?? ???? ?? ?????
    ?????? ???????? ??? ???.????? ???? ??? ?? ?? ???
    ?? ???? ???? ????? ??????? ???? ?? ?? ?????. ???
    ??? ????? ??? ?? ??? ????? ?????? ???? ???? ?????
    ? ?????? ???? ????? ???? ??? ?????? ?? ??? ??????
    ?????.

3
?? ?? Queues
  • ??????
  • ?? ????? ??? ?? ???? ????? ????? ????? ?? ?? ???
    ?? ???? ????? ???? ? ???? ????? ??? ????? ?? ???
    ???? ??? ????.
  • ????? ???? ?? ?? ?? ????? ? ????? ???? ??? ????
    ?? ?????? ?? ???. ????? ???? ??? ????? ????? ????
    ????? ???? ???(?? ??) ?? ?????? ?? ???.
  • ????????
  • ????????? ??? ?????? ???? ????????? ????? ?? ???
    ????? ?? ??????????? ????? ???.

4
?? ?? Queues
  • ?????? ??
  • ???? ?? ???? ?? ????? ???? ???? ?? ????? ??? ????
    ??? ????? ?????? ?? ?? ???? ????? ?? ?? ?????.
    ????? ???? ?? ????? ????? ?? ??? ???? ????? ????
    ??? ??? ?? ?? ?? ?????? ???? ???????? ?????
    ??????? ???? ?? ?? ????????? ???? ?? ?? ???????
    ????

5
?? ?? Queues
  • ????? ???? C
  • class Queue
  • public
  • Queue( )
  • bool empty( ) const
  • Error_code append(const Queue_entry x)
  • Error_code serve( )
  • Error_code retrieve(Queue_entry x) const
  • // Additional members will represent queue data
  • ?? ?????? ???? ?? ?? ????? ???? ???. ???? clear
    ???? ?? ?? ?? ?? ?? ???? ????? ??? ?? ?? ???? ?
    ?? ?? ???? ?? ???. ???? ???? size ???? ?? ?????
    ????? ????? ?? ?? ?? ?? ?? ??????. ???? ????
    serve_and_retrieve ???? ?? ????? serve ? retrieve
    ?? ????? ?? ???.
  • ???? ??? ???? ???
  • ????? ????? ??? ???? Queue ? ???? ???? ???
    Extended_queue ?? ?? ?? ??????? ????? ??????
    ???? ?? ???? ?? ????? ?? ???? ???? ??? ?? ????
    ???? ????? ?? ???

6
?? ?? Queues
  • class Extended_queue public Queue
  • public
  • bool full( ) const
  • int size( ) const
  • void clear( )
  • Error_code serve_and_retrieve(Queue_entry item)
  • ???? ????? public ?? ????? ?? ????? ???? ???? ??
    ??? ?? ?? ??? ???? ?? ?? Extended_queue ?? ?????
    ???? ?????? ???(visibility) (???? ?????) ?? ????
    ?? ?? ????? ???? ?? Queue ????.

7
??? ????? ???? ?? ?? Queues
??? ??????
  • ????? ??? ?? ????? ? ??? ?? ??????? ????? ?? ????
    ? ??? ????? ?? ????? ??????? ???????? ?? ?? ????
    ?? ????? ?? ?? ??????? ? ?????? ?? ??????
    ??????? ? ?????? ?? ?????? ???. ? ????? ????? ???
    ??? ??? ????? ?? ????? ???? ??????.???? ??? ???
    ?? ??? ??????? ?? ???????? ???.
  • ?? ????? ? ??? ?? ?? ???????? ????? ? ??????? ??
    ?????? ?????? ??????. ??????.???? ??? ?? ???? ??
    ?? ?? ??? ?? ?????? ?? ????????? ? ????? ?? ???
    ?????? ?????? ? ???? ?????? ???? ?? ?? ?? ?????
    ????? ????? ?? ??? ?????? ?????? ??? ??? ???
    ???????? ??? ???? ???? ?? ?? ?? ?? ?? ???? ????.
  • ?? ????? ????? ???? ??????? ????? ?? ?? ?????
    .???? ????? ???? ???? ?????? ????? ?? ????? ?????
    ??? ?? 0 ?? max-1 ??????????? max ????? ?????
    ????? ?? ????? ? ????? ??? . ??????? ????? ??
    ????? ??????? ????? ??????? ?? ?? ?????? ??
    ???max-1 ?????? ?????? ?????? ?? 0 ???? ??????.

????? ???? ? ????? ???
????? ???? ????? ??? ?????
8
?? ?? Queues
  • ????? ????
  • ????? ???? ????????? ? ????? ?? ?? ?? ???? ?? ??
    ???. ???.??? ????? ?? ???? ?? ?? ???? ????? ?
    ????? ???????.???? ??? ?? ???? ??? ???? ?????? ??
    ??? ?????? ?? ??????? ?? ?? ???? ???? ????? ????
    ?? ?????? ?? ??? ??? ?? ???????. ???? ?? ?? ??
    ??? ????? ??? ??? ?? ????? ???? ??????.?? ?? ??
    ???? ???? ????? ???????? ????? ? ????? ?? ??
    ???? ? ?? ?? ?? ????? ????? ???? ?????. ???? ????
    ????? ????? ?? ?? ?? ?????? ???? ?? ???? ???? ??
    ????? ?? ???? ?????.

9
?? ?? Queues
  • ??? ?? ??? ???? ???? ?? ??? ????
  • ?? ????? ????? ?? ???????? ????? ? ??????? ? ??
    flag ???? ???? ???? ???? ?? ?? ???? ?? ???
    ??????.
  • ?? ????? ????? ?? ???????? ????? ? ????? ? ??
    ????? ???? ?? ????? ????????? ????? ??????.
  • ?? ????? ????? ?? ???????? ????? ? ??????? ??
    ???? ???? ???? ???? ???? ?????? ???? ????????????
    ??????.

????? ??? ??? ?? C
  • ?? C ?? ???????? ????? I ?? ????? ????? ?? ??
    ??????? ?? ??????? ?? ???? ? ?????? ???? ?
    ???????
  • i ((i 1) max) ? 0 (i 1)
  • ??? ??????? ? ??????? ?? ???? ? ?? ??? ?? ?? ???
    ???
  • if ((i 1) max) i 0 else i i 1
  • ?????? ?? ???????? ?? ??????? ????????? ??
    ??????? ???? ????????
  • i (i 1)max
  • (??? ???? ?? ???? ?? ????? ? ????? ???? ??????
    ??? 0 ? max-1 ????.

10
????? ???? ????? ?? ?? Queues ?? c
  • ????? ???? ?? ?? ????? ? ????? ?? ?? ?? ???????
    ???? ????? ????? ????? ?? ?? ??????? ?? ??? ??
    ?? ????? ??? ?? ?? ????? ?? ????? ?? 0 ??
    maxqueue-1 ?? ????? ???? ?? ??? ????- ?? ????? ??
    ?????. ????? ???? ???? ?? ?? ?? ???? ??? ??? ??
    ?? ????? ???? ?? ?? ???? Protected ?? ?? ???
    Private ?? ??????
  • const int maxqueue 10
  • class Queue
  • public
  • Queue( )
  • bool empty( ) const
  • Error_code serve( )
  • Error_code append(const Queue_entry item)
  • Error_code retrieve(Queue_entry item) const
  • protected
  • int count
  • int front, rear
  • Queue_entry entrymaxqueue

11
?? ?? Queues
  • ????? ??? ?? ???? ??? ???? ??? ????? ????? ??
    ?????? Protected ???? ???? ?????? ????? ?????.
    ???????? ???? ?? ????? ?? ???? ??????? ???? ??
    ?????? ???????? ?? ?? ???? ?? ??????? ????? ????
    ?? ???? ?? ????? ?? ?.
  • ????? ???? ????? ???? ????? ? ??? ???? ?? ?? ??
    ?????? ??? ???? ????????? ??????.??? ????? ???
    ?? ?? ??? ?? ?????
  • ??????? ???? ????? ?????Queue Queue( )
  • ??? ?? ???? ???? ????? ???? ? ?? ??? ??? ???? ???
    ?? ??? ????????
  • count 0 bool Queue empty( ) const
  • return count 0
  • ?? ????? ?? ?? ?? ???? ????? ???? ????? ????? ?
    ?? ???? ????? ??????
  • Error_code Queue append(const Queue_entry
    item)
  • if (count gt maxqueue) return overflow
  • ?????? ?? ??? ??? ??? ??? ?? ???? ???? ????? ???
    ?????
  • Error_code Queue serve( )
  • if (count lt 0) return underflow
  • ?????? ?? ????? ???? ????? ?? ?????? ??? ?? ????
    ???? ????? ???? ????? ?????.
  • Error_code Queue retrieve(Queue_entry item)
    const
  • if (count lt 0) return underflow

12
?? ?? Queues
  • ??? size
  • ??? ?? ????? ?? ?? ???? ?? ??? ?????? ????? ??
    ???? ??? size ??? ?? ????? ????? ?? ?????? ??
    ?????.
  • int Extended_queue size( ) const
  • ?? ????? ??? size??? ??????? ????? ?? protected
    ??????? ?? ???? .??? ??????? ???? ?? ?? ????
    ???? private ????? ????? ????? ???? ?????? ???
    ???? ????? ?????? ?? ? ???????? ??? ?????? ?? ??
    ?????? ?? ?????? ?? ?? ???????? ?? ??? ??? ???
    ???????? ?????? ???? ?? ??? public? ??????
    ????? ????.
  • ????? ? ?????? ????
  • ?????? ?????? ????? ?? ?????? ? ????? ?????
    ??????.?? ?? ??? ????? ???? ? ???? ?????? ??
    ????? ??????? ?? ??? ?? ?? ?????? ?? ?????? ????
    ??? (??? ???? ????) ?????? ?? ?? ??? ??????? ????
    ????? ? ????? ?? ????? ?? ???. ???????? ?????? ?
    ???? ?? ???? ??? ?? ????
  • int main( )
  • Extended_queue test_queue
  • introduction( )
  • while (do_command(get_command( ), test_queue))
  • ????? ???? ?????? ?? ????? ?? ??????? ?? ????
    ????? ???.??? ??????? ?????? ?????????? ??????
    ?????? ???? help ????? ???? ??? ?????? ?? ?????
    ???? ?? ?????? ?????? ???? ?? ????? ???? ???

13
?? ?? Queues
  • void help( )
  • ltlt "This program allows the user to enter one
    command" ltlt endl
  • ltlt "(but only one) on each input line." ltlt endl
  • ltlt "For example, if the command S is entered,
    then" ltlt endl
  • ltlt "the program will serve the front of the
    queue." ltlt endl
  • ltlt " The valid commands are" ltlt endl
  • ltlt "A - Append the next input character to the
    extended queue" ltlt endl
  • ltlt "S - Serve the front of the extended queue" ltlt
    endl
  • ltlt "R - Retrieve and print the front entry." ltlt
    endl
  • ltlt " - The current size of the extended queue"
    ltlt endl
  • ltlt "C - Clear the extended queue (same as
    delete)" ltlt endl
  • ltlt "P - Print the extended queue" ltlt endl
  • ltlt "H - This help screen" ltlt endl
  • ltlt "Q - Quit" ltlt endl
  • ltlt "Press lt Enter gt to continue." ltlt flush
  • char c
  • do
  • cin.get(c)

14
?? ?? Queues
  • ??? ?????? ? ????? ???? ??????? ?? ????? ????? ?
    ???? do_command ???. ?? ???? ?? ??? ???? ?? ??
    ??? ????? ??????
  • bool do_command(char c, Extended_queue
    test_queue)
  • bool continue_input true
  • Queue_entry x
  • switch (c)
  • case 0r0
  • if (test_queue.retrieve(x) underflow)
  • cout ltlt "Queue is empty." ltlt endl
  • else
  • cout ltlt endl
  • ltlt "The first entry is " ltlt x
  • ltlt endl
  • break
  • case 0q0
  • cout ltlt "Extended queue demonstration finished."
    ltlt endl
  • continue_input false
  • Break
  • return continue_input

15
?? ?? Queues
  • ?????? ?? ??
  • ???? ????
  • ??????? ?? ??????? ?? ?? ????? ???? ??? ?????
    ?????? ?? ????? ????.?? ???? ???? ???? ?? ??????
    ??????? ?? ??? ?? ????? ?????? ?????? ????? ???
    ????? ????? ?? ????? ? ?? ?????? ????.
  • ?? ???? ???? ????????? ?? ????? ?? ?????? ????
    ???? ???? ????? ?????? ?? ??? ????? ??? ???????
    ?? ???.
  • ???? ???? ?? ???????
  • ?????? ?? ????? ???? ????? ???? ?? ?? ???????
    ???? ?? ????? ??? ?? ?? ????? ??? ???? ????? ????
    ????.?? ?? ???? ????? ?? ??????? ?? ????? ???
    ???? ?????? ?? ?? ??? ???? ???? ??? ? ????? ???
    ?? ??? ???? ???? ????.
  • ???? ??? ????????
  • ????? ?? ???? ?? ??????? ?? ????? ?? ?????? ?? ??
    ?? ??????? ???? ?? ???? ?? method ???? ???????
    ??? ????
  • ?? ???? Runway ???? ??????? ???????? ?????? ?
    ????? ? ?????? ???? ???????
  • ?? ???? Random ???? encapsulate ??????????? ?? ??
    ???? ?????? ????? ?? ????? ?? ??? ???? ??
    ??????? ?? ??? ???? ?? ????
  • ???? ????? ????? ?? ?? ?? ??????? ???? ?????? ??
    ?? ?? ??? ?? ????? ?? ??????? ?? ??? ???? ??? ??
    ??? ????? ????? ????

16
?? ?? Queues
  • int main( ) // Airport simulation program
  • int end_time, queue_limit, flight_number 0
  • double arrival_rate, departure_rate
  • initialize(end_time, queue_limit, arrival_rate,
    departure_rate)
  • Random variable
  • Runway small_airport(queue_limit)
  • for (int current_time 0 current_time lt
    end_time current_time..)
  • int number_arrivals variable.poisson(arrival_rat
    e)
  • for (int i 0 i lt number_arrivals i..)
  • Plane current_plane(flight_number..,
    current_time, arriving)
  • if (small_airport.can_land(current_plane) !
    success)
  • current_plane.refuse( )
  • int number_departures variable.poisson(departure
    _rate)
  • for (int j 0 j lt number_departures j..)
  • Plane current_plane(flight_number..,
    current_time, departing)
  • if (small_airport.can_depart(current_plane) !
    success)
  • current_plane.refuse( )
  • Plane moving_plane
  • switch (small_airport.activity(current_time,
    moving_plane))

17
?? ?? Queues
  • ???? ????? ????? ?? ??? ???? Runway ?? ?????? ??
    ??????????????? ?? ?? landing Queue ????? ??????
    ?? ??? ?? Refuse ?????? ?? ??? ???? ????????
    ??????? ?? ?? ??????? ???? ??????? ??
    ????.???????? ???? ????? ????? ?? ???? ?? ???????
    ?? ??????? ???? ????? ?? ???????.
  • ????? ??????
  • ????? ? ???? ????? ???? ???? ??? ????? ??? ?? ??
    ?? ???? ? ????? ?? ????? ???????? ???? ???? ?????
    ?? ??? ???? ?? ??????? ?? ??? ?? ????? ?? ???? .
    ?????? ???? ??? ???? ??? ??? ?? ??? ?? ?? ????
    ?????? ? ?????? ????? ???? ????

18
?? ?? Queues
  • ???? ??????? ?? ?? ?????? ???? ??? ?????? ????.??
    ????? ???? ?? ????? has-a ?? ????? ?? ???.
  • ????? ???? ??????? enum Runway_activity idle,
    land, takeoff
  • class Runway
  • public
  • Runway(int limit)
  • Error_code can_land(const Plane current)
  • Error_code can_depart(const Plane current)
  • Runway_activity activity(int time, Plane
    moving)
  • void shut_down(int time) const
  • private
  • Extended_queue landing
  • Extended_queue takeoff
  • int queue_limit
  • int num_land_requests // number of planes asking
    to land
  • int num_takeoff_requests // number of planes
    asking to take off
  • int num_landings // number of planes that have
    landed
  • int num_takeoffs // number of planes that have
    taken off
  • int num_land_accepted // number of planes queued
    to land
  • int num_takeoff_accepted // number of planes
    queued to take off

19
?? ?? Queues
  • ???? ?? ?? ?? ?? ??? ???? ???? ????? ?????? ?????
    ??????? ?? ??????? ?? ????? ???overload ??? ???
    ? ???? ???? ? ???? ??????? ?? ???? ?? overload
    ???? ?? ?????? ??????? ????? ?????? ????? ???
    ?? ?? ???? ??????? ???? ??????? ?? ??? ? ??? ??
    ??????? ???? ?? ????? ??? ???? ??????? ?? ???.
    ???? ?? ?????? ????????? ???? ???? ??????? ?????.
  • enum Plane_status null, arriving, departing
  • class Plane
  • public
  • Plane( )
  • Plane(int flt, int time, Plane_status status)
  • void refuse( ) const
  • void land(int time) const
  • void fly(int time) const
  • int started( ) const
  • private
  • int flt_num
  • int clock_start
  • Plane_status state
  • ????? ???????? ???? ???????
  • ???? ??????? ???? ???? ???? ???? ?? ?????
    ???????? ???? ???? ?? ????? ??????? ??? ?????
    ??????? ?? ?? ??? ????? ?? ???? ???? ???
    ????????? ?????. ????.?????? ???? ?? ?? ???????
    ???? ???? ??? ????? ?? ?? ????? ???? ?? ????????
    ??????? ?????.
  • ?? ??? ???? ??????????? ?? ?? ?????? ???? ???????
    ?? ?? ?? ??????? ??????.?? ???? ?? ??? ???? ????
    ?? ?????? ?? ?????? ??? ?? ?? ?? ??????? ????
    ????? ????? ???? ??? ??????? ????? ??? ?? ????
    ????? ?? ????? ?? ??????? ??? ?? ?? ??? ??? ????
    ????? ????? ??.?? ??????? ????? ?????? ?? ??????
    ???? ???? ??????? ??? ?? ?? ??????? ? ??? ?? ???
    ????????????. .
  • ??????? ???? ???? ??????? ???? ??????????????
    ???? ??? ???? ????? ???? ?? ?? ??? ???? ??????
    ?????? ???? ??????? ?? ???. ?????? ?? ???????
    ???????? ?? ?????? ???? ????? ?? ??????? ?? ????
    ??????????? ????

20
?? ?? Queues
????? ? ??? ??? ???? ????
  • 2.???????? ???????????
  • ????? ???? ???? ??????? ???????? ????? ??
    ???????? ????? ??????? ???? ??? ?? ?????? ??
    ????? ???? ???? ??? ??????? ???? ?????? ??? ??
    ??? ???? .
  • queue_limit limit
  • num_land_requests num_takeoff_requests 0
  • num_landings num_takeoffs 0
  • num_land_refused num_takeoff_refused 0
  • num_land_accepted num_takeoff_accepted 0
  • land_wait takeoff_wait idle_time 0
  • 1.???????? ????? ???? ????
  • ????? ????? ???? ????? ?? ???? ???? ?????????
    ???? ?? ?????? ???? ? ???? ??? ???? ?????? ??
    ????? ?? ???
  • void initialize(int end_time, int queue_limit,
  • double arrival_rate, double departure_rate)
  • cout ltlt "Up to what number of planes can be
    waiting to land "
  • ltlt "or take off at any time? " ltlt flush
  • cin gtgt queue_limit
  • cout ltlt "How many units of time will the
    simulation run?" ltlt flush
  • cin gtgt end_time
  • bool acceptable
  • do
  • cout ltlt "Expected number of arrivals per unit
    time?" ltlt flush
  • cin gtgt arrival_rate
  • cout ltlt "Expected number of departures per unit
    time?" ltlt flush
  • cin gtgt departure_rate
  • ....

21
?? ?? Queues
????? ? ??? ??? ???? ????
  • 3.??????? ?? ??????? ???? ?? ?? ?? ????
  • ??? ???? ??????????? ????? ???? ???? ??????? ??
    ?? ???? ????? ?? ??? ?? ??? ??? ???? ????
    ????????? ?? ??????????? ???? ??????? ?????
    ?????.
  • Error_code result
  • if (landing.size( ) lt queue_limit)
  • result landing.append(current)
  • else
  • result fail
  • num_land_requests..
  • if (result ! success)
  • num_land_refused..
  • else
  • num_land_accepted..
  • return result
  • Error_code Runway can_depart(const Plane
    current)
  • ???? ????? ?? ?????????? ????? ???? ???? ???????
    ?? ?? ?????????? ?? ??? ?? ??? ??? ???? ????
    ????? ???? ?? ???.??????? ???? ??????? ????? ???
    ???.
  • 4.????? ?????? ???? ???????
  • ??? ?? ???? ?????? ???????????? ????? ??
    ???????????? ??? ???????? ????? ???? ?????????
    ??????????? ?? ????? ?????? ???????????? ????? ??
    ???????? ?? ???? ?? ??? ??? ?? ??? ??? ?????
    ????? ????????? ?? ??????????? ???? ??????? ?????
    ?? ???.
  • if (!landing.empty( ))
  • landing.retrieve(moving)
  • land_wait time - moving.started( )
  • num_landings..
  • in_progress land
  • landing.serve( )
  • else if (!takeoff.empty( ))
  • takeoff.retrieve(moving)
  • takeoff_wait time - moving.started( )
  • num_takeoffs..
  • in_progress takeoff
  • takeoff.serve( )
  • else idle_time..
  • in_progress idle
  • return in_progress

22
?? ?? Queues
????? ? ??? ??? ???? ????
  • 6.???????? ???????
  • ??????? ?? ?? ?? ?? ??????? ????? ??????? ?? ????
    ??? ???? ?? ?? ?? ??? ?? ????? ?? ???.
  • cout ltlt "Plane number " ltlt flt_num
  • if (state arriving) cout ltlt " directed to
    another airport" ltlt endl
  • Else cout ltlt " told to try to takeoff again
    later" ltlt endl
  • 7.?????? ??????? ?? ??? ????
  • ??????? ?? ?? ?? ?? ??????? ?? ?? ?? ?? ?? ????
    ???? ???? ?? ??? ????? ?? ???.
  • int wait time - clock_start
  • cout ltlt time ltlt " Plane number " ltlt flt_num ltlt "
    landed after
  • ltlt wait ltlt " time unit" ltlt ((wait 1) ? ""
    "s")
  • ltlt " in the takeoff queue." ltlt endl
  • ?? ??? ???? ??????? ?? ???? ? ??????? ?????
    ???? ?????? s ?? ???? ?? ?? ?????? ????? ?? ??
    ??? ????? ???1 time unit or 2 time units
  • 5.???????? ????? ???????
  • ????? ???? ??????? flt_num, clock_start, state ??
    ????? ?? ?????? ??????? ???flt, time,status
    ?????? ?? ????.
  • flt_num flt
  • clock_start time
  • state status
  • Plane Plane( )
  • ????? ????? ???? ??????? flt_num, clock_start,
    state ?????? ??? ???? ?? ?????.
  • flt_num -1
  • clock_start -1
  • state null
  • ????? ??? ??? ?????? ?? ?? ???????? ??? ?? ?????
    ?? ???. ?? ?? ??????????? ?? ???? ?? ??????? ??
    ?? ????? ?? ???? ?? ??? ?? ?? ?? ????? ???????
    ????? ?? ?? ????????? ????? ???? ?? ???.????? ???
    ?? ???? ???? ??? ?? ????? ???? ?? ??? ????? ???
    ??? ??????.

23
?? ?? Queues
????? ? ??? ??? ???? ????
  • ?? ??? ???? 8.?????? ???????
  • ??????? ?? ?? ?? ?? ????????? ?? ?? ?? ???? ????
    ????? ?? ??? ????? ?? ???.
  • int wait time - clock_start
  • cout ltlt time ltlt " Plane number " ltlt flt_num ltlt "
    took off after "
  • ltlt wait ltlt " time unit" ltlt ((wait 1) ? ""
    "s")
  • ltlt " in the takeoff queue." ltlt endl
  • 9.?????? ?????? ???? ?? ??????? ???? ???????
  • ????? ?? ??????? ???? ????? ??????? ?? ??? ?? ??
    ??????
  • int Plane started( ) const
  • return clock_start
  • 10.????? ????? ???? ??? ????? ??????????
  • ???? ??? ???? ??? ?? ?? ????? ?? ???? ???????
    ?????????? ??? ????? ???? ?? ???.
  • void run_idle(int time)
  • cout ltlt time ltlt " Runway is idle." ltlt endl
  • 11.????? ???? ????
  • ???? ?????? ? ?? ??? ????? ?????

24
?? ?? Queues
  • ????? ?? ??? ???? ?? ????? ??????(TRACE)
  • ???? ?????? ??? ?????? ?? ??????? ?? ?? ???? ???
    ???? ???? ???? ?? ???? ????? ?? ?? ???? ?????
    ????? ?? ????? ? ?? ??????? ???? ?? ???? ?? ????
    ????? ??? ?? ?? ???? ??? ??? ??? .?? ???????
    ?????.
  • ????? ??? ??????? ?? ?????? ?? ?????? ???? ????
    ?? ????? ????????
  • ??? ???? ????? ???? ???? ???? ?? ????1000
  • ????? ??????? ???? ?????? ?? ?? ?????48
  • ????? ???? ??? ???? ?????? ?? ?? ?????48
  • ??????? ????? 0????? ????
  • 0??????? 1 ???? ???????? ??????? ?? ?? 0
    ????.??????? ????? 0 ??? ?? 0???? ????? ?? ??
    ????? ???? ?? ???.??????? ????? 1????? ????
  • 1??????? ?????1 ??? ?? 0???? ????? ?? ?? ?????
    ???? ?? ???.??????? ????? 2????? ???? ???????
    ????? 3????? ????
  • 2 ??????? ?????2 ??? ?? 0???? ????? ?? ?? ?????
    ???? ?? ?????????? ????? 4????? ????
  • ??????? ????? 5????? ????
  • ......
  • 19 ??????? ?????20 ??? ?? 3???? ????? ?? ??
    ??????????? ?? ???.
  • 20?? ?? ?? ???? ?????????? ??????? ??? ???????
    ???.
  • ??????? ??? ?? ??? ??? ????? ???? ???? ?? ??
    ????? ????? ?? ??? ?? ?????.
  • ?????
  • ???? ???? ??? ?? 1000 ???? ???? ?? ????? ?????
    ???.
  • ????? ?????????? ?????? ??? 970
  • ????? ?????????? ??????????? 484
  • ...
  • ????? ?????????? ????????? ?? ?? ???? ?
  • ???? ???? ??? ??????? ???? ???? 9.5
  • ??????? ?????? ?? ?? ???? 0.36646 ???? ?????
  • ??????? ?????? ?? ?? ????? 4.63744 ???? ?????
  • ??????? ???? ?????? ??? ??????????? ?? ??
    ??????? ???? ????0.484 ???? ?????
  • ??????? ???? ?????? ??? ??????????? ?? ??
    ??????? ???? ???? 0.486 ???? ?????
Write a Comment
User Comments (0)
About PowerShow.com