0% found this document useful (0 votes)
19 views31 pages

Week#6

Uploaded by

154 ahmed ehab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views31 pages

Week#6

Uploaded by

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

Progress: 3%

FACULTY OF ENGINEERING
CAIRO UNIVERSITY

MDP403x – Simulation Modeling and Analysis


for Production systems
Week#6-Data-driven modeling
Ahmed Sakr, PhD

2024-02-09 Simulation Modeling and Analysis for Production systems 1


Progress: 6%

Contents
I. Introduction to Data-driven modeling
II. Preparing and using data in Data-driven modeling
III. Database in AnyLogic
IV. Utilizing database in AnyLogic
V. Manufacturing system model

2024-02-09 Simulation Modeling and Analysis for Production systems 2


Progress: 10%

I. Introduction to Data-driven modeling


Problem (Example): build a simulation model for the following system:
• 50 non-identical equipment
• 20 different product with different processing steps among the equipment
• Some steps may need a rework according to a certain probability

Solution through process modeling:


• Build the model with a single station for each equipment
• Define a sequence for each product

More practical solution:


• Define how processes generally are done by equipment
• Let the model acquire processing details from an external input data file

2024-02-09 Simulation Modeling and Analysis for Production systems 3


Progress: 13%

I. Introduction to Data-driven modeling


Why - Purpose: modeling complex and/or big systems
• Modeling complex entity sequence of processes
• Seeking more compact and easier to update models
• Controlling models parameters through a database

How - Process: Data-driven modeling and data structuring


Why • Important modeling components for data-driven
• Data file(s) structuring
How
What - Outcome: A compact easily configurable model
What • Complex systems modeling with a compact model
• Possible functionalities
• Possible modifications done through the data

2024-02-09 Simulation Modeling and Analysis for Production systems 4


Progress: 16%

I. Introduction to Data-driven modeling


A big system: Has a large number of resources.
Example: Hundreds of machines, thousands of possible processes
• Has many products with different process flows or sequence of
process
• When building a model, there are 2 main tasks to be done:
• Define the Model logic and build it through the available blocks.
Example: source, seize, delay,…etc
• How agent are created, routed, processed, ..etc.
• Define the Modeling parameters and insert them through model’s
database and use them through agent parameters or functions

Why the conventional way is not practical for big models?

2024-02-09 Simulation Modeling and Analysis for Production systems 5


Progress: 19%

I. Introduction to Data-driven modeling


• Having a data-driven model for a specific model with certain parameters:

• Makes you able to focus only on creating the Model logic


• Lets a limited number of blocks
• for example, simulate a general processing scenarios
General processing scenario + data → specific scenario for each agent/entity

• When parameters are changing:


Different parameters + data-driven → no remodeling or reconfiguring is needed
More practical and time/effort saving for big models

• Another important advantage: a compact model is easy to verify and debug if


any logical errors are found

2024-02-09 Simulation Modeling and Analysis for Production systems 6


Progress: 23%

II. Preparing and using data in Data-driven modeling


• In this section, we will explore how to build a data-driven model through an
example for a production system.
• The production system process different products according to their process
flow.
StepID P1Process P1ProcessID P2Process P2ProcessID P3Process P3ProcessID P4Process P4ProcessID
• The system has a number of 1 Pr491
2 Pr601
17 Pr601
9 Pr577
9 Pr772
12 Pr375
19 Pr370
24 Pr359
29
15
processes with different 3 Pr172
4 Pr601
20 Pr380
9 Pr946
6 Pr380
5 Pr54
6 Pr841
13 Pr380
1
6
processing times 5 Pr525
6 Pr371
28 Pr54
30 Pr841
13 Pr946
1 Pr841
5 Pr13
1 Pr812 25
8

7 Pr432 18 Pr13 8 Pr812 25 Pr772 19


Process flow → 8 Pr772 19 Pr491 17 Pr491 17 Pr883 23
9 Pr155 10 Pr380 6 Pr380 6 Pr841 1
processing steps 10 Pr798 14 Pr155 10 Pr370 29 Pr172 20
11 Pr370 29 Pr608 21 End 0 Pr13 8
12 End 0 Pr375 24 Pr221 27
13 Pr608 21 Pr372 16
14 Pr370 29 Pr491 17
15 End 0 Pr13 8
16 Pr54 13
17 Pr841 1
18 End 0
2024-02-09 Simulation Modeling and Analysis for Production systems 7
Progress: 26%

II. Preparing and using data in Data-driven modeling


• System resources: 14 different
equipment of single capacity
• Each process have an equipment to be Eqm ID Equipment name Capacity Speed factor Uptime (days) DownTime(days)

utilized 1 Eqm _A
2 Eqm _B
1
1
1.3 weibull(10,5,0)
1 weibull(8,6,0)
weibull(1,2.5,0)
weibull(2,2.3,0)
3 Eqm _C 1 1.3 weibull(10,4,0) weibull(1.2,1.5,0)
• Each equipment has a speed factor, 4 Eqm _D
5 Eqm _E
2
1
0.95 weibull(7.5,3,0)
1.3 weibull(6,4.2,0)
weibull(3,2.5,0)
weibull(1.6,2.8,0)
making the process faster or slower 6 Eqm _F
7 Eqm _G
1
1
1 weibull(12,6.5,0)
1 weibull(14,4,0)
weibull(1.7,2.4,0)
weibull(3.6,1.5,0)
than the normal standard processing 8 Eqm _H
9 Eqm _I
1
1
1.05 weibull(6,3,0)
1 weibull(7,4,0)
weibull(1.5,3,0)
weibull(4,1.9,0)
time. 10 Eqm _J
11 Eqm _K
2
1
0.7 weibull(3,2.5,0)
1 weibull(15,4.5,0)
weibull(3.7,1.3,0)
weibull(3.2,1.8,0)

• Each equipment has uptime/downtime 12 Eqm _L


13 Eqm _M
1
2
0.9 weibull(12,4.7,0)
0.8 weibull(19,5,0)
weibull(4.1,2.8,0)
weibull(3.4,1.9,0)

distribution that represents its between 14 Eqm _N 1 1 weibull(17,4.5,0) weibull(3.3,1.7,0)

failures and maintenance times

2024-02-09 Simulation Modeling and Analysis for Production systems 8


Progress: 29%

III. Database in AnyLogic


• To add database to AnyLogic, you need to add the data file
itself to the model’s folder then click on Database.

2024-02-09 Simulation Modeling and Analysis for Production systems 9


Progress: 32%

III. Database in AnyLogic


• Then define the database itself as follows:

2024-02-09 Simulation Modeling and Analysis for Production systems 10


Progress: 35%

III. Database in AnyLogic


• The tables that exist in you data file will appear as shown
below:
• Note that the database can be
updated automatically with
each simulation run.

2024-02-09 Simulation Modeling and Analysis for Production systems 11


Progress: 39%

IV. Utilizing database in AnyLogic


• The agents can be created
and defined according to their
information in the database.

• The number of agents created


will be according to the
number of occurrences in the
datafile.

2024-02-09 Simulation Modeling and Analysis for Production systems 12


Progress: 42%

IV. Utilizing database in AnyLogic


• Here the interarrival is defined according to its value in the
database.

2024-02-09 Simulation Modeling and Analysis for Production systems 13


Progress: 45%

IV. Utilizing database in AnyLogic


• Here the interarrival is defined according to its value in the
database.
This is to execute the expression,
distribution name, which is got
from the database as a string
executeExpression(double.class,selectFrom(gen_info)
.where(gen_info.product.eq("Product 1"))
.uniqueResult(gen_info.interarrival_time_hr))

Get the corresponding The specific row that has


value from the column this value from the The table’s name
named column named “product”
“interarrival_time_hr”

2024-02-09 Simulation Modeling and Analysis for Production systems 14


Progress: 48%

V. Manufacturing system model. Manufacturing system agent


• It is a good practice not to put the main model’s
functionalities in the “main” agent.
• This way, the model becomes more modular
and scalable.

Example: in this model, the manufacturing system


itself is an agent that is responsible for creating
and flowing some products among the available
equipment.
• If the finished products are sent to another
system that we want to simulate as well in the
future, we can do so by adding a new
manufacturing system in the same model.
• This way, the “main” is left for managing and
collecting information from the manufacturing
system agents.

2024-02-09 Simulation Modeling and Analysis for Production systems 15


Progress: 52%

V. Manufacturing system model. Manufacturing system agent


• The source block assigns some
parameters to the created products
upon exiting.

• These parameters are:


• ProductID
• Creation time (current simulation time)

2024-02-09 Simulation Modeling and Analysis for Production systems 16


Progress: 55%

V. Manufacturing system model. Manufacturing system agent


• The exit module assigns the stepID as 1, because the created products
will just go to their first step in their process flow by default.
• Then, the product agent is sent to the enter module by (.take(agent))

2024-02-09 Simulation Modeling and Analysis for Production systems 17


Progress: 58%

V. Manufacturing system model. Manufacturing system agent


• Upon arriving to this enter module, the user-defined function named
“functionGetProcessEqmID” is executed.
• User-defined functions are useful in including long codes to be executed which do
some functionalities such as updating parameters values.

2024-02-09 Simulation Modeling and Analysis for Production systems 18


Progress: 61%

V. Manufacturing system model. Manufacturing system agent


• This function has arguments and just do
actions without returning a value.
• It is argument here is the agent itself
that called it, including all its associated
parameters. This means that all its
parameters are arguments accessible by
the function as well.

• Here we get the processID from the


product’s process flow according to its
productID. Then the corresponding
EqmID that is required for the process is
acquired also from the database.

2024-02-09 Simulation Modeling and Analysis for Production systems 19


Progress: 65%

V. Manufacturing system model. Manufacturing system agent


This is done for ProductID=1 only
similar assignments are done for the
other products also in the elseifs Table’s name:
“Process_flow”

if (unit.par_productID==1){
processID=selectFrom(process_flow)
.where(process_flow.step_id.eq(unit.par_stepID))
.uniqueResult(process_flow.p1_process_id);}

Getting the processID for Specific row according to the


that step for ptoduct1 current stepID

Similarily the eqmID is acquired according to the


processID
unit.set_par_processID(processID); Setting the product agent’s
unit.set_par_eqmID(EqmID);} parameters with the acquired
EqmID and ProcessID
2024-02-09 Simulation Modeling and Analysis for Production systems 20
Progress: 68%

V. Manufacturing system model. Manufacturing system agent


Here we define a variable from the type “Agent_EqmStation”
It means that this variable will contain information for an
agent of the type “Agent_EqmStation”

Agent_EqmStation AgentEqm;
AgentEqm=findFirst(main.agent_EqmStations,
a -> a.par_EqmID ==agent.par_eqmID);
AgentEqm.enterTransferToEqm.take(agent);

Parameter of the Parameter of the


Agent_EqmStation agent_product

Here we try to find, among the


population of agent_EqmStations, the
one that has the EqmID that is required
by the agent product to be processed. Finally, the agent_product is sent to a specific
enter module in the specific Agent_EqmStation
that is got in the previous line

2024-02-09 Simulation Modeling and Analysis for Production systems 21


Progress: 71%

V. Manufacturing system model. Eqm station Agent


• This is the Agent_EqmStation.
• Note: as we have a population of this agent, there are copies of all what we have here
for each individual agent. It means that each agent is working separately with this
block diagram regardless of what is going on with the other Eqm station agents.
• Parameters here are
defined when these agents
are created at the
beginning of simulation
from the database.
• The user-defined functions
are used to avoid writing
long codes within the
blocks.

2024-02-09 Simulation Modeling and Analysis for Production systems 22


Progress: 74%

V. Manufacturing system model. Eqm station Agent


• Each equipment stations has specific number of identical equipment.
• This is defined through the resource pool as shown. Also, the uptime and downtime is
defined from the uptime and downtime parameters..

2024-02-09 Simulation Modeling and Analysis for Production systems 23


Progress: 77%

V. Manufacturing system model. Eqm station Agent


• Seizing 1 unit from the available Equipment.
• If busy, the agent_product will wait in the seize block’s queue.

2024-02-09 Simulation Modeling and Analysis for Production systems 24


Progress: 81%

V. Manufacturing system model. Eqm station Agent


• Delay simulates the processing time which is evaluated according to the process itself.
• The processing time is evaluated through the function “functionGetProcessingTime”.

2024-02-09 Simulation Modeling and Analysis for Production systems 25


Progress: 84%

V. Manufacturing system model. Eqm station Agent


• This function returns a value which is the process time
itself. Defining a string to get the exression of the process time
from the database. It is an expression because it is a time
distribution not an absolute time value

String processExp=
selectFrom(process_information).where(process_information
.process_id.eq(agent.par_processID)).uniqueResult(process
_information.process_time_hr);
double processTime=executeExpression(double.class,
processExp);
return processTime;
From “process_information” table
Execute the >> the specific row that has the
Return the value expression to get a processID got from the agent_product
where the function specific value from according to its current processing step
is called the distribution got >> the corresponding process time from
(in the delay block) in the previous line the “process_time_hr” column

2024-02-09 Simulation Modeling and Analysis for Production systems 26


Progress: 87%

V. Manufacturing system model. Eqm station Agent


• Here, once the agent_product enters, its
stepID is incremented.
• Then the process of that step is checked.
• If the process flow is finished, the processID of
this incremented stepID will be 0.

• Accordingly, the agent_product will be sent to


different exit blocks to be sent to different
places in the manufacturing system agent.

• The processID is got through the function


“functionCheckIFProcessFlowFinished” which
returns true or false.

2024-02-09 Simulation Modeling and Analysis for Production systems 27


Progress: 90%

V. Manufacturing system model. Eqm station Agent


• We check the processID corresponding to the
incremented StepID (next step).
As done before to
get the processID
if (unit.par_productID==1){
processID=selectFrom(process_flow)
.where(process_flow.step_id.eq(unit.par_stepID))
.uniqueResult(process_flow.p1_process_id);}
Return true if
processID ==0
,false otherwise
if (processID==0){
return true;}
{return false;}

2024-02-09 Simulation Modeling and Analysis for Production systems 28


Progress: 94%

V. Manufacturing system model. Eqm station Agent


• If true (process flow is finished), then it is sent to the enter block which is responsible
for exiting the finished products within the manufacturing system agent

2024-02-09 Simulation Modeling and Analysis for Production systems 29


Progress: 97%

V. Manufacturing system model. Eqm station Agent


• If false (process flow is not finished), then it is sent to the enter block which is
responsible for processing products within the manufacturing system agent.
• Accordingly, the agent_product will be sent to the Agent_EqmStation that corresponds
its current processID.

2024-02-09 Simulation Modeling and Analysis for Production systems 30


Progress: 100%

Questions

2024-02-09 Simulation Modeling and Analysis for Production systems 31

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy