690 likes | 932 Views
Chapter 2. Basic Process Modeling February 1, 2010 Frank Matejcik, SDSM&T. About installing Arena. Has anyone else tried? If so, did you have success?. Assignment due 2/9/10 4PM. Do Exercises 1.3, 1.4, and 1.5 individually Submit on paper or as a MSWord *.doc via e-mail.
E N D
Chapter 2 Basic Process Modeling February 1, 2010 Frank Matejcik, SDSM&T
About installing Arena • Has anyone else tried? If so, did you have success?
Assignment due 2/9/10 4PM • Do Exercises 1.3, 1.4, and 1.5 individually • Submit on paper or as a MSWord *.doc via e-mail. • There is no need to submit Arena files or screen captures on this assignment. • Students not submitting by the due date may be required to do an alternative assignment.
Objectives • To be able to define and explain the key elements of process-oriented simulations • To be able to identify entities and their attributes and use them within Arena • To be able to identify, define, and use variables within Arena • To be able to use Arena to perform basic input/output operations • To be able to program flow of control within an Arena model • To be able to understand the programming aspects of Arena including debugging
Basic Definitions • System – A set of inter-related components that act together over time to achieve common objectives. • Parameters – Quantities that are properties of the system that do not change. These are typically quantities (variables) that are part of the environment that the modeler feels cannot be controlled or changed. Parameters are typically model inputs in the form of variables. • System State – A “snap shot” of the system at a particular point in time characterized by the values of the variables that are necessary for determining the future evolution of the system from the present time.
Entities, Attributes, Variables • Variables – Quantities that are properties of the system (as a whole) that change or are determined by the relationships between the components of the system as it evolves through time. • Entity – An object of interest in the system whose movement or operation within the system may cause the occurrence of events. • Attribute – A property or variable that is associated with an entity.
Creating Entities • Time of first arrival, time between arrivals, number of entities created at each arrival, maximum number of arrivals
Poisson Arrival Process • Time between arrivals is exponential with mean equal to 1/arrival rate
Concept of an Entity • An entity is an object created within Arena that has attributes associated with it. You can think of an entity as a record or a row of data that is associated with that particular object instance. Each row represents a different entity. • The IDENT attribute uniquely identifies entities currently in the model. No two entities currently in the model have the same value for the IDENT attribute. • The Entity.SerialNumber attribute is also a unique number assigned to an entity when it is created; however, if the entity is ever duplicated (cloned) in the model, the clones will have the same value for the Entity.SerialNumber attribute.
Different Types of Entities • When you define a user-defined attribute, you are adding another “column” to the “entity table”. The defining of a user-defined attribute associates that attribute with every entity type. • Example: A part may have a processing time attribute and a pallet may have a move time attribute. The type attribute indicates the type of entity (part = 1, pallet = 2). Notice that all entities have the move time and processing time attributes defined. • Arena has a pre-defined attribute, called Entity.Type, which can be used to set the type of the entity. In addition, the user can specify a user defined attribute to indicate the type of the entity.
Entity Module • Entity data module allows the definition of different types of entities and facilitates animation and cost tabulation for an entity type.
Variables • To contrast with entities, variables are a property of the system. A variable is to the system as an attribute is to an entity. • Variables are defined in the VARIABLE data module. • Scalar, 1-D, and 2-D are permitted • An initial value can be specified. • Statistics can be automatically collected on scalar variables
Processing Entities • As entities flow through the model you can think of them engaging in activities/processes, performing operations, or having operations done on them. • Examples • PROCESS • DELAY • HOLD • QUEUE • BATCH • SEPARATE • DECIDE • These concepts and others are represented within Arena with modules.
Examples • Modified pharmacy model • Illustrates attributes, READ/WRITE, RECORD, and ASSIGN modules • Iterative Looping • Illustrates 2-D variables, DECIDE, WHILE-ENDWHILE, EXPRESSION modules, sub-models • Tie-Dye T-Shirts • Illustrates BATCH, SEPARATE, and MATCH modules
Modified Pharmacy Model • Suppose that customers who arrive to the pharmacy have either 1, 2, or 3 prescriptions to be filled. There is a 50% chance that they have 1 prescription to fill, a 30% chance that they have 2 prescriptions to fill, and a 20% chance that they have 3 prescriptions to fill. • The time to service a customer is still exponentially distributed but the mean varies according to how many prescriptions that they need filled.
Modified Pharmacy Model • Display while the simulation is running the current number of customers having 1, 2, or 3 prescriptions in system. • Display the total number of prescriptions in the system. Statistics should be collected on the average number of prescriptions in the system and on the average time a customer spends in the system. • Capture to a file the following information: • When a customer arrives: The current simulation time, the entity number (IDENT), the entity’s serial number, the number of prescriptions for the customer • When a customer departs: The current simulation time, the entity number (IDENT), the entity’s serial number, the number of prescriptions for the customer, and the time of arrival, and the total time spent in the system
Basic Modeling Questions • What is the system? What information is known by the system? • What are the required performance measures? • What are the entities? What information must be recorded or remembered for each entity? How are entities introduced into the system? • What are the resources that are used by the entities? Which entities use which resources and how? • What are the process flows? Sketch the process or make an activity flow diagram • Develop pseudo-code for the situation • Implement the model in Arena
Modeling • Our system is again the pharmacy and its waiting line. • The system knows about the chance for each prescription amount, the inter-arrival time distribution, and the service time distributions with their means by prescription amount. • The system must also keep track of how many prescriptions of each type and in total are in the pharmacy. • We will measure the performance of the system using the average number of prescriptions in the system and on the average time a customer spends in the system. • As in the previous model, the entity will be the customers. • Each customer must know the number of prescriptions needed. As before, each customer requires a pharmacist to have their prescription filled
Pseudo-Code • CREATE customer according to Poisson process • ASSIGN number of prescriptions for customer and arriving time increment number of prescriptions in system and by type • WRITE the customer arrival information to a file • PROCESS the customer with the pharmacist • ASSIGN decrement the number of prescriptions in the system and by type • RECORD statistics on system time • WRITE the customer departing information to a file • DISPOSE the customer leaving the system
Arena Modules • CREATE – This module will be used to create the 30 customers • ASSIGN – This module will be used to assign values to variables and attributes. • READ/WRITE – This module will be used to write out the necessary information from the customers. • PROCESS – This module will be used to implement the prescription filling activity with the required pharmacist. • RECORD – This module will be used to record statistics on the system time of the customers • DISPOSE – This module will be used to dispose of the entities that were created. • FILE – This data module defines the characteristics of the operating system file used by the READ/WRITE module. • VARIABLE – This data module will be used to define variables to track the number of customers having the different amounts of prescriptions and to track the total number of prescriptions.
Arena Model Discussion • See model that accompanies the text and the description in the text (They are on the Book CD, BUT did not copy in the install! ) • I’ll click through what’s there • Next, We’ll go through the related book figures as added slides
Ch2-Figure2-11 Ch2-Figure2-11
Ch2-Figure2-12 Ch2-Figure2-12
Ch2-Figure2-13 Ch2-Figure2-13
Ch2-Figure2-14 Ch2-Figure2-14
Ch2-Figure2-15 Ch2-Figure2-15
Ch2-Figure2-16 Ch2-Figure2-16
Ch2-Figure2-17 Ch2-Figure2-17
Ch2-Figure2-18 Ch2-Figure2-18
Ch2-Figure2-19 Ch2-Figure2-19
Ch2-Figure2-20 Ch2-Figure2-20
Ch2-Figure2-21 Ch2-Figure2-21
Ch2-Figure2-22 Ch2-Figure2-22
Ch2-Figure2-23 Ch2-Figure2-23
Ch2-Figure2-24 Ch2-Figure2-24
Ch2-Figure2-25 Ch2-Figure2-25
Ch2-Figure2-26 Ch2-Figure2-26
Directing Entity Flow • Direct connections • Using logical or probabilistic conditions • DECIDE • IF-ELSE-ENDIF • BRANCH • Using looping • DECIDE loop (go to programming) • WHILE-ENDWHILE • Entity transfers • ROUTE, TRANSPORT, CONVEY, etc
Example: Iterative Looping • This system produces products. The products have different model configurations (model 1 and 2) that are being produced within a small manufacturing system. Model 1 arrives according to a Poisson process with a mean rate of 1 model every 12 minutes. The second model type also arrives according to a Poisson arrival process but with a mean arrival rate of 1 arrival every 22 minutes. • Within a model configuration, there are two types of products produced, type A and type B.
Example: Iterative Looping • The base process time for type A’s for model configuration 1 is exponentially distributed with a mean of 14 minutes. The base process time for the products depends on the model configuration and the type of product A or B. The actual processing time is the sum of 10 random draws from the base distribution. • Processing occurs at two identical sequential locations. After the processing is complete, the product leaves the system.
Basic Modeling Questions • What is the system? What information is known by the system? • What are the required performance measures? • What are the entities? What information must be recorded or remembered for each entity? How are entities introduced into the system? • What are the resources that are used by the entities? Which entities use which resources and how? • What are the process flows? Sketch the process or make an activity flow diagram • Develop pseudo-code for the situation • Implement the model in Arena
Modeling • The system is the production facility. • The system knows the distributions associated with the processing times by location • The products are the entities. • Four types of entities: Two main types Model 1 and Model 2, which are further classified into product type A or product type B. • Two attributes, “myModel” and “myType” to represent the classification by model and by product type for the entities. For example, if “myModel = 1” then the entity is of type model configuration 1. • The products need their processing times.
Overview of Arena Model • CREATE – This module will be used to have two different arrival processes into the model. • ASSIGN – This module will be used to assign values to variables and attributes. • WHILE & ENDWHILE – These modules will be used to loop the entities until a condition is true. • DECIDE – This module will also be used to loop entities until a condition is true • PROCESS – This module will be used to simulate simple delays in the model. • DISPOSE – This module will be use to disposed of the entities that were created. • VARIABLES – This data module will be used to define variables and arrays for use in the model. • EXPRESSIONS – This data module will be used to define named expression to be used within the model. • Sub-model – Sub-models are areas of the model window that contain modules that have been aggregated into one module.
Arena Model Discussion • See model that accompanies the text and the description in the text • If we get this far let’s just click through
Tie-Dye T-Shirts Example • Production orders for tie-dye T-shirts arrive to a production facility according to a Poisson process with a mean rate of 1 per hour. • There are two basic psychedelic designs involving either red or blue dye. For some reason the blue shirts are a little more popular than the red shirts so that when an order arrives about 70% of the time it is for the blue dye designs. • There are two different package sizes for the shirts, 3 and 5 units. There is a 25% chance that the order will be for a package size of 5 and a 75% chance that the order will be for a package size of 3. Each of the shirts must be individually hand made to the customer’s order design specifications. • The time to produce a shirt (of either color) is uniformly distributed within the range of 15 to 25 minutes. There are currently two workers who are setup to make either shirt.
Tie-Dye T-Shirts Example • When an order arrives to the facility, its type (red or blue) is determined and the pack size is determined. Then, the appropriate number of white (un-dyed) shirts are sent to the shirt makers with a note pinned to the shirt indicating the customer order, its basic design, and the pack size for the order. • The paperwork for the order is processed and a customized packaging letter and box is prepared to hold the order. It takes another worker between 8 to 10 minutes to make the box and print a custom thank you note. • After the packaging is made it waits prior to final inspection for the shirts associated with the order. After the shirts are combined with the packaging, they are inspected by the packaging worker which is distributed according to a triangular distribution with a minimum of 5 minutes, a most likely value of 10 minutes, and a maximum value of 15 minutes. • Finally, the boxed customer order is sent to shipping.
Basic Modeling Questions • What is the system? What information is known by the system? • What are the required performance measures? • What are the entities? What information must be recorded or remembered for each entity? How are entities introduced into the system? • What are the resources that are used by the entities? Which entities use which resources and how? • What are the process flows? Sketch the process or make an activity flow diagram • Develop pseudo-code for the situation • Implement the model in Arena
Modeling The system is the Tie-Dye T-Shirt manufacturing process. Entities can be conceptualized as the arriving orders We need to keep track of the type of order (red or blue) and the size of the order (3 or 5). Since the type of the order and the size of the order are properties of the order, we will use attributes to model this information. Since the shirts are processed individually, they should also be considered entities. They will need to be matched with the orders to which they belong. The resources are the two shirt makers and the packager. The flow is described in the scenario statement: orders arrive, shirts made, meanwhile packaging is made, then the order is assembled, inspected, and finally shipped. Meanwhile indicates that the orders and shirts are processed in parallel.