0% found this document useful (0 votes)
9 views21 pages

Simulation and Modeling (Unit - 5)

The document discusses Simulation and Modeling, focusing on the Program Evaluation and Review Technique (PERT) and the Critical Path Method (CPM) for project management. It explains how PERT networks model uncertain task durations and outlines the steps to identify the critical path, emphasizing the importance of resource allocation and uncertainty in activity duration. Additionally, it covers simulation languages and Object-Oriented Simulation (OOS), highlighting their features and applications in various fields.

Uploaded by

faraz.ali.acet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views21 pages

Simulation and Modeling (Unit - 5)

The document discusses Simulation and Modeling, focusing on the Program Evaluation and Review Technique (PERT) and the Critical Path Method (CPM) for project management. It explains how PERT networks model uncertain task durations and outlines the steps to identify the critical path, emphasizing the importance of resource allocation and uncertainty in activity duration. Additionally, it covers simulation languages and Object-Oriented Simulation (OOS), highlighting their features and applications in various fields.

Uploaded by

faraz.ali.acet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Simulation and Modeling(Unit -5)

------------------------------------------------------------------------------------
Simulation of PERT Network in Simulation and Modeling
Program Evaluation and Review Technique (PERT) is a project management tool
used to schedule, organize, and coordinate tasks within a project. In simulation,
PERT networks help in modeling uncertain task durations.

What is a PERT Network?


A PERT network is a probabilistic model that assumes activity times are random
variables.
It uses three-time estimates for each activity:
Optimistic time (a): The shortest possible time to complete the activity.
Pessimistic time (b): The longest time to complete the activity.
Most likely time (m): The most likely time to complete the activity under normal
conditions.
Critical Path Method for Project management
Critical Path Method (CPM) is a method used in project planning, generally for
project scheduling for the on-time completion of the project. It helps in the
determination of the earliest time by which the whole project can be completed.
There are two main concepts in this method namely critical task and critical
path.

What is a Critical task in project management?


It is the task/activity that can’t be delayed otherwise the completion of the entire
project will be delayed. It must be completed on time before starting the other
dependent tasks.

What is the Critical path in project management?


It is a sequence of critical tasks/activities and is the largest path in the project
network. It gives us the minimum time which is required to complete the entire
project. The activities in the critical path are known as critical activities and if
these activities are delayed then the completion of the entire project is also
delayed.
Benefits of using the critical path method in project management:
Show the project schedule visually.
Highlight important tasks with CPM.
Use CPM to find and handle risks.

CPM helps the project team communicate better.


How to find the critical path in a project:
Step 1: Identify all tasks required to complete the project
Step 2: Determine the sequence of tasks
Step 3: Estimate the duration of each task
Step 4: Draw a network diagram
Step 5: Identify the critical path
Step 6: Calculate the float
Step 7: Monitor the critical path
The table given below contains the activity label, its respective duration (in
weeks), and its precedents. We will use the critical path method to find the
critical path and activities of this project.
Rules for Designing the Activity-on-Node network diagram:
A project network should have only one start node
A project network should have only one end node
A node has a duration
Links normally have no duration
“Precedents” are the immediately preceding activities
Time moves from left to right in the project network
A network should not contain loops
A network should not contain dangles
Node Representation:

Activity label is the name of the activity represented by that node.


Earliest Start is the date or time at which the activity can be started at the
earliest.
Earliest Finish is the date or time at which the activity can be completed at the
earliest.
Latest Start is the date or time at which the activity can be started at the latest.
The latest Finish is the date or time at which the activity can be finished at the
latest.
Float is equal to the difference between the earliest start and latest start or
earliest finish and latest finish.

Forward Pass in Critical path in project management:


The forward pass is carried out to calculate the earliest dates on which each
activity may be started and completed.

Activity A may start immediately. Hence, the earliest date for its start is zero i.e.
ES(A) = 0. It takes 6 weeks to complete its execution. Hence, earliest it can finish is
week 6 i.e. EF(A) = 6.
Activity B may start immediately. Hence, the earliest date for its start is zero i.e.
ES(B) = 0. It takes 4 weeks to complete its execution. Hence, the earliest it can
finish is week 4 i.e. EF(B) = 4.
Activity F may start immediately. Hence, the earliest date for its start is zero i.e.
ES(F) = 0. It takes 10 weeks to complete its execution. Hence, the earliest it can
finish is week 10 i.e. EF(F) = 10.
Activity C starts as soon as Activity A completes its execution. Hence, the earliest
week it can start its execution is week 6 i.e. ES(C) = 6. It takes 3 weeks to complete
its execution. Hence, the earliest it can finish is week 9 i.e. EF(C) = 9.
Activity D starts as soon as Activity B completes its execution. Hence, the earliest
week it can start its execution is week 4 i.e. ES(D) = 4. It takes 4 weeks to complete
its execution. Hence, the earliest it can finish is week 8 i.e. EF(D) = 8.
Activity E starts as soon as Activity B completes its execution. Hence, the earliest
week it can start its execution is week 4 i.e. ES(E) = 4. It takes 3 weeks to complete
its execution. Hence, the earliest it can finish is week 7 i.e. EF(E) = 7.
Activity G starts as soon as activity E and activity F completes their execution.
Since the activity requires the completion of both for starting its execution, we
would consider the MAX(ES(E), ES(F)). Hence, the earliest week it can start its
execution is week 10 i.e. ES(G) = 10. It takes 3 weeks to complete its execution.
Hence, the earliest it can finish is week 13 i.e. EF(G) = 13.
Activity H starts as soon as activity C and activity D completes their execution.
Since the activity requires the completion of both for starting its execution, we
would consider the MAX(ES(C), ES(D)). Hence, the earliest week it can start its
execution is week 9 i.e. ES(H) = 9. It takes 2 weeks to complete its execution.
Hence, the earliest it can finish is week 11 i.e. EF(H) = 11.
Backward Pass in Critical path in project management:
The backward pass is carried out to calculate the latest dates on which each
activity may be started and finished without delaying the end date of the project.
Assumption: Latest finish date = Earliest Finish date (of project).

Activity G’s latest finish date is equal to the earliest finish date of the precedent
activity of finish according to the assumption i.e. LF(G) = 13. It takes 3 weeks to
complete its execution. Hence, the latest it can start is week 10 i.e. LS(G) = 10.
Activity H’s latest finish date is equal to the earliest finish date of the precedent
activity of finish according to the assumption i.e. LF(H) = 13. It takes 2 weeks to
complete its execution. Hence, the latest it can start is week 11 i.e. LS(H) = 11.
The latest end date for activity C would be the latest start date of H i.e. LF(C) = 11.
It takes 3 weeks to complete its execution. Hence, the latest it can start is week 8
i.e. LS(C) = 8.
The latest end date for activity D would be the latest start date of H i.e. LF(D) = 11.
It takes 4 weeks to complete its execution. Hence, the latest it can start is week 7
i.e. LS(D) = 7.
The latest end date for activity E would be the latest start date of G i.e. LF(G) = 10.
It takes 3 weeks to complete its execution. Hence, the latest it can start is week 7
i.e. LS(E) = 7.
The latest end date for activity F would be the latest start date of G i.e. LF(G) = 10.
It takes 10 weeks to complete its execution. Hence, the latest it can start is week 0
i.e. LS(F) = 0.
The latest end date for activity A would be the latest start date of C i.e. LF(A) = 8. It
takes 6 weeks to complete its execution. Hence, the latest it can start is week 2 i.e.
LS(A) = 2.
The latest end date for activity B would be the earliest of the latest start date of D
and E i.e. LF(B) = 7. It takes 4 weeks to complete its execution. Hence, the latest it
can start is week 3 i.e. LS(B) = 3.

Identifying Critical Path: The critical path is the path that gives us or helps us
estimate the earliest time in which the whole project can be completed. Any delay
to an activity on this critical path will lead to a delay in the completion of the
entire project. To identify the critical path, we need to calculate the activity float
for each activity. Activity float is the difference between an activity’s Earliest start
and its latest start date or the difference between the activity’s Earliest finish and
its latest finish date, and it indicates how much the activity can be delayed
without delaying the completion of the entire project. If the float of an activity is
zero, then the activity is critical and must be added to the critical path of the
project network. In this example, activities F and G have zero float and hence, are
critical activities.

Uncertainty in Activity Duration


In simulation and modeling, particularly when dealing with project management
or systems that involve activities over time, the duration of activities is often
uncertain. This uncertainty can be due to various factors like unpredictable delays,
variability in the resources available, or unexpected changes in the environment.
Understanding and managing this uncertainty is crucial for creating realistic
simulations.
When modeling such scenarios, we do not always know the exact time an activity
will take. Instead, we estimate the duration using probability distributions to
represent the uncertainty.
Types of Uncertainty in Activity Duration:
Deterministic Duration:
When the duration of an activity is known with certainty.
Example: An activity that always takes exactly 5 days to complete.
Probabilistic Duration:
When the duration is not fixed and can vary.
Example: An activity might take between 3 to 7 days, depending on various
factors.
Random Variables and Probability Distributions:
To model uncertainty in activity duration, we often use random variables that
follow specific probability distributions (such as Normal, Uniform, or Exponential
distributions).
These distributions help in estimating the range and likelihood of possible
durations for an activity.
Common Probability Distributions Used for Activity Duration:
Uniform Distribution:
Assumes that all durations within a given range are equally likely.
Example: If an activity can take anywhere between 4 to 8 days, and each duration
(4, 5, 6, 7, 8) is equally probable.
Normal Distribution:
Assumes that the most likely duration is in the middle of the range, with
deviations happening less frequently on either side.
Example: An activity is expected to take 10 days on average, but in some cases, it
may take as little as 8 or as many as 12 days.
Exponential Distribution:
Often used when the likelihood of an activity taking longer decreases
exponentially.
Example: The probability that a machine will break down decreases the longer it
has been running.
Resource Allocation and Consideration
1.Introduction-In simulation and modeling, resource allocation refers to the
process of distributing available resources (such as machines, staff, time, and
materials) to various tasks, activities, or entities in a system. Resource allocation is
crucial to ensure that the simulated system operates efficiently and meets its
objectives.
In simulation, resources are limited, and tasks or entities in the model may
compete for these resources. The main challenge is to allocate resources in a way
that maximizes efficiency while minimizing delays and costs.

Key Terms:
Resource: An item or entity that is needed to perform a task or activity in the
simulation. For example, machines, vehicles, or workers.
Entities: The objects or individuals requiring resources to complete their tasks.
Queue: A line where entities wait until resources are available.
Utilization: The percentage of time a resource is in use.
2. Considerations for Resource Allocation in Simulation:
While allocating resources in simulation models, certain factors need to be
considered:
Availability of Resources: Resources must be available in sufficient quantity to
meet demand.
Capacity Limitations: Each resource has a capacity, such as the number of people
or amount of time it can provide.
Priority Rules: Certain entities may have priority over others for accessing
resources. For example, emergency tasks may be given priority over regular tasks.
Bottlenecks: A bottleneck occurs when the demand for a resource exceeds its
availability, leading to delays and inefficiencies.
3. Strategies for Resource Allocation:
There are different strategies for allocating resources in simulation models:
First Come, First Served (FCFS): Entities are served in the order they arrive.
Shortest Processing Time (SPT): Entities with the shortest processing time are
given priority.
Priority-Based Allocation: Resources are allocated based on the priority of the
tasks or entities.
4. Resource Allocation Example in Simulation:
Example Scenario: Consider a manufacturing plant with three machines (M1, M2,
and M3) that produce parts. Each machine has a specific time to process a part,
and there are multiple orders that need to be completed.
Machine M1 takes 5 minutes to process a part.
Machine M2 takes 3 minutes.
Machine M3 takes 7 minutes.
There are 10 orders waiting for processing.
In this simulation model, the plant manager must decide how to allocate these
machines to maximize throughput and minimize waiting time.

Simulation Languages
In the field of simulation and modeling, simulation languages are specialized
programming languages or tools designed specifically for creating and running
simulation models. These languages help model complex systems, handle discrete
events, and simulate real-world scenarios more efficiently than general-purpose
programming languages like C++ or Java.

Simulation languages provide built-in functionalities for:


Handling events over time.
Managing queues and resources.
Visualizing simulation processes.
Gathering statistical data from simulation runs.
Features of Simulation Languages:

Key features of simulation languages include:

Event Handling: Simulation languages are designed to easily manage and simulate
events happening at different time intervals.
Random Number Generation: Most simulations require the generation of random
variables, which these languages support natively.
Time Flow Management: They provide control over how time is advanced in the
simulation (e.g., step-wise or event-driven).
Statistical Reporting: Simulation languages include tools to collect data such as
throughput, resource utilization, and waiting times, which can be used to analyze
system performance.

Some simulation languages include:


GPSS: A popular discrete simulation language
SIMSCRIPT: A popular discrete simulation language
GASP: A popular discrete simulation language
SIMULA: A popular discrete simulation language in Europe
SLX: A modern simulation language
SIMAN: A modern simulation language that has been integrated into ARENA
MANSim: A language that can be used to evaluate the performance of flooding
algorithms

Object-Oriented Simulation
Object-Oriented Simulation (OOS) combines object-oriented programming (OOP)
principles with simulation modeling. In OOS, the system is modeled as a collection
of interacting objects, each representing a distinct entity or component within the
system. These objects have their own attributes (data) and behaviors (methods),
making it easier to model complex systems with reusable and modular code.

Concepts in Object-Oriented Simulation:


Objects: Entities in the system with properties and behaviors. For example, in a
traffic simulation, cars, traffic lights, and roads can all be objects.
Classes: Blueprints for creating objects. Each object is an instance of a class.
Inheritance: A mechanism that allows one class to inherit attributes and methods
from another class. This supports code reuse.
Encapsulation: Objects hide their internal details and expose only necessary
functionality, improving modularity.
Polymorphism: Objects of different types can be treated as instances of the same
class through interfaces, allowing flexible behavior based on context.

Advantages of Object-Oriented Simulation:


Modularity: Each object is a self-contained unit, which makes it easier to manage
and modify.
Reusability: Objects and classes can be reused across different models, reducing
development time.
Extensibility: New objects can be easily added or modified without affecting the
rest of the model.
Abstraction: The system can be broken down into smaller, more understandable
components, improving the clarity of complex simulations.

Applications of Object-Oriented Simulation:


OOS is widely used in various fields, including:
Manufacturing Systems: Simulating production lines, machines, and products as
interacting objects.
Traffic Simulation: Vehicles, roads, and traffic lights can be modeled as objects.
Healthcare Systems: Patients, doctors, and medical equipment can be simulated
as objects, allowing the study of patient flow and resource utilization.
Supply Chain Simulation: Objects like suppliers, warehouses, and products
interact to optimize supply chain efficiency.

Object-Oriented Simulation Example:


Let's take an example of simulating a hospital system. In this model, objects
include patients, doctors, and nurses.
Step-by-Step Example:

Class Definitions:
Class Patient: Represents a patient with attributes like ID, illness type, and
treatment time.
Class Doctor: Represents a doctor with methods to treat patients.
Class Nurse: Represents a nurse who assists with patient care.
class Patient:
def __init__(self, patient_id, illness_type):
self.patient_id = patient_id
self.illness_type = illness_type
self.treatment_time = 0
def set_treatment_time(self, time):
self.treatment_time = time

class Doctor:
def __init__(self, doctor_id, specialization):
self.doctor_id = doctor_id
self.specialization = specialization

def treat_patient(self, patient):


if self.specialization == patient.illness_type:
patient.set_treatment_time(30) # Assume treatment time is 30 minutes
for correct specialization
else:
patient.set_treatment_time(60) # Longer treatment time for non-
specialized cases

class Nurse:
def __init__(self, nurse_id):
self.nurse_id = nurse_id

def assist(self, patient):


print(f"Nurse {self.nurse_id} assisting Patient {patient.patient_id}")

Simulating the Interaction:


# Creating instances of patients, doctors, and a nurse
patient1 = Patient(1, 'cardiology')
doctor1 = Doctor(1, 'cardiology')
nurse1 = Nurse(1)

# Doctor treats the patient


doctor1.treat_patient(patient1)

# Nurse assists the patient


nurse1.assist(patient1)

# Output treatment time


print(f"Patient {patient1.patient_id} treatment time: {patient1.treatment_time}
minutes")

Output:
Nurse 1 assisting Patient 1
Patient 1 treatment time: 30 minutes
Key Considerations in Object-Oriented Simulation:
Object Interactions: Understanding how objects (entities) interact with
each other is crucial. In the hospital example, patients interact with
doctors and nurses.
State Management: Objects may change state during the simulation.
For example, a patient’s state may change from waiting to being
treated.
Time Progression: OOS can be event-driven, where objects change their
state based on events that occur at specific times.
-------------------------------------------------------------------------------------------

You might also like