Ana səhifə

University of surrey b. Sc. Undergraduate Programmes in Computing


Yüklə 142.5 Kb.
tarix25.06.2016
ölçüsü142.5 Kb.
UNIVERSITY OF SURREY

B.Sc. Undergraduate Programmes in Computing

B.Sc. Undergraduate Programmes in Mathematical Studies
Level 3 Examination Autumn 2004
Module CS366 Advanced Simulation - Solutions
The problem specification and a working program Runway1 were given to the students some weeks prior to the examination. The modifications to the program asked for in Questions 2, 3 & 4 have been highlighted on the attached program Runway1 and are discussed below.
Question 1 (Comment 25%)
To explore the behaviour of the model we need to consider the significance of the grouping of planes. The group size can be considered as the maximum number that land or take-off before the other group get the free runway. Hence to avoid a large queue of aircraft stacked in the air we need the take-off queue to be small so that priority is given to the landing planes. (5 marks)
Some typical output data is given below using an exponential distribution for the IAT from which to consider the effect of Group Size: (5 marks)


Landing Group

Take-off Group

IAT

Landing Queue Aver

Landing Queue Max

Take-off Queue Aver

Take-off Queue Max

4

1

8

1.34

4

12

25

4

2

8

1.6

5

6.5

14

4

4

8

2.7

6

2.9

7

1

1

8

10.2

22

10.6

22

The benefit of using Groups is indicated by the reduction in queues show by the data in the first 3 rows. The optimum for the landing planes which are most vulnerable is indicate by the data in the first row.


An appropriate Inter Arrival Time for the simulation can be estimated in the following way:
The average time to land or to take-off is 2.5 minutes plus a change-over time of 4 minutes every time a group is completely landed or taken-off. . Thus we would set take-off Group to be less than landing Group so consider a Landing Group of 4 and a Take-off Group of 2 which would take 4x2 + 2x3 + 2x4 = 22 minutes to complete. As there are 6 planes involved the average task-time is 22/6 = 3.7 minutes per plane. Hence an appropriate IAT would be twice this as two planes are created for each cycle of the generator task i.e. 7.4 minutes. (marks 5)
Typical output data is shown below. (marks 5)


Landing Group

Take-off Group

IAT

Landing Queue Aver

Landing Queue Max

Take-off Queue Aver

Take-off Queue Max

4

2

5

3.8

7

13.1

28

4

2

8

1.18

3

4.2

10

4

2

15

0.1

1

0.1

1

The second row of data gives an ideal through put without excessive or dangerous size queues with the landing queue smaller than the take-off queue. We should note that the average time in a queue is the queue size x IAT so that would produce average waiting times of about 9 minutes and 32 minutes for the landing and take-off queues respectively which are considered to be acceptable.


Consider effect of IAT (marks 5)
Introduction of an exponential inter-arrival time produces typical results below:


Landing Group

Take-off Group

IAT

Landing Queue Aver

Landing Queue Max

Take-off Queue Aver

Take-off Queue Max

4

2

8

1.4

5

2.1

16

We see that the effect of introducing a stochastic fluctuation in the inter-arrival time results in greater fluctuations in the queues as seen in a chart plot of the queues below and a larger standard deviation on the average values of queue size. The average queue size is lower but the maximum value has increased.

Optional printout of queue lengths:

Question 2 (Code 15% comment 10%)


To calculate the utilisation requires both landing and take-off tasks to record the start time of a task and to increment the total time at the end of the task. As only one task can be operative at a time – only one runway - only two global variables are required e.g. RunwayBusyStart and TotalRunwayBusyTime. Utilisation may be defined as total times taken in landing and taking off excluding the changeover time. An alternative definition may be acceptable if provided.
The code is included within boxed tables in the program listing attached.
The utilisation as a percentage is then calculated at the end of the simulation when the total time is given by the value of the simulation Clock: TotalRunwayBusyTime/Clock * 100 (marks 5)
Typical data: (marks 5)


Landing Group

Take-off Group

IAT

Average queues

Utilisation

4

2

8

3

98%

4

2

20

0

64%

By increasing the IAT there is more time between planes so that queues do not form. From the table we see the strong connection between Utilisation and average queue – as a general rule if you want to avoid having queues utilisation is likely to be less than 65%.


Question 3 (Code 15% comment 10%)
To calculate the maximum departure time i.e. the time to taxi to the runway plus the time in the take-off queue plus the actual take-off time will vary for each plane hence we must create a global array of type floating point at least of dimension 50 as there are 50 planes to take-off in the original model. The index must be determined by the particular plane so we must use Entity.Tag as the index variable. The code is included within boxed tables in the program listing attached. (marks 5)
Typical results are shown below:


Landing Group

Take-off Group

IAT

Take-off Queue

Time Max


Take-off Depart

Time Max


Take-off Queue

Time Aver



Take-off Depart

Time Aver



Take-off Queue Aver

Take-off Queue Max

4

2

8

65

77

38.8

48.9

3.76

8

From this data we note that with an IAT of 8 minutes we would expect to have a waiting time of 8x the queue length – thus for a queue length of 8 a wait time of 65 minutes is consistent with our expectations i.e. (8 x 8 = 64).


The difference between the time in queue and the total departure time is about 10 minutes for both the average values and the maximum values: (48.9 – 38.8) and (77 – 65). This is made up of the taxiing time of 5 minutes and the take-off time of about 3 minutes and 4 minutes changeover time giving a total of 12 about minutes. (marks 5)
Question 4 (Code 15% comment 10%)
The Decision Variables have to be set as below:
TotalTGroup = 1 to 4

TotalLGroup = 1 to 4

Constraints – none

Optimisation Objective - Minimise Total Simulation Time


Hence a new global variable must be declare e.g. MaxSimTime as a floating point type and the value of the Clock assign to it in the End Effect code box in both the Take-off and the Landing tasks. Sample code is included within boxed tables in the program listing attached.
The optimisation facility produces charts as indicated below in which all combination of Group sizes are shown in green & blue and the total simulation time is shown in red. As all data is presented on the same vertical scale it is helpful to scale the TotalSimTime – in this case the plot uses TotalSimTime/30 because the TotalSimTime is about 450 minutes which produces a data value of 15.
The data shows that the effect of grouping planes is only significant if the IAT is such that queues form. Thus for example with IAT = 15 few queues form and there is no significant difference between different combinations of group sizes. With IAT = 5 we see significant fluctuations occur in the time to land & take-off all planes with an optimum of MaxTGroup = 4 and MaxLGroup = 4. This optimum might not be the best for planes landing which should be given priority. This could be achieved with a choice of a MaxTGroup = 1 and MaxLGroup = 4. The chart shows that this choice would result in a TotalSimTime of 17 x 30 = 510 minutes compared with the optimum of 12 x 30 = 360. This represents a penalty that the take-off planes would suffer with longer wait times than the landing planes. We also note that the worst case is with MaxTGroup = 1 and MaxLGroup = 1; the case when effectively we are not using any groups at all. (comments and data - marks 10)

Output for an inter-arrival time IAT = 15



Output for an inter-arrival time IAT = 5




Dr Terry Hinton 4/11/04


Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©atelim.com 2016
rəhbərliyinə müraciət