Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
ECMM424
(with Answers)
COLLEGE OF ENGINEERING, MATHEMATICS
AND PHYSICAL SCIENCES
COMPUTER SCIENCE
Computer Modelling and Simulation
Duration: TWO HOURS
Answer Question 1 (40%) and any TWO of the other three questions (30%
for each).
Candidates may use calculators provided they are non-programmable.
This is a CLOSED BOOK examination.
AN
SW
ER
S
Question 1
(a) Both computer simulation and analytical modelling can be used to evaluate
the performance of systems.
(i) Describe the methods of computer simulation and analytical modelling,
respectively.
(4 marks)
(ii) Explain the situations where it is better to use analytical modelling for
performance evaluation than computer simulation.
(3 marks)
(iii) Explain the situations where computer simulation is more suitable than
analytical modelling for performance evaluation.
(3 marks)
Solutions:
Computer simulation is a computer program that mimics the behaviour
or operations of a real-world system or process over time, including its
inputs and outputs. Simulation experiments imitate the operations of a
real-world process or system over time using a computer program.
(2 marks)
Analytical modelling uses mathematical concepts, tools, and equations
to describe the behaviour or operations of a system and generates closed-
form solutions to the equations.
(2 marks)
Analytical modelling is used if the model is simple enough and
mathematical approach is feasible.
If the model structure is simple, then we could use mathematical
methods to implement the model and get the exact information for
questions of interest, this is called analytical modelling. Different
mathematical techniques (e.g., calculus, algebra, probability theory) can
be applied in this method to implement the model.
(3 marks)
AN
SW
ER
S
However, many real world systems are so complex that models of these
systems are virtually impossible to solve mathematically. In these cases
computer simulation can be used to imitate the behavior of the system
over time for performance evaluation.
(3 marks)
(b) The figure below shows the logical relationship of components in discrete-
event simulation. Describe the flow control of discrete-event simulation
and the functions of the Main program, Initialization routine, Time routine,
Event routine, and Report generator, respectively.
(10 marks)
Solutions:
The simulation begins at time zero with the main program invoking the
initialization routine, where the simulation clock is set to zero. Also in
the initialization routine the systems state and statistical counters and the
event list are initialized.
(2 marks)
After these settings the control goes back to the main program. In the
AN
SW
ER
S
next step the main program invokes the timing routine to determine
which type of event is the most imminent.
Based on the type of the next occurring event the simulation clock is
advanced to the time that event type will occur. The time of occurrence
of events is dependent on their type and their distribution in time.
(2 marks)
Then the control goes back to the main program again.
Based on the type of event, the main program invokes the appropriate
routine. If the next event is arrival then the arrival routine is invoked else
the departure routine is invoked.
(2 marks)
In general inside the event routines three main activities occur:
The system state is updated to account for the fact that an event of a
specific type has occurred.
Information about the system performance is gathered by updating
the statistical counters. The times of occurrence of future events are
generated, and this information is added to the event list.
In order to generate future events some random variates are used which
we will talk about more in detail in future sessions.
(2 marks)
After all processing has occurred in the event routine and the main
program, a check is typically made to determine (relative to some
stopping condition) if the simulation should now be terminated.
If it is time to terminated the simulation, the report generator will be
invoked from the main program to compute estimates of the desired
performance measures using the statistical counters.
If it is not to terminate the simulation then the control is passed back
to the main program. Then the main program routine invokes the
timing routine, then again the control of the program goes back to
the main program routine, then to the event routine, and so on. . . .
The termination check cycle is repeated until the stopping condition is
eventually satisfied. Time can be compressed or expanded allowing for
speedup or slowdown of the phenomena under consideration.