IT3CS4MS00 مدمج
IT3CS4MS00 مدمج
UNIT1
1
Modelling and Simulation
Simulation Modelling Methods
There now follows a brief overview of the three main methods of dynamic simulation modelling.
These are system dynamics (SD), agent-based simulation (ABS) and discrete-event simulation
(DES). The three methods have their own philosophies, communities of users and main areas of
application.
System Dynamics (SD)
SD has been used extensively in a wide range of application areas, such as economics, supply
chain, ecology and population dynamics, to name a few.
Agent-Based Simulation (ABS)
ABS has been applied across a wide area, such as economics, human behaviour, supply chains,
emergency evacuation, transport and healthcare.
Discrete-Event Simulation (DES)
DES evolves over time by a representation in which the state variables change instantaneously
at separate points in time. These points in time are the ones at which an event occurs, where
an event is defined as an instantaneous occurrence that may change the state of the system’.
Application Areas for DES
Simulation modelling is a flexible tool and is capable of analysing most aspects of an organi-
sation. The two main areas of operations are the design and management of processes. In
terms of design, simulation has an obvious role in the testing of system designs for systems
that do not yet exist. Simulation is often used to assess large capital investments such as
equipment and plant, where it can reduce the risk of implementation at a relatively small
cost. Simulation can also be used in the management of business processes. For example, a
service operation may wish to ensure continued good customer service while meeting
increased demand. Making decisions around aspects such as staffing levels and job
priorities to meet increased demand requires the ability to predict changes in these areas of
performance. Simulation can be used to provide a predictive capability to help make better
decisions and ensure future service levels are maintained.
Manufacturing Systems
In order to remain competitive, manufacturing organisations must ensure their systems can
meet changing market needs in terms of product mix and capacity levels while achieving
efficient use of resources. Because of the complex nature of these systems with many inter-
dependent parts, simulation is used extensively to optimise performance. Design decision
areas in manufacturing include estimating required resource capacity, layout design, bot-
tleneck analysis, machine setup time reduction, implementation of automation and production
lead time estimation. Management decision areas in manufacturing include estimating batch
size, determining parts sequencing, workforce scheduling and assessing preventative
maintenance policies.
Service Systems
The productivity of service sector systems has not increased at the rate of manufacturing
systems, and as the service sector has increased, the potential increase in productivity from
improving services has been recognised. Simulation is now being used to help analyse many
2
Modelling and Simulation
service processes to improve customer service and reduce cost. For example, the emphasis on
performance measures in government services such as healthcare has led to the increased use
of simulation to analyse systems and provide measures of performance under different
configurations. Design decision areas include customer queuing time estimation, layout
planning and service capacity planning. Management decision areas include staff
scheduling, customer service priorities and emergency planning.
Information Systems
Simulation is used to predict the performance of the computerisation of processes. This
analysis can include both the process performance and the technical performance of the
computer network itself, often using specialist network simulation software. Design decision
areas include the effects of automation by IS on customer service levels, estimating IS capacity
requirements to meet customer transaction volumes and designing client-server systems.
The case study ‘A simulation of an enterprise resource planning system’ concerns the use
of simulation to measure customer service performance when introducing an enterprise
resource planning (ERP) system into a customer order processing activity.
The case study ‘A simulation of a road traffic accident process’ concerns predicting the cost
savings made on front-line road traffic officer staff when changes are made to the road traffic
accident reporting process. The changes were based on the use of mobile devices to record and
map the location of traffic accidents at the location of the incident.
Benefits of DES
1. Provides capability for descriptive analytics
2. Provides capability for predictive analytics
3. Provides capability for prescriptive analytics
Simulation can address issues at the design stage before the new system exists.
Simulation can help convert strategic aims into reality. Simulation can help specify how work
should be done to successfully operate a system and specify what tasks and what resources are
needed. Addressing the operational issue of how work will be done enables specific, workable
implementations to be designed.
3
Modelling and Simulation
UNIT2
2.1 Definitions
The word ‘modelling’ has a meaning that is reasonably confined in its general usage,
the same cannot be said for the word ‘simulation’. Nevertheless, the phrase ‘modelling
and simulation’ does have an accepted meaning and implies two distinct activities.
The modelling activity creates an object (i.e. a model) that is subsequently used as a
vehicle for experimentation. This experimentation with the model is the simulation
activity, the experimentation is carried out by a computer program.
The word ‘simulation’ is sometimes used as a noun to imply a specialized computer
program (‘A simulation has been developed for the proposed system’). It is also
used frequently as an adjective (‘The simulation results indicate that the risk of
failure is minimal’), to measure the effectiveness for simulation programming’).
1
Modelling and Simulation
proposing as a possible solution the restriction of these large-tank vehicles to two
designated lanes. The goal of the modelling and simulation project would be to
determine if this strategy would improve the flow of vehicles through the station.
• Upon arrival, drivers always choose the shortest queue. In the case where two or more
queues have the same length, a random choice is made. An exception is when it is
observed that a customer in one of the ‘shortest queues’ is in the payment phase of the
transaction in which case that queue is selected by the arriving driver.
• One or two attendants are available to serve the customers. The service activity has
three phases. During the first phase, the attendant determines the customer’s
requirement and begins the pumping of gas (shut off when the amount has been
delivered or the tank is full). Phase two is the delivery phase during which gas continues
to be pumped until delivery is completed. Phase three is the payment phase. The
duration of phase two is reasonably long, and an attendant typically has sufficient time
either to begin a new phase one (serving a newly arrived customer) or to return to handle
the phase three (payment) activity for a customer whose gas delivery is complete. The
protocol is to give priority to a payment function before serving a newly arrived
customer. It is standard practice for the payment function to be carried out by the same
attendant who initiated the transaction. The above text can be regarded as the initial
phase in the modelling and simulation project. It corresponds to a problem description.
2
Modelling and Simulation
UNIT3
1
Modelling and Simulation
around differential equation models) and the discrete event (process design problems
incorporating stochastic phenomenon and queuing models).
3.3 Simulators
• A simulator can be viewed as a device that replicates( )يستنسخthose operational
features of some particular system that are deemed( )يعتبرto be important for the
training of operators of that system.
• The use of simulators has spread into a wide range of domains, for example, there exist
power plant(معمل- )مصنعsimulators (both nuclear and fossil), battlefield(-ميدان القتال
)معتركsimulators, air traffic control simulators and (human) patient simulators.
• The fundamental requirement of any simulator is the replication of system behaviour
within a physical environment that is as realistic as possible from the perspective of
an operator. Although the simulator incorporates(يضم- )يشملsome physical features
of the system, substantial components of the system exist only in the form of models.
• The development of a simulator can be viewed as a modelling and simulation
project; whose goal is to achieve an effective training environment.
• Simulators can contribute in a variety of ways to enhancing the educational
experience of students especially in circumstances(الوضع المالي- )ظرفwhere
alternatives are precluded(يعرقل-يقيد-يحدد-( )يمنعe.g. by budgetary constraints) or
alternatively when the devices being examined are either ‘hypothetical’ or are no
longer available in the marketplace. The areas of computer organization and operating
systems are well suited to this application,
There are a variety of reasons why experimentation directly with it could be inappropriate.
For example, such experimentation might be:
Too costly
2
Modelling and Simulation
Too dangerous
Too time-consuming
Too disruptive(مخرب-معطل-)مشوش
Morally/ethically unacceptable
Irreversible
3
Modelling and Simulation
UNIT4
• Some models are dynamic while others are static. A linear programming model for
establishing the best operating point for some enterprise under a prescribed set of
conditions, is a static model because there is no notion of time dependence embedded
in such a model formulation. Likewise, the use of tax software to establish the amount
of income tax payable by an individual to the government can be regarded as the
process of developing a (static) model of one aspect of that individual’s financial
affairs for the particular taxation year in question. The essential extension in the case
of a dynamic model is the fact that it incorporates the notion of ‘evolution over time’.
1
Modelling and Simulation
4.2 Exploring the Foundations
4.2.1 The Observation Interval
• A modelling and simulation project has two main constituents(عنصر-)مكون. The most
fundamental is the underlying ‘system context’, namely, the dynamic system whose
behaviour is to be investigated (SUI). The second essential constituent is the goal for
the project; this has a significant impact on the manner in which the model is
formulated and the experiments carried out with it. A subordinate, but important, third
constituent is the observation interval which is the interval of (simulated) time over
which the behaviour of the SUI is of interest. Often, the specification of this interval,
which we denote by Io, is clearly apparent in the statement of the project goal.
• The starting point of this interval (its left boundary) almost always has an explicitly
specified value. The endpoint (the right boundary) may likewise be explicitly specified,
but it is not uncommon for the right boundary to only be implicitly specified.
• The case where a service facility (e.g. a grocery store) closes at a prescribed time (say
9:00 p.m.) provides an example of an explicitly specified right boundary. Similarly, a
study of the morning peak-period traffic, by definition, to terminate at 10:00 a.m.
Consider, on the other hand, a study of a manufacturing facility that is intended to
end when 5,000 widgets( )منتجhave been produced. Here the right-hand boundary of
the observation interval is known only implicitly. Likewise, consider a study of the
performance of a dragster. Here a simulation experiment ends when the dragster
crosses the finish line of the racing track.
• Another case of implicit determination occurs when the right-hand boundary is
dependent on some integrity condition on the data that is being generated by the
model’s execution. The most typical such situation occurs when there is a need to wait
for the dissipation of undesired transient effects. Data collection cannot begin until this
occurs. As a result, what might be called the ‘data collection interval’ has an uncertain
beginning. The situation is further complicated by the fact that the duration of the data
collection interval (once it begins) is likewise uncertain because of the difficulty in
predicting when sufficient data of suitable ‘statistical quality’ has been accumulated.
2
Modelling and Simulation
4.2.2 Entities and Their Interactions
• Within the modelling and simulation context, dynamic behaviour is described in
terms of the interactions (over time) among some collection of entities that populates
the space that the SUI embraces. The feature of these interactions that is of particular
interest is the fact that they produce change.
• The entities fall into two broad types, one permanent (intrinsic(جوهرى- )أساسيto the
SUI itself) and the other transient. Certain aspects of this environment have an impact
upon the behaviour that is of interest and these need to be identified.
• Some of these aspects(وجه- )مظهرmap onto transient entities. Examples here are the
ships that arrive at a port within the context of a port model developed to evaluate
strategies for improving the port’s operating efficiency or alternately, the features of
a roadway (curves, bumps ) التعرجات والمطباتwithin the context of a model being used
to evaluate high-speed handling and stability properties of automobiles.
• Interaction among entities can occur in many ways. Frequently, this interaction
occurs because the entities compete for some set of limited resources e.g. servers
(banks, gas stations, restaurants), transport services (cranes, trucks, tugboats) or health
services (ambulances, operating rooms, doctors/nurses). This competition can give rise
to a type of entity (called a queue) in which some entities are obliged to wait for their
respective turn to access the resources.
3
Modelling and Simulation
UNIT5
2
Modelling and Simulation
UNIT6
1
Modelling and Simulation
experimentation process relating to the parameter variations together with the
identification of the output that produce, during experimentation, the data required
for analysis and evaluation. The project goal and the associated strategies have a
fundamental impact upon model development and must, be regarded as prerequisites
to that development process.
3
Modelling and Simulation
UNIT7
7.1 Introduction
7.1.1 Exploring Structural and Behavioural Requirements
Customers arrive in the department store and generally intend to make purchases at
various merchandise areas (departments) of the store. At each such area, a customer
browses/shops and may or may not make one or more selections to purchase. If selections
are made, they are paid for at one of several service desks located within the area.
Following each visit to a merchandise area, customers either move to another
department or, when their shopping task is completed, they leave the store.
In this fragment of the description, each customer corresponds to an entity which we
might reasonably regard as a type of
‘consumer’ entity (generalization is,
in fact, an abstraction step).
In a similar way, we could regard
each of the service desks within the
various merchandise areas as a
resource entity as the consumer
(customers) need to access these
resource in order to complete their
purchase transactions.
Because the service at the resource
has a finite duration, there is a
possibility that some customer may
not receive immediate attention upon
arrival at the resource because it is
‘busy’ serving other customers.
Hence, it is reasonable to associate a
queue entity with each resource
where customer can wait for their
turn to access the resource.
The merchandise areas where
customers evaluate merchandise Behaviour of three department store shoppers
(with possibly making a purchase) are
distinctive. On one hand, each can be regarded simply as a ‘holding’ area for a
collection of consumer (customers). With this perspective, a merchandise area can be
represented as a particular type of aggregate which we call a group (unordered
collection of entities). On the other hand, a merchandise area is a prerequisite for an
activity called ‘shopping’. Hence, it has features of a resource. In effect, then, the
merchandise areas within the department store have a dual role.
1
Modelling and Simulation
Figure shows a possible interaction scenario for three shoppers all of whom enter
shopping area 1 upon their arrival. The three shoppers (called A, B and C) arrive in
the store at times A0, B0 and C0, respectively, and leave the store at times A5, B7 and C3,
respectively. There are a number of important observations that can be made about
Fig, Notice, in particular, that some type of transition occurs at each of the time points
such activities are (Shopping, Waiting in Queue, and Service at Desk)
,
Behaviour of three department store shoppers
2
Modelling and Simulation
UNIT8
1
Modelling and Simulation
To illustrate, we consider the department store example introduced earlier. Recall the SUI
includes customers who shop in merchandise areas (three are available), possibly making
selections, paying for them at service desks (one is available in each department) and then
(possibly) moving on to another merchandise area. A structural diagram representation of
the entities appropriate for the department store example is given in Fig. Note that a
collection of three shopping areas is shown, each of which has a service desk and a line
(a queue of customers) in front of this desk. The Customer entities belong to a category
with scope = Transient and representative instances are shown by shaded circles.
2
Modelling and Simulation
UNIT9
1
Modelling and Simulation
• The generic representation for an activity is shown in Fig. a. It consists of a starting
event and a terminating event which are separated by a duration. As previously
pointed out, an event has two fundamental attributes, namely, its event time (the time
of its occurrence) and its status change specification (SCS) which is a specification of
its impact upon the model’s status. Figure b makes explicit the two attributes of each
of the events.
2
Modelling and Simulation
Examples
Activities:
• Serving: This activity represents the serving of a customer.
Activity: Berthing
starting event
• iC.Tanker ← SP.RemoveQue(Q.BerthingList) //status
• iC.Tanker.totalWait +← (t – iC.Tanker.startWait) //time
terminating event
• SP.InsertGrp(RG.Berths, iC.Tanker) //status
• SP.StartSequel(Loading, iC.Tanker) //status
Actions
• While activities serve to capture the various relevant tasks that are carried out within
the SUI, an action simply provides the means for characterizing relevant events that
are not embedded within activities. Because an action is simply an event, it unfolds at
a single point in time and consequently the concept of ‘instances’ is not meaningful.
• There are three types of action called the scheduled action, the scheduled sequel action
and the conditional action. The scheduled action consists of a particular event that is
scheduled at one or more points in time. The scheduled sequel action allows the
scheduling of an action at some time point in ‘the future’. The conditional action
corresponds to a conditional event.
Examples
• Actions:
Arrivals: This scheduled action generates the input entity stream of
customers.
StaffChange: The change in the number of employees behind the counter.
TankerArrival: This scheduled action generates the input entity stream of
tankers. With each arrival, tanker attribute values are assigned and the
tanker entity is placed into the Q.BerthingList entity.
7.5 Behavioural View
The entity of any particular becomes involved in a sequence of activity. This involvement
is an important behavioural feature. It is helpful to have a high-level presentation of this
essential feature. This presentation is called a life cycle diagram for the entity, which
provides the behavioural diagram for the project.
Each activity in a life cycle diagram is shown as a labelled rectangle. There are several
possible circumstances whereby an entity can transit from an activity A to an activity B.
Often, this transition encounters a delay. This delay can occur because of inhibiting
3
Modelling and Simulation
preconditions and we indicate this possible delay with a circle which we call a wait point.
The transition will ultimately be to the one whose precondition first becomes TRUE. Fig1.
There are two distinct possibilities as shown in Fig. In Fig a, the implication is that the
transition is direct because B is a sequel activity. In Fig. b, the divided circle is intended to
imply that the transition is direct even though B has a precondition.
Example
The Figure illustrates a life cycle diagram for the
Customer entity in the department store example.
The Customer entity category has scope = Transient
which implies that there is an entity stream
exogenous input which in turn implies the need for
an action (called Arrival). Upon arrival, the
Customer engages in the shopping activity in some
department. Shopping in any particular department
may not result in a purchase (hence, no payment
activity is required). In this circumstance, the
Customer may either leave the store or move on to
another department to continue shopping. If a
purchase is made, then the payment activity takes place followed (possibly) by further
shopping in another department or exit from the store.
4
Modelling and Simulation
UNIT10
2. Each tanker must wait until all previously arrived tankers have been berthed by the
tug. When the tug becomes available for berthing, the tug moves the tanker from the
harbour entrance to the berth.
3. The loading procedure starts as soon as the berthing operation is complete at which
time the tug is released to carry out its next task. When the loading is completed, the
tanker is added to the end of a second list of tankers needing to be deberthed.
4. Each loaded tanker must wait until all previously loaded tankers have been deberthed.
When the tug becomes available for deberthing, the tug moves the tanker from the
berth back to the harbour entrance and the tanker leaves the port.
2
Modelling and Simulation
Structural View
• The structural diagram shows the entities used to represent the tankers, tug, berths and
lists used by the harbour master.
Entity Categories
• BerthingList: A queue of empty tankers waiting to be berthed by the tug.
• DeberthingList: A queue of tankers loaded with oil ready for deberthing.
• Tug: A single resource that berths and deberths the tankers as it travels between the
harbour and berths.
• Berths: A resource group that represents the set of berths used for loading the tankers
with oil. The attribute numBerths of this entity is a parameter.
• Tanker: A consumer representing the tankers. Because of the transient existence of
tankers within the model, this entity has scope = Transient.
Behavioural View
Actions:
• TankerArrival: This scheduled action generates the input entity stream of tankers. With
each arrival, tanker attribute values are assigned and the tanker entity is placed into the
Q.BerthingList entity.
Activities:
• Berthing: This activity represents the Tug entity towing an empty Tanker entity from the
harbour to the berths.
• Deberthing: This activity represents the Tug entity towing a loaded Tanker entity from
the berths to the harbour (at which point the Tanker entity leaves the model).
• MoveToBerths: This activity represents the Tug entity moving to the berths area with no
Tanker entity in tow.
• MoveToHarbour: This activity represents the Tug entity moving to the harbor with no
Tanker entity in tow.
• Loading: This activity represents the loading of a Tanker. This is a sequel activityand is
initiated at the completion of the Deberthing activity.
3
Modelling and Simulation