Issuu on Google+

LEARNING WITNESS BOOK ONE

MANUFACTURING PERFORMANCE EDITION


Contents Contents ............................................................................................................................... 3 Introduction........................................................................................................................... 6 Simulation ............................................................................................................................. 7 Lanner Group ........................................................................................................................ 8 Where to find Models in this book ........................................................................................ 9 Conducting a simulation project .......................................................................................... 10 Overview...................................................................................................................... 10 Establish Objectives ..................................................................................................... 10 Scope and Level of Model Detail .................................................................................. 11 Data Collection ............................................................................................................. 12 Structuring the Model .................................................................................................. 12 Building the Model ....................................................................................................... 13 Running the Model....................................................................................................... 13 Generating Reports ...................................................................................................... 13 Testing the Model ........................................................................................................ 14 Experimentation ........................................................................................................... 14 Documentation ............................................................................................................ 16 Presentation of Results and Implementation................................................................ 16 Modeling Overview ............................................................................................................. 17 Elements: the WITNESS Building Blocks ..................................................................... 17 Basic Elements ............................................................................................................ 18 Logistics Elements ....................................................................................................... 20 Power & Free Elements ............................................................................................... 21 Continuous Processing Elements ................................................................................. 22 Logical Elements & Modules........................................................................................ 23 Graphical & Reporting Elements .................................................................................. 25 Manipulating Elements-Rules, Expressions and Actions .............................................. 26 Model Building, Running and Reporting ....................................................................... 27 Model Saving ............................................................................................................... 28 Enhancing the Screen Display ...................................................................................... 29 Useful Buttons ............................................................................................................. 30 Simple Model Examples............................................................................................... 31 Simple Assembly Model ......................................................................................... 31 Simple Logistics Model ........................................................................................... 35

LEARNING WITNESS BOOK ONE

CONTENTS

Page 3


Learning WITNESS Bi

Building Your First Model .................................................................................................... 37 Introduction .................................................................................................................. 37 Model Summary...................................................................................................... 37 Stage 1......................................................................................................................... 38 Process Flow Logic ................................................................................................. 38 Machine Rule Information ....................................................................................... 39 Running the Model .................................................................................................. 39 Anticipated Results ................................................................................................. 40 Giving Meaningful Names to the Elements ............................................................. 40 Stage 2......................................................................................................................... 42 Rules ....................................................................................................................... 42 Anticipated Results ................................................................................................. 43 Modifying the Model Display................................................................................... 43 Stage 3......................................................................................................................... 45 Detailing an Element ............................................................................................... 46 Rules ....................................................................................................................... 46 Running the Model .................................................................................................. 47 Adding a Variable Counter ....................................................................................... 47 Stage 4......................................................................................................................... 48 Random Sampling ................................................................................................... 48 Running the Model.................................................................................................. 50 Stage 5......................................................................................................................... 53 Looking at the Model in Three Dimensions ............................................................. 53 Summary...................................................................................................................... 54 Model Gallery ...................................................................................................................... 55 Typical Manufacturing Model .................................................................................. 55 Typical Warehouse Model ....................................................................................... 56 Office Model ........................................................................................................... 57 Call Centre Business Process.................................................................................. 58 Airfield Logistics ...................................................................................................... 59 Tracks and Vehicles ................................................................................................. 60 Garage Forecourt .................................................................................................... 61 Chemical Processing Plant ...................................................................................... 62 Case study: JETTY.MOD .................................................................................................... 63

LEARNING WITNESS BOOK ONE

CONTENTS

Page 4


Learning WITNESS Bi

WITNESS Essentials Reference Section ............................................................................. 71 Introduction .................................................................................................................. 71 Key Element Details for Basic Elements ...................................................................... 72 Introduction ............................................................................................................. 72 Parts........................................................................................................................ 72 Machines ................................................................................................................ 75 Buffers .................................................................................................................... 77 Labor ....................................................................................................................... 78 WITNESS Rules ........................................................................................................... 79 Introduction ............................................................................................................. 79 Labor Rules ............................................................................................................. 81 WITNESS Actions Language ........................................................................................ 82 Using Variables, Functions, Distributions and Expressions ........................................... 84 Variables.................................................................................................................. 84 Inbuilt Functions ...................................................................................................... 85 User Defined Functions........................................................................................... 86 Distributions ............................................................................................................ 87 Attributes ..................................................................................................................... 88 Introduction ............................................................................................................. 88 System Attributes ................................................................................................... 89 Attribute Elements .................................................................................................. 90 Tag Displays ............................................................................................................ 92 Reports ........................................................................................................................ 93 Introduction ............................................................................................................. 93 Statistics ................................................................................................................. 93 Used Report ............................................................................................................ 93 Explode Report........................................................................................................ 94 Breakdowns and Setups .............................................................................................. 95 Breakdowns ............................................................................................................ 95 Setups ..................................................................................................................... 96 Quantity ....................................................................................................................... 97 N and M ....................................................................................................................... 98 Displays ....................................................................................................................... 99 Basic Working with Microsoft Excel ........................................................................... 102

LEARNING WITNESS BOOK ONE

CONTENTS

Page 5


INTRODUCTION Thank you for using the WITNESS Manufacturing Performance Edition. Through this first “Learning WITNESS” book we hope to introduce you to the basic technique of simulation using the WITNESS software package. This book concentrates on core WITNESS functionality. Options exist to extend WITNESS’s capabilities dramatically (for example, full virtual reality graphics, automatic optimization, links to other packages and embedding in applications) but the basics of simulation form the core of the message here. Lanner wish to encourage the wide use of simulation in all business spheres due to the enormous benefits that can be achieved in understanding where to invest and how best to apply control. This book provides a brief overview of simulation and simulation projects. This is followed by an overview of WITNESS modeling, and to bring the description to life, two very simple demonstration models and a case study are included. They demonstrate the visual impact and benefits of being able to see, in an animated graphic form, how the simulated operations are performing. In order to illustrate the ease and speed with which you can build WITNESS models, a model build is also included. The tutorial leads you through a step by step exercise to create a simulation model from scratch. After working through the example models, model build and the case study, a further reference section is provided that is essential reading for anyone wanting to proceed to create a model of his or her own. After finishing the material in this book there is a second Learning WITNESS book – in the form of a workbook where many more step by step model builds are shown with discussions on model structure and best practice. On-line help is built into the product with the usual search facilities and hypertext links to move you quickly from topic to topic. Using the help system when you need assistance should gradually increase your knowledge of WITNESS simulation modeling. Of course there is no substitute for experience, but we hope that this book starts you out on the path to discovering the fun, excitement and satisfaction of applying simulation to real business problems and finding real business solutions.

LEARNING WITNESS BOOK ONE

INTRODUCTION

Page 6


SIMULATION Simulation has much to offer all large organizations, whether they are in manufacturing or in the service industries. The role of simulation is to evaluate practical alternatives available either in support of major strategic initiatives which might involve a large financial outlay, or in support of the continuous search for better performance at operational and tactical levels. Examples of such evaluations include changes to the product mix, increases or decreases in volumes, improvements in throughput, shorter lead times and improved customer response times. Simulation provides the user with a greater breadth and depth of information on which to base decisions. It is capable of handling the complexity of large systems, even a whole factory. In addition, the simulation approach supports sensitivity analysis by allowing rapid changes to the model logic and data. What is Visual Interactive Simulation?

“Visual Interactive Simulation is one which has features for graphical creation of simulation models, dynamic display of the simulated system and user interaction with the running program. Interaction implies that the simulation halts and requests information from the user, or the user stops the simulation at will and interacts with the running program.” R. D. Hurrion, Engineering Journal of Operations Research WITNESS is Lanner Group’s simulation software package. It is the culmination of more than a decade’s development experience with computer-based simulation. This experience has led us to evolve a visual, interactive and interpretative approach to simulation without the need for compilation. There are currently more than 6,500 WITNESS systems in use worldwide, in organizations ranging from automotive to pharmaceutical, aerospace to electronics, hospitals to banks, airports to defense and more. The WITNESS Manufacturing Performance Edition is the version of WITNESS specially designed for manufacturing applications. It is ideally suited to a variety of production and storage layout and logistical modeling scenarios.

LEARNING WITNESS BOOK ONE

SIMULATION

Page 7


LANNER GROUP Lanner simulation software enables business process improvement for world leading organizations. With Lanner simulation, business managers can model, analyse and optimize processes to make superior decisions in a risk-free environment. Lanner simulation is the key to improving productivity, efficiency and reducing costs. Lanner's advanced simulation technology is supplied to simulation professionals through its WITNESSŽ brand. Lanner's L-SIM™ brand has quickly established itself as the leading embedded simulation engine used in enterprise suites from the top software solutions suppliers. Lanner's technology is also embedded within its expanding range of individually badged, task specific simulation and planning applications. Based in the UK with subsidiaries and partners in Europe, the Americas and the Far East, Lanner applications are used by more than 3,500 companies globally. Please visit the Lanner website for the latest product and support information at www.lanner.com

LEARNING WITNESS BOOK ONE

LANNER GROUP

Page 8


WHERE TO FIND MODELS IN THIS BOOK In this series of Learning WITNESS books there are several step by step model builds and other models referenced. Some of these require special models for you to start from. All of these, the complete models and different stages in the build process are installed in the tutorial folder when WITNESS is installed. The tutorial folder is situated in different places, according to Microsoft standards, under different operating systems. The easiest way to locate the models is to use the link from the WITNESS Start Page to the Sample models. This takes you to the demonstration model folder and the tutorial folder is a subfolder of this folder. If closed, the Start Page can be opened using the Views/Start Page folder. Other referenced models (e.g. Jetty.mod) are found in this same standard demonstration model folder. In Windows7 and VISTA the demonstration and tutorial models are located by default in folders that are placed under: C:\Users\Public\Documents\Lanner Group\WITNESS 13

In Windows XP the models are located by default in folders that are placed under: C:\Documents and Settings\All Users\Documents\Lanner Group\WITNESS 13

LEARNING WITNESS BOOK ONE

WHERE TO FIND MODELS IN THIS BOOK

Page 9


CONDUCTING A SIMULATION PROJECT Overview Projects which involve simulation have several unique aspects which must be managed particularly carefully to ensure their success. The topics in this chapter outline a typical sequence of events in a project, using a practical methodology: • • • • • • • • • • •

establishing objectives deciding the scope and level of detail in the model collecting data structuring the model building the model running the model generating reports testing the model experimenting with the model documenting the model presenting the results and implementing them

Establish Objectives This is the first and most important phase of any simulation project. The aim of any simulation project should be to make a better business decision. You, as simulation modeler, must understand this business decision as it is likely to have important implications for the content of your simulation model. For example, consider two models of exactly the same production cell built for two entirely different reasons. The first model is built in order to discover the theoretical maximum throughput of the cell as it is subjected to different product mixes. The model therefore contains detailed information on part availability (contained within a part file) and the cell's production schedule (contained within a data file). Labor required to operate the cell at the maximum rate is not a consideration. The second model is built to investigate the number of operators required to operate the cell efficiently. The model therefore contains detailed information about labor priorities, job interruptions, and shift patterns. In this case, the production schedule might assume less importance. Thus, the content of the models is driven by the business decision which needs to be made. There is no requirement to represent every single feature of the real world production cell in either model.

LEARNING WITNESS BOOK ONE

CONDUCTING A SIMULATION PROJECT

Page 10


Learning WITNESS Bi

Scope and Level of Model Detail The scope of a simulation model refers to where it begins and where it ends. For example, consider a model of a claims department in an insurance company. The objective of the model is to decide how many people are required to answer email enquiries. This team could be considered in isolation. Parts arrive and are placed in a queue (buffer). Each person takes an email from the queue in turn, deals with the enquiry, which may lead to several different outcomes and pushes them out of the model (to SHIP). Alternatively, the email team could be considered part of the communications flow of the entire organization and its customers. This involves shifting the start and end points of the simulation model to encompass more of the real world. It is important to limit the scope of the model as far as possible. With regard to the level of detail contained within a model, the golden rule is to model the minimum necessary in order to achieve the model's objective. At the beginning of the model-building process, small additions to the model often lead to large increases in its accuracy. As the model becomes more detailed, however, each subsequent addition usually adds less to the model's accuracy. In fact, it could be argued that the addition of unnecessary detail could lead to an eventual fall in the accuracy of the model. This is particularly true where you are trying to model human behavior, which is often inconsistent. The graph below shows a typical relationship between the level of detail of a model and the model's accuracy.

It is possible to use WITNESS elements to represent combinations of real world processes and therefore to model a process at a 'higher level'. For instance, a manufacturing cell or even an entire manufacturing plant could be represented solely as a WITNESS machine.

LEARNING WITNESS BOOK ONE

CONDUCTING A SIMULATION PROJECT

Page 11


Learning WITNESS Bi

Data Collection Information for a model is likely to fall into one of three categories: 1.

Available - data is readily available and it is in an appropriate format that the model can use immediately.

2.

Not available but collectable - data is either in an incorrect format or it has not been collated before. You might need to perform a small work study in order to collect this type of data (for example, timing certain processes manually).

3.

Neither available nor collectable - data is not currently available and it is not easily collectable (for example, for a model of a new factory on a green-field site with new machinery).

If the data is neither available nor collectable, you must use estimates. You can obtain useful estimates by: 1.

Using manufacturer's data - Machine manufacturers often include information (for example, reliability data) in their promotional literature and machine specifications.

2.

Sensitivity analysis - involves replacing an unknown parameter (for example, a machine cycle time) with a high value and a low value in turn and comparing the results of the entire simulation. If the results are similar, then it follows that the machine cycle time is not a critical part of the entire process and that a rough-cut estimate of the cycle time should be sufficient. If the results differ markedly, then the machine cycle time is a critical statistic and further work will be required to ensure that it is estimated closely.

Whenever you use an estimate, you should declare it as an assumption upon which the model is based. If the model later proves inadequate as a representation of the real world situation, then it is possible to scrutinize the assumptions upon which it was based.

Structuring the Model An important final step before building the simulation model is to structure it. This will identify the most difficult areas for the model building and highlight any additional data requirements that may have been overlooked up to now, such as a transfer time for parts between processes. This plan typically takes the form of a sketch of the facility to be modeled. The plan should identify which WITNESS element (or collection of elements) is to be used to model each real-life process. It may also contain information regarding the input and output rules to be used on key elements and a summary of the actions language that needs to be included in the elements to give the necessary degree of logical control. You may also incorporate other items (such as the cycle times of machines and the capacities of buffers) into the plan.

LEARNING WITNESS BOOK ONE

CONDUCTING A SIMULATION PROJECT

Page 12


Learning WITNESS Bi

Building the Model It is recommended that you build the model incrementally, and that you test each stage thoroughly before you build the next stage. If you do this, it is easier to find possible problems for a model than if you have to search through an entire model. Avoid the temptation to experiment with a model before it is complete. It is better to have a complete, well-tested, model to act as a benchmark against which experimental results can be compared. The main steps in building a model are creating elements (defining, displaying and detailing them – often in one step using designer element templates), then linking them together with rules. You can also build more complex logic into your model by using actions.

Running the Model After creating the elements of your model, you can run it immediately, then modify it by adding, changing or deleting elements. You can then run the model again in order to assess the impact of these changes. This ability to build a model incrementally, testing each section as you go, is a powerful aid to productivity, and generates confidence in the validity of your model. You can run the model in different modes, from step-by-step (with full screen display) to a ‘batched’ time in the future (with no screen display). There are many WITNESS features which aid analysis, including standard report tables and graphs (which list the basic mathematical behaviors of all elements in the model automatically), meteor trails, elements flows and process views. You can also create timeseries, pie charts, histograms and customized report tables and expressions in WITNESS.

Generating Reports When you have built and run your model, you can use WITNESS reports to help you choose between alternative modeling scenarios. For example: •

In order to increase the utilization of machinery, you may be most interested in the proportion of the time that machines spent in an idle state compared to the time they spent in a busy state during a simulated shift.

LEARNING WITNESS BOOK ONE

CONDUCTING A SIMULATION PROJECT

Page 13


Learning WITNESS Bi

In order to increase the throughput of your operation, you may be most interested in the number of parts processed during a simulated day’s operation.

In order to rationalize your work force, you’ll be interested in the proportion of time that operators of each grade spend busy.

In order to reduce wastage, you may be interested in the quantity of parts that were scrapped during the simulated period.

In order to avoid losing customers because your queues are too long, you’ll be interested in the number of customers who failed to enter for this reason (number of parts rejected).

In order to estimate the life of your vehicles, you’ll be interested in the total distance they travel in a simulated week.

You can choose different types of report to run and output the report in a variety of formats. You can copy all standard reports and graphs to the Windows clipboard and paste them into other applications. Direct links both to and from Excel and to databases can be applied

Testing the Model Testing a simulation model consists of verification and validation. Verification ensures that the content of the model is consistent with your expectations. For example, establish that the parts are traveling along the correct routes between elements and that any labor used is attending to the correct elements in the correct priority order. Validation (which usually follows verification) investigates the accuracy of the model compared with the real world. A typical validation exercise might involve providing a typical set of inputs (for example, a part arrival and production schedule) and studying a set of model outputs (for example, the average level of work-in-progress for a part, or part throughput times). The verification and validation stages of a simulation study are usually iterative, in that they involve re-visiting some of the stages already described. For example, the model may require the addition of some processes not yet modeled, thus increasing the model's scope.

Experimentation When you are satisfied that the model resembles the behavior of the real-life situation, you can investigate a number of what-if scenarios. The scenarios should have been defined within the original objectives of the simulation study. Successful experimentation typically involves using a warm-up period or starting conditions, deciding on a suitable run-length, and running the model with more than one random number stream.

LEARNING WITNESS BOOK ONE

CONDUCTING A SIMULATION PROJECT

Page 14


Learning WITNESS Bi

A warm-up period allows the model to reach a steady state before WITNESS collates any results. For example, it is highly unlikely that a production line would be completely empty of parts first thing on a Monday morning, although the computer simulation would start from such a situation. A warm-up period of, for example, one week would allow stocks to build up to a typical level. You could then instruct the model to disregard the results for the first week and start to collate results from Monday morning of the second week. You can use the model/options/statistics command or the model/experiment command to specify a warm-up period. A possible alternative to a warm-up period is to include some starting conditions within the model. At time zero, parts are dispatched to various elements. The numbers of parts and their destinations correspond to a typical work-in-progress situation. There is now no need for a warm-up period as the model is being run from a typical real-life situation. You can create starting conditions using initialization files or by using active part arrivals or dummy starting condition machines which process large numbers of parts at time zero but are then made inactive for the remainder of the simulation. Although most simulation runs require either warm-up periods or starting conditions, some situations do not need either. For example, a model built to study customer service levels at a bank would preferably start from an empty state since banks contain no customers when they open their doors each morning. Any experiment involves running a model for a specified length of time under different circumstances. The length of the run should be determined by a number of factors. The most important factor is that a reasonable sample of random numbers is taken from each of the random number streams used in the model. Each run should aim to use at least 10-15 numbers from each stream. If one stream is being used to calculate a breakdown interval of between 1 and 2 weeks then a run length of between 20 and 30 weeks would be necessary. Another factor is the reporting period of the real-life situation being modeled. It makes little sense to calculate an optimum run length of 3 weeks and 1 day if you need to compare your model results with a real-life situation which reports every 30 day period. It is important to run any model with random activity, by using several different sets of random number streams, before you can place any confidence in the model's results. Otherwise it is possible that the results obtained are solely the consequence of one set of the random number streams chosen rather than any model changes that you have made. You should compare each set of results; if you find any uncharacteristic values, you should review and assess them and, if necessary, discard them. You can use the model/random numbers command to reset random streams from antithetic to regular, or regular to antithetic. Alternatively, you may use the model/experimenter option to automate the run of a model which uses random streams.

LEARNING WITNESS BOOK ONE

CONDUCTING A SIMULATION PROJECT

Page 15


Learning WITNESS Bi

Documentation It is a good idea to document the way in which you built the model, as it makes it easier to understand if you (or someone else) examine it at a later date. Such documentation should include the model structure diagram. WITNESS also provides other facilities for model documentation, either within the model itself, or externally to a file or a printer. You can attach notes to most element detail dialogs and display the notes in the simulation window. You can use these to enter descriptions of how each part of the model should work. You can also use an exclamation mark in rules and actions in order to insert comments about the purpose of the rule or action. The sources of data used, the assumptions made and the results obtained should also form part of the model documentation. If the project is documented as it proceeds then the act of documentation will prove to be a less onerous task. It is recommended that any project documentation is completed before the presentation of results as there is often less inclination to document a project which has been laid to rest. The WITNESS Documentor module allows the creation of a report from the names, notes and other property fields within a model.

Presentation of Results and Implementation The method of presentation for results depends on the size of the simulation project and the culture of your organization. An animated model provides an effective communication tool to support business decisions, particularly if you have enhanced its graphical display. You should try to ensure that model results form part of the decision-making process and that the model is not simply used to justify a past decision. Actions resulting from study of the simulation model should be implemented. Otherwise, all your efforts will be wasted. If your model is effectively documented, it will probably be used again, perhaps with changes made to some of the parameters. The model will evolve to support better decisionmaking in the future.

LEARNING WITNESS BOOK ONE

CONDUCTING A SIMULATION PROJECT

Page 16


MODELING OVERVIEW This section provides an introduction to the basic building blocks of WITNESS and how you can use them to build a model. The description is designed to give you an overall appreciation of the product before introducing you to model examples where WITNESS’s processes and features are explored in more detail.

Elements: the WITNESS Building Blocks A business or commercial operation might produce a number of different parts using a variety of machines, conveyors, vehicles, other equipment and people. A WITNESS model uses the same combination of parts, people, machines and other simulation devices, called modeling elements, in order to simulate the operation being studied. There are two main versions of WITNESS which offer different terminologies for manufacturing and for service and process applications. This book is designed for people principally modeling manufacturing applications. However the elements give scope for modeling other applications too. For example it is possible to model logistical operations. It is also possible to treat the manufacturing terminology in the product abstractly – modeling people or telephone calls as parts to be processed by different activities – represented by machines, and so on. For customers principally modeling non-manufacturing activities we recommend the Service and Process Performance edition of WITNESS. As you become more familiar with the capabilities of each element, you will find that virtually any aspect of your operation can be meaningfully represented.

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 17


Learning WITNESS Bi

Basic Elements Parts Parts flow through the model. They can represent, for example: • products (cars, engines, etc). • product batches • a project progressing through a large corporation. • calls in a telephone exchange. • tiny electronic components or whole computers. Parts can be: • displayed in different ways – as an icon or a text description. • characterized by a particular set of attributes (for example, weight, length, color). • handled in different ways (batched, created singly or in lots, changed into other parts, many parts can be combined into one part, or one part can be split into several parts). • filled with fluid and emptied of fluid.

Buffers These are places where parts can be held. For example: • parts awaiting an operation on a factory floor. • people in a queue. • the space containing aircraft waiting to land. • a hopper containing components at an assembly station. Buffers can: • have parts arranged within them according to different ordering methods (for example, first-in first-out or by priority). • hold parts for a specified minimum time. In this way buffers can be used to simulate equipment such as ovens and operations such as settling or cooling. • hold parts for a specified maximum time after which they attempt to leave the buffer. An example of a use of buffers in this way is the simulation of shelf life of components after which they must be scrapped.

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 18


Learning WITNESS Bi

Machines These are powerful elements which are used to represent anything that takes parts from somewhere, processes them and sends them on to their next destination. For example: • a machine tool, lathe or a press. • a complete shop or a single supermarket checkout. • an organization which handles a project then passes it on. • an entire plant or an individual work cell. Machines can: • be one of seven types: Single, Batch, Assembly, Production, General, Multi-Station and Multi-cycle. Each of these handles parts in different ways. • model such factors as the time a machine takes to process a part, time between breakdowns, multiple setups, multiple stations, multiple cycles, time to repair breakdowns and to set a machine up, as well as labor for these events. • fill and empty parts with fluid.

Labor This element can be used to model both human and physical resources that are a constraint on operation (for example, tools, people or equipment) which may be required by other elements for processing, setting up, repair, cleaning and so on. Controlling labor use is usually very important in modeling. There are many different options available in WITNESS e.g. complex rules for allocation and the ability to take labor resources away from an element so that a more important task can be completed for another element (resource preemption).

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 19


Learning WITNESS Bi

Logistics Elements Conveyors These are used to move parts from one fixed point in the model to another over time, both belt and roller conveyors can be represented. There are two types of conveyors. • Fixed conveyors maintain a constant distance between parts. If the conveyor stops, the distance between the parts on the conveyor remains the same. • Queuing conveyors allow parts to accumulate. If the conveyor becomes blocked, the parts will slide together until the conveyor is full. WITNESS also has the option of indexed or continuous conveyors. Indexed conveyors model simply and efficiently, each conveyor having room for a set number of parts. Continuous conveyors model with exact part sizes and should be used for these more complex situations. Paths A path is an element that parts or labor units can travel along in order to get from one element to another element. You can use it to represent the length and the physical route of a real life journey in your model. Tracks These are the paths that vehicles follow when transporting parts. They also define points at which vehicles may load, unload or park. Vehicles These represent vehicles, (for example, Automatic Guided Vehicles, cranes, forklift trucks) which transport parts. You can specify: • a variety of destinations and priorities for vehicles. • the time a vehicle should stop at the end of a track before going on to the next track. • a length of time the track remains busy after a vehicle has left it (for example, to avoid collision with the long train of the front vehicle). • a maximum speed for a vehicle on a track. • the speed of a vehicle when loaded and unloaded. • vehicle acceleration and deceleration. • the time it takes for parts to be loaded and unloaded from a vehicle.

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 20


Learning WITNESS Bi

Power & Free Elements Power and free elements allow you to model the specialized form of material transportation systems. There are four types of power and free elements. Network The network groups a set of sections, stations and carriers together. There are two types of network: self-powered and section-powered, and the type affects the behavior of sections and carriers within the network. Section This is the path that carriers move along, the section must be part of a network. The network determines the behavior of a section. Station A point (at the beginning or end of a section) at which you can execute actions either on the carrier or on the entity in the carrier. There are four types of power & free stations: Basic stations (allowing simple actions), Loading stations, Unloading stations and Parking stations. Carrier A carrier transports parts along sections or through stations. Its behavior is determined by the type of network it is on. If the network is self-powered, the carriers are active and propel themselves along passive sections. If the network is section-powered, the carriers are passive and are picked up and carried along sections by hooks (or ‘dogs’)

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 21


Learning WITNESS Bi

Continuous Processing Elements These are used to simulate models where continuous flow is a factor. Fluids Fluids represent liquids and free-flowing products, such as powder. They are displayed as blocks of color that flow through pipe, tank and processor elements. Mixtures of fluids are shown as bands of different colors (proportionate to the amount of each fluid in the mixture). Processors Fluids flow into processors, undergo some type of operation, then flow out (that is, they act like machines for fluids). An example of a processor could be a vessel in which a number of fluids are mixed and then heated for a specified time. Processors can: • have calibrated levels, showing precise contents. • display the proportions of the mix of fluids in a processor as a percentage, together with the names of the fluids. • have a minimum process level, below which the processor will not cycle. • be cleaned according to certain criteria. • break down according to certain criteria. • have specified rising and falling warning levels which cause something to happen when reached. • change the name and color of a fluid on input or output. Tanks Tanks are continuous processing elements in which fluids may be held or stored (that is, they act like buffers for fluids). Tanks can: • be cleaned at various stages. • have specified rising or falling warning levels, which cause something to happen when they are reached. • change the name and color of a fluid on input or output. • be displayed in different ways. • display their contents in volume units on the screen. • display the proportions of mixtures of fluids as a percentage, together with the names of those fluids. Pipes These are the elements used to connect processors and tanks. Fluids flow through pipes at a given rate. Pipes can: • be cleaned according to certain criteria. • break down according to certain criteria. • change the name and color of the fluid on input or output. • have negative flow rates. • flow with or without an output.

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 22


Learning WITNESS Bi

Logical Elements & Modules These represent the data and reporting aspects of the model (that is, control and information). They enable you to handle data easily, customize reports and build more complex logic into WITNESS models. Attributes These are characteristics of a specific part or labor unit. For example, the number of cylinders in an engine could be held in an attribute, and you could then use this attribute to determine the amount of time required for tuning and adjustment. Each attribute may hold an integer, or a real number, or a string, or a reference to another WITNESS modeling element. Variables Variables are values which can be accessed from anywhere in the model. For example, a variable could be used to record the value of items in an inventory. In addition to variables that you define yourself, WITNESS provides several system variables (including one which holds the current simulation clock time and one which holds the number of the current part in a batch). A variable can: • hold an integer, or a real number, or a string, or a reference to another WITNESS modeling element. • be set equal to an expression involving attributes, to a constant value, to a sample from a distribution or to another variable. • display its name and value on the screen. Files Files allow you to take values that are relevant to the simulation and load them into a WITNESS model, or save values from the WITNESS model to a file so that you can use them in another application (in order to produce customized reports, for example). Distributions Distributions allow you to build variability into a model by including data which you have collected from the real world. For example, if observations show that the milling operation on type X widgets takes between 5 and 10 minutes but most often takes 8.2 minutes, the information could be introduced into the model using a distribution. Distributions can: • be defined by you. • be one of the wide range of integer and real distributions already provided by WITNESS. • be either continuous or discrete.

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 23


Learning WITNESS Bi

Functions WITNESS provides a large number of built-in functions which you can use to build intelligence into the logic of your model. For example, you could use a function to detect the number of parts currently on a conveyor. You may also create your own functions. Built-in functions include: • reporting and status functions, for example, returns the number of parts in a specified element, returns the amount of free space in an element. • random sampling functions, for example, returns a sample from a Normal distribution. • arithmetic and name functions. Functions can: • display their name and most recently returned value on the screen as part of the model. • be created as elements and then be used repeatedly in the model with the same ease as the built-in functions. Part files A part file contains a list of parts; for each part in the file, you may specify the lot size (how many parts arrive at once), attributes of the part (for example, icon, color, weight) and the arrival time of the part in the model. This is useful for modeling simple production scheduling problems where the normal part inter-arrival mechanism does not allow you to specify part arrivals with sufficient precision. You can also output parts from the model to part files. In this way it is possible to produce a part file as an output from one model which is then used as an input to another model. Note that schedules can also be read in from Excel. An example showing how to do this is in Learning WITNESS Book Two. Shifts The shift element is used to simulate a shift pattern (or a series of shift patterns) which is, in effect, a sequence of working and non-working periods. Shift patterns may be applied to labor and other elements in order to simulate shift working. Modules A module is an element consisting of a collection of other WITNESS elements. Modules may be used to facilitate “black-box” or hierarchical model building. You can define, display and detail a module just like any other WITNESS element, and protect the module with a password. The options for using modules are very extensive. Links to external module files provide concepts of inheritance.

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 24


Learning WITNESS Bi

Graphical & Reporting Elements These are graphical representations of what is happening to the model as a run proceeds. Pie charts Pie charts allow you to present simulation results on the screen in the standard pie chart format. You can incline the pie chart’s display and pull out segments for greater impact. Pie charts are useful to represent the percentage of time that an element spends in a certain state (for example, that amount of time that is spent in a busy or idle state). Timeseries Timeseries allow you to present simulation results on the screen in the form of a graph which plots values taken from the simulation against time. Up to seven values may be plotted with seven different colors. Timeseries are useful for determining the trends or cycles underlying the model since they provide a history of the specified value as well as a mean and standard deviation. Histograms Histograms allow you to present simulation results on the screen in the form of a bar chart. This is useful for determining the range of values observed for some parameter of the simulation. Reports Report Elements allow the definition of a custom report. This may either have the default display of a table of values or a chart. The report element contains the details of the calculations to generate the report which is usually based on the value of other functions or variables in a model.

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 25


Learning WITNESS Bi

Manipulating Elements-Rules, Expressions and Actions Rules Parts and fluids are transferred between elements according to input and output rules for those elements. Rules can: • allow you to model complex decisions about the transfer of parts and fluids based on almost any criteria. • be entered semi-automatically by using a prompt feature in WITNESS. • contain comments documenting your logic. • direct parts and fluids to a variety of locations outside the model (for example, they can be shipped or scrapped). • be created simply using buttons on the Standard toolbar. Expressions One of the most powerful features of WITNESS is the flexibility with which it handles values. Wherever a value is required, you may specify a formula or expression (if you use spreadsheet programs you will recognize this concept). Depending on the context, WITNESS either works out the value immediately or stores the expression for future use. For example, a machine’s cycle time can be entered as an expression which is re-evaluated each time the machine cycles. Actions WITNESS provides a simple programming language known as Actions. This shares similarities with the BASIC programming language but reads more like English and incorporates help facilities. Using actions, you can give WITNESS specific instructions about the logic of your model, allowing you to model the calculations and formulae which underpin decisions in the real-life situation under study. Actions can: • be used to introduce interaction between the model and the person using it, for example by prompting them for specific responses at suitable points when the model is running. • be used at key stages of an element’s operation (for example, at the end of a machine cycle, when a part leaves the model, before observations are plotted on a timeseries, when a processor finishes cleaning). • be used to set the initial conditions of the model. • be used at any stage during the running of the model.

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 26


Learning WITNESS Bi

Model Building, Running and Reporting Model Building in WITNESS begins with choosing the elements that are needed in a model. This is normally done by dragging an element from a tab in the designer elements window on to the main modeling screen. When this is done the element name also appears in the element tree. The best way to learn the process is to follow the step by step example model build later in this workbook. After defining the elements of your model and linking with logic you can run the model in a variety of modes. These range from step-by-step (with full screen display) to a batch option with no animation. The options are accessed using the familiar video style controls on the Run toolbar. WITNESS generates a wide range of reports for you automatically. You can use these reports to help you choose between alternative modeling scenarios. Standard Statistics reports, accessed for example using the right mouse menu, comprise a collection of statistics for each defined element. For example, the average time parts have taken to be processed or the percentage utilization for a machine. Many other types of report are available, for example, a list of elements defined in the model, a summary of the details of a specified element and a list of elements which are currently idle, blocked or waiting for labor.

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 27


Learning WITNESS Bi

Model Saving WITNESS allows you to save models and parts of models in several different formats. Some of the most useful of these are: .MOD

Model file. This is the standard model save format. It includes all the definition of the model in a fast loading format.

.SIM

Model and status file. This is an extremely useful save format for WITNESS models in that it saves a model at a particular point in a model run. When this file is loaded again it is possible to view run statistics and even to run the model on from that saved point in time.

.LST

Library file. This is a text definition of a model file. It provides a way of looking at a model file in a standard editor such as Notepad or Wordpad. The file can be altered (carefully) and loaded again as required.

.DES

A designer elements file. This file format saves a single tab of a set of designer elements to a file. This allows easy portability of designer elements between models – simply add another tab to the designer window in WITNESS and load a DES file.

.MDL

A module file. This saves part of a model (or all if a single module) to a file for re-use in another model. A designer module in the WITNESS designer element palette links to an mdl file to define a whole model section at once.

.WXM

A WITNESS model in XML format. Another text format of a model saved according to the WITNESS XML schema.

.WEXP

An experiment file saved from the WITNESS Experimenter. This saves the definition for several scenarios and the results from each model run.

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 28


Learning WITNESS Bi

Enhancing the Screen Display The following facilities are examples of the ways in which you can enhance your model and make it clearer. You can add: •

• • • • • •

Extra icons and backdrop displays. It is possible to import bit-map files (.BMP), JPEG files (.JPG), GIF files (.GIF), windows metafiles (.WMF), enhanced meta-files (.EMF) and Autodesk Drawing Interchange files (.DXF), these can all be used as WITNESS icons and backdrop displays. Text & Explanatory labels. Lines, for example to indicate the flow of work in progress. Boxes and ellipses, for example to divide the model into zones indicating operations or to draw attention to certain areas. Keys showing status colors for elements. Audio enhancements (using .wav files). Video enhancements (using .avi files).

You can choose: • • • • •

Different colors for displaying text, lines and element names. Both background and foreground colors may be altered. Different fill patterns for boxes, circles or ellipses. Different text fonts. Different icon sizes. To redefine the digital and analogue simulation clocks to your requirements.

Display items can only be dragged, stretched, rotated etc after the button has been pressed to enable the WITNESS ‘Display Edit’ toolbar.

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 29


Learning WITNESS Bi

Useful Buttons A complete listing of all menu commands and toolbar buttons is included in the Quick Reference Book. Some of the most common are also listed below: The open model button lets you open a WITNESS model. The run button runs the model with the simulation visible on all currently selected windows. The stop button stops a run in any of the chosen modes. The step button lets you examine each step that is taken as the run proceeds. The begin button resets the clock to time zero, clears statistics and sets elements to an idle state. The detail button lets you edit an element’s details. The display button lets you edit an element’s display features. The visual pull button lets you define a pull rule for a selected element. The visual push button lets you define a push rule for a selected element. When activated (pushed in) the run until button enables you to run a model either until the time entered in its text box is reached or until an event occurs for a named element. The element selector

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 30


Learning WITNESS Bi

Simple Model Examples The following models are located in the Demo folder. This folder is found using the sample models link from the WITNESS Start Page. Each model is described below. You will be able to follow the descriptions more easily if you load and run the models while you read the description.

Simple Assembly Model

In this model - Simple, a TOP and a BOTTOM are screwed together using two screws. The assembly operation is modeled and is followed by a Test and Inspection operation after which the finished parts leave the model. Open ‘Simple Assembly Model.mod’. To see the model at its best, activate the walk button on the execute toolbar (by clicking on it): Then run the model by clicking on the run button: Adjust the slider control on the walk button to control the speed of the model. The detail for each element can be viewed by double clicking on its display. •

The left hand buffer, TOPS, holds TOP parts which arrive in lots of 1 at variable times. The first TOP arrives straight away. The middle buffer, BOTTOMS, holds BOTTOM parts which arrive in lots of 1 at variable times. The first BOTTOM arrives straight away. The right hand buffer, SCREWS, holds SCREW parts which arrive in lots of 6 at variable times. The first batch of SCREWs arrives after 5 minutes.

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 31


Learning WITNESS Bi

• • • •

The assembly machine, ASSEMBLY, pulls in 1xTOP, 1xBOTTOM and 2xSCREW parts and cycles for 2.0 mins, merging all parts into 1xASSM part. 1xASSM part is output to the INSPECTION machine on the right, where they are collected in groups of four and inspected for 5.0 mins before being shipped out of the model. A timeseries, COST, shows two plots. A reading for each plot is taken every 5.0 minutes. The first plot (called RAW MATERIALS) appears when you run the model and is shown as a yellow line. It indicates the value of the raw materials in the model. A built-in WITNESS function is used to calculate the number of parts in each of the three buffers and their value. The second plot (called ASSEMBLY/INSPECT) also appears when the model is run and is shown as a dark red line. It indicates the value of all parts currently in the ASSEMBLY and INSPECTION machines (with the value of finished parts greater than the sum of constituents). The clock display has been customized to show the week, day and (current) time in hours and minutes. The simulation time is also shown on the run toolbar.

Try running the model in step mode: • •

• • •

Click on the begin button to return the time to zero and then use the step button. WITNESS waits for you to press the <Enter> key or click the left mouse button so that it can proceed to the next step, which occurs at the next unit of simulated time. Each step is accompanied by a commentary in the window labeled Interact Box of what is happening in the model. Press the <Enter> key. Initially, a TOP part and a BOTTOM part arrive and enter the ASSEMBLY machine. Keep stepping (by pressing the <Enter> key) as the ASSEMBLY machine is waiting for SCREW parts before it can cycle. Another TOP and BOTTOM enter the model. They are not needed yet and wait in the buffers. At time 5 a batch of six screws arrives. Two go into the ASSEMBLY machine and the rest wait in the buffer. The ASSEMBLY machine starts to cycle and turns from yellow (idle) to green (busy).

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 32


Learning WITNESS Bi

• • •

• •

At time 7 the completed ASSM part goes to the INSPECTION machine (which remains idle because it needs three more ASSM parts before it can cycle). The Assembly machine fills again. At time 18, the fourth part enters the INSPECTION machine and the icon turns green (busy). Keep pressing the <Enter> key until time = 20. At this point, the ASSEMBLY machine is blocked and turns magenta because the INSPECTION machine is still busy and the ASSEMBLY machine cannot output its part. It remains blocked until the four ASSM parts are shipped out of the model. The completed ASSM part can then move from the ASSEMBLY machine into the INSPECTION machine and then the ASSEMBLY machine can pull in four new parts to continue cycling normally. Continue stepping through the model in this way and notice the changing status of the model and the changing value of Work In Progress. To stop the model running, click on the stop button.

You can stop the model at any time and examine the reports that were generated during the model’s run. To access reports, click on an element and press one of the report buttons: The statistics report button provides the most detail; selected elements are grouped by type in the reports. The summary report button provides a single line description of the detail logic for each selected element. The explode report button provides information on the current status of the selected elements. It shows a list of parts currently at a location. The used report button shows whether any elements reference the selected element, and if so, how they are used. Click on the >> and << buttons to view the next or previous report in sequence.

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 33


Learning WITNESS Bi

To look at multiple element reports use the element tree, if this is not shown use view/Element Tree command to display it, which contains a tree of all the elements that you can select a report for. Expand the tree fully for the simulation branch by clicking with the right-hand mouse button on the simulation branch, then choosing the expand all option with the left-hand mouse button. Then, using the right-hand mouse button, click on the simulation branch again, then choosing the select all option to select all elements. Finally, click on one of the report buttons to generate the reports. (There are several other ways to access reports – please try one of the other right mouse button options and the screen selection including netting.) You can see from the machine reports that, when the model is run to time 50, the ASSEMBLY machine is idle for more than a third of the time, blocked for more than 10% of the time and the INSPECTION machine is idle for more than two thirds of the time. One of the ways that you could improve overall capacity would be to reduce the amount of time that the INSPECTION machine blocks the ASSEMBLY machine by reducing the batch size and shortening the inspect time. Try altering the model in the following way: • • • •

Doubleclick on the INSPECTION machine icon. Edit the batch min field by clicking on the 4 and typing 2. Edit the cycle time field by clicking on the 5.0 and typing 2.5. Click on the OK button.

Start the model again and run it as before to see the difference in the blocked time for ASSEMBLY. You should see that, when the model is run to time 50, the blocked time is reduced to 4%. There are many other experiments you can try by changing other parameters in this model. Why not explore some of these options and see how simulation can show the effect of changes to a process? Further example: Try decreasing the inspection time for 4 units (batch minimum) to 4 minutes and see the resulting decrease in blocking time to 8% for the ASSEMBLY machine.

LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 34


Learning WITNESS Bi

Simple Logistics Model

Open â&#x20AC;&#x2DC;Simple Logistics Model.modâ&#x20AC;&#x2122;. In this model, parts called TRUCKS are pushed into the rear of a buffer WAITINGQ according to a time profile of arrivals. Time profiles are commonly used in WITNESS and this model shows just one of the ways in which WITNESS can define these. If you double click on the TRUCK name in the element selector tree under Simulation you will see several detail tabs for the TRUCK part. Under the Arrival Profile you will see that 4 trucks arrive every half hour except for a couple of two hour periods in the day when the arrival rate is raised to 6 trucks per half hour. With an arrival profile such as this WITNESS will randomize arrivals at the given rate within the half hour periods. Trucks queue in WAITINGQ until pulled by the LOADINGBAY machine. The loading bay activity (machine) takes between 3 and 8 minutes for each truck. The time for each is sampled from the uniform distribution. In this particular model the loading bay has a problematical loading ramp. This often fails and needs repairing. This type of event is modeled in WITNESS using the breakdown tab on the machine. Double click on the display of the LOADINGBAY on the screen or in the tree and look at the Breakdown tab. You will see that the ramp fails according to a distribution with mean of 4 hours and is takes between 10 and 25 minutes to repair. One of the strengths of simulation as a technique is that you can evaluate the performance of systems such as this where parameters such as durations and stoppages vary over time. When you run the model, you can see the trucks queuing up as they arrive and have to wait their turn for loading. A variable called TRUCKSSERVED is incremented by 1 every time a truck is pushed to ship out of the model. A timeseries called THROUGHPUT plots the TRUCKSSERVED number every 60.0 mins and resets the variable back to zero. A piechart, which refreshes every 30 mins, reports on the utilization of LOADINGBAY. Another key statistic collected is the service time for trucks. A histogram on a second display window shows a histogram of turnaround time for TRUCKS in minutes. Each truck records its time of arrival in an attribute called ENTRYTIME. A record of TIMEENTRYTIME is made in the histogram as a TRUCK leaves the model. LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 35


Learning WITNESS Bi

Run the model and examine the reports as before. To improve service times you could, for example, alter the performance of the LOADINGBAY machine by increasing the reliability of the loading ramp. Try reducing the breakdown rate from 240 minutes average to 400 minutes average and run the model again to see the difference in results. Another plan might be to add a second loading bay â&#x20AC;&#x201C; try changing the quantity of LOADINGBAY to 2. This has a dramatic effect! To see significant changes it is sometimes necessary to run the model for a long period. This is especially true where there is significant variability in the model. Look at the key result of average turnaround time (shown in the histogram window) after you have run the model for 500 time units and again after running to 2000 time units and note what the differences are. For the unaltered model the results show: SIMULATION TIME in minutes

Average Turnaround Time in minutes

500

13.15

2000

16.82

6000

20.80

10,000

18.12

20,000

18.19

30,000

18.16

50,000

18.07

200,000 (over 20 weeks)

17.90

This shows that it takes many minutes for the results of the simulation to become truly known. There are many standard texts which explain in detail how you should establish simulation run time lengths, or when you should choose to execute many different simulation runs with different random number seeds. The above illustrates the importance of this. LEARNING WITNESS BOOK ONE

MODELING OVERVIEW

Page 36


BUILDING YOUR FIRST MODEL Introduction This is a description of how to build and use a simple WITNESS model. The model demonstrates concepts, and is not meant to represent a real industrial system. Much larger and more detailed models can be developed in WITNESS. The model is built incrementally. In this way you can ensure that each stage of the model is correct before you go on to the next stage, and it is possible to see clearly the effects of any change that you make. In stages 1 and 2, you build a simple model containing machines and buffers, and understand how to run a model and obtain results. In stage 3 you add a simple conveyor and a further machining operation and in stage 4 you add further characteristics breakdowns and labor. By stage 5 the model is complete, and you will learn how to view your model running in three dimensions. With even a small increase in the complexity of the model it becomes difficult to calculate the statistics manually and it is seen that simulation is essential to determine throughput. If you donâ&#x20AC;&#x2122;t want to build the model, but would like to see the incremental approach to model building, run models STAGE1.MOD to STAGE4.MOD in the demo\tutorial subfolder of your WITNESS installation. These model files correspond to the model at the end of stages 1 to 4.

Model Summary In the model, Widgets are produced, washed and weighed. After each operation parts are passed to a buffer in front of the next operation. After production they travel on a conveyor to a packing machine, are packed in twos and then leave the model. A technician is required to operate the packing machine and is also used to repair the wash machine when it breaks down.

LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 37


Learning WITNESS Bi

Stage 1 Open the model STARTUP.MOD, which is located in the Tutorial folder. See the section at the start of this book to find the location of this if needed. This designer elements model allows you to add WITNESS elements to your model quickly and easily. The first stage of the model you are about to build contains a part, which is called Widget, a producing machine (Produce) and a buffer (QWash).

Click and drag a machine from the designer element window on to the main modeling screen. Whilst you are dragging you will see a little plus symbol in a small box underneath the cursor – this indicates you have picked up the part correctly. The machine is now part of the model you are building. Add a buffer by clicking on the buffer icon in the designer elements window and dragging it to the position that you want in the modeling screen. Add a part in the same way. The three elements for this first stage are now all added to the model and the next step is to add the detail needed to run the model.

Process Flow Logic The next step in this model is to define logic rules linking these elements together. The simplest way to input these rules is by the toolbars and the mouse. There are several types of connection rules in WITNESS (please see the reference section later in this book and the Quick Reference Book for full details). Common ones include push and pull, percent and sequence rules. Less common ones also exist to offer complex rules which will match attributes or conditions, ‘if’ rules to enter complex decision logic, etc. We will begin by using simple PUSH and PULL rules to describe the flow of parts through the system.

LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 38


Learning WITNESS Bi

Machine Rule Information Select the machine Machine001 by clicking on its icon. Now click on the visual pull button on the standard toolbar: The default rule should be pull â&#x20AC;&#x201C; leave this in this case but note that others are selectable from the pull down combo box. Click on the Part001 display and then the WORLD button and you should see the following: Hint: When you click on the Part001 display, it may appear that nothing has happened. There is a small message at the bottom left of your screen that shows the current part type selected. It initially says 'Current part: ALL', and will change as the part is selected.

WORLD is a term used by WITNESS to indicate parts that are outside the model, and hence will be created and brought into the model by this command. Click on the OK button to accept the rule. Now click on the Visual Push button: Click on the buffer display and then OK to select this rule.

Running the Model Set the end time for the run in the text box next to the run until button (alarm clock symbol) on the run toolbar by clicking in the box and then typing in 100. Now click on the run button to start the model running. WITNESS has been designed with an inbuilt safety mechanism to prevent you from running a model if vital information is missing. You have not entered a cycle time for the machine, so as soon as you start to run the model, it prompts you for this. Enter: Cycle Time: 5 Click on the OK button. Run the model at different speeds using the run toolbar controls and adjusting the walk rate and turning walk on and off using the run toolbar button and slide control:

LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 39


Learning WITNESS Bi

Note the changing color of the machine's status icon – yellow is idle (ready to work), green is working. There are several more colors that you will see later on including blue – waiting for cycle labor, red – broken down, magenta – blocked and light blue for machine setups.

Anticipated Results With a cycle time of 5 minutes it is apparent that after 100 minutes you would expect 20 parts to have been produced and be in the buffer waiting for the wash operation. Observe this and also note in the statistics report for part (use the right hand mouse button menu on the Part001 display and select statistics with the left hand mouse button) that 21 parts are now present in the model in total. That means 20 in the buffer and 1 in the machine.

Giving Meaningful Names to the Elements Although our model works, it relies on us knowing that the part is a widget, and the machine is the 'Produce' machine. As we extend the scope model, it will become more difficult to recognize all of the machines, buffers etc. To help with this, we must change the names of the elements, and later we will also change the icons used for their display. You may have been using WITNESS with the element tree window open; this will allow you to see the names of all of the elements as you add them to your model. If it is not already open, you should open it now by using the element tree button from the toolbar. In the element selector window, select ‘Part001’. Now click on Part001 again (don't doubleclick or it will open up a far more complex data form that we will look at later on), and you will be able to type in a new name. Call it ‘Widget’.

Repeat the process to change the names of:Machine001 to Produce Buffer001 to QWash. The model has not changed in terms of how it will perform, simply in terms of how it looks and what things are called. Check this out by re-running your model and ensuring that the LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 40


Learning WITNESS Bi

results are correct. Note the use of the Begin button time zero in order to re-run a simulation.

to rewind the simulation back to

This corresponds to the model STAGE1.MOD.

LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 41


Learning WITNESS Bi

Stage 2 Now you have created one machine and one buffer, and checked that the model works so far, you can add more model elements. The value of building a model in incremental stages like this cannot be emphasized too strongly. It is much easier to isolate mistakes and potential problems and it enables you to understand what is happening much more clearly. Additions and changes can be made at any time and these are incorporated immediately without the need to reset your model. You can continue building your model using the part and machine that you have already used in the Basic set of designer elements. However, as a quick way of selecting machines with different appearances, there are some alternatives available in the ‘More Buffers’ and ‘More Machines’ designer groups. First of all select the ‘More Machines’ designer group. Add another machine to the model by clicking on Mc_Wash in the designer elements window and positioning the new machine to the right of the existing buffer. In terms of its logical behavior, this machine is exactly the same as the machine that you added previously; however, you will see that its display has been configured differently. Change the name of this machine from the element selector as before. Its new name is: Wash When prompted, enter the Cycle Time: 4 Now add another buffer following the WASH machine. This time use the 'Bf_Count' designer element from the 'More Buffers' designer group; you will find that this displays a count of how many parts are in the buffer rather than showing the parts. Change the name of this buffer in the usual way: Name: QWeigh Add another machine based on the Mc_Weigh machine in the 'More Machines' group, and as before set: Name: Weigh When prompted, enter the Cycle Time: 3

Rules In order to make the model run, the last step is to enter the input and output rules which control the flow of parts through the model in the same way as in Stage 1. Click on the Wash machine to select it. (note Wash is displayed in the select box on the standard toolbar). Click on the visual pull button. Then click on the QWash buffer display. Click on OK to accept the rule Pull QWash Use the visual push button to create the rule Push QWeigh

LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 42


Learning WITNESS Bi

Next, for the WEIGH machine: Use the visual pull button to create the rule Pull QWeigh Use the visual push button to create the rule Push SHIP (use the SHIP button on the VISUAL RULE Bar) SHIP is an expression used by WITNESS to represent things that are outside the model. It is similar to the WORLD expression that we saw earlier. When a part is pushed to SHIP, it leaves the model. Rearrange the elements on the screen if necessary. It should now look something like this:

Anticipated Results You know that the time taken to process a widget now is: 3 minutes to produce 4 minutes to wash 5 minutes to weigh Therefore the first widget will be produced (shipped) after 12 minutes and one every 5 minutes thereafter (due to the limiting rate of the weigh operation). Therefore it can be calculated that after 100 minutes 18 will have been shipped. Use the statistics report as in stage one to confirm this for a run of 100 minutes.

Modifying the Model Display You may wish to modify the way elements are displayed to enhance the look of the model. Element displays can be selected and dragged around the screen with the mouse. You can also move the display of several elements at a time by drawing a net around the elements with the mouse and then dragging the net. WITNESS allows you to lock displays on windows or display layers, and also to link the various display items for an element together. To lock displays use the view/layers option or the window/control option. Many display items can be changed directly by selecting on the screen and using the toolbar buttons â&#x20AC;&#x201C; e.g. fonts, colors and layers. All other items have their displays altered using the LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 43


Learning WITNESS Bi

display toolbar for an element. Element displays can also be stretched and deleted; this is done using the mouse. To delete a graphical display of an element, select the graphic to remove using the right mouse button to access the context menu. Now select the Delete Graphics option to remove the graphic from the window. To stretch a graphic, select it with the left mouse button, then use the handles that appear around the graphic as well as holding the Control (Ctrl) button to change its size. Handles will only appear in Graphical Editing mode and if the graphic is resizable. To enable the graphical editing mode use the View\Graphical Editing menu. As an example of changing the graphical display, we will modify the icon for the Produce machine. Right Click on the Produce machine icon and select 'Update Graphic...' from the menu with the left hand mouse button. You should see the following:

Double click on the icon on the dialog to show the picture gallery. Then choose icon number 3 and click OK to select from the gallery and Update to update the icon display. Your model display should now look like this:

This corresponds to the model STAGE2.MOD.

LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 44


Learning WITNESS Bi

Stage 3 Now we will add a conveyor and the packing machine to finish the production line. To create a conveyor select the Transport tab in the designer elements window. Drag Conveyor in the designer window to the layout window.

In order to create the correct layout for the conveyor select it again and then use the Ctrl key on the keyboard in conjunction with the mouse left hand button to drag the nodes of the conveyor to the correct places. The mouse is positioned correctly to move a node when the 4 way arrow display changes to a 2 way arrow display. Selecting and dragging in this way the directional arrows in the center of each section of conveyor (with the Ctrl key) creates additional sections and allows the creation of corners. Lay out your conveyor roughly as shown â&#x20AC;&#x201C; with the co-ordinate displays turned on (Window/Co-ordinates menu item) note that the dimensions are shown for accurate depiction. Note also that the display grid/display/snap to grid are all options â&#x20AC;&#x201C; please see online help for full details.

Add another machine to the model by returning to the basic tab in the designer elements window and clicking on machine and positioning the new machine to the right of the end of the conveyor. Change the name of the machine in the usual way. Name: Pack

LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 45


Learning WITNESS Bi

Detailing an Element You are about to enter the Detail form for the new machine. This is your first introduction to a very powerful facility that allows you to change the characteristics and behavior of WITNESS elements. Elements can be detailed in several ways: The easiest way to access and change the details of an element is to double-click on the element displayed on the screen (that is, the machine icons or the buffer numerical display). Other options include: •

Clicking once on the element’s icon, then clicking on the detail button on the standard toolbar

Using the right mouse button on the element in the element selector and selecting detail.

Change the detail of the new Pack machine by double clicking on its icon. Enter: Type of Machine: Batch (select from pull down list) Batch Min.: 2 Cycle Time: 7 (Note that we have always input a cycle time previously by waiting to be asked. You can now see how you would change the previous answers to adjust the model.) Press the OK button to accept changes to the Pack Detail form. The packing machine packs two widgets together. Often this would be classified as an assembly machine but in this instance where it is the end of the line we will leave it as a batch machine. Change the detail of the conveyor by double clicking it. Enter: Length in parts: 40

Rules Click on the Weigh machine to select it. Click on the visual push button. Delete SHIP in the rule and then click on the Conveyor path display. Click on OK to accept the rule Push Conveyor001 Click on the Pack machine to select it. Click on the visual pull button. Then click on the Conveyor path display. Click on OK to accept the rule Pull Conveyor001 Click on the visual push button. Click on SHIP in the rule bar Click on OK to accept the rule Push SHIP

LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 46


Learning WITNESS Bi

Running the Model Run the model again for 100 time units entering the index time of the conveyor when prompted to be 1.0 After 100 time units we would expect just 8 to have been shipped when we take into account the time spent on the conveyor and all the machines.

Adding a Variable Counter To create a variable to record and display the output from Pack on the screen choose the designer element VInteger (integer variable on the variables tab) and position on the screen as before. Change its name to NumberShipped (no spaces) in the usual way. You could also change its name by double-clicking on it to go to the Detail page, and then changing its name there. We will now use this to count widgets that are packed. Double click on the Pack machine to select it. Click on the actions on output button. Enter: NumberShipped=NumberShipped+1 This is an action that occurs for every part the leaves the Pack machine at which time it increases the value of our variable by one. Click on the OK button to accept this statement. Click on the OK button to accept the Pack detail. Experiment with the way that the variable is displayed, for example:Draw a net around the variable (name and value) to select it all Change the font (button on the display edit toolbar) to be larger and bold Change the font color (another button on the display edit bar). The screen should now look like this:

Run the model and see the counter display change as parts are packed. This corresponds to the model STAGE3.MOD.

LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 47


Learning WITNESS Bi

Stage 4 Now we will add a breakdown pattern (with variability) for the Wash machine and labor requirements into the model. Add a labor element to the model from the basic tab in the designer elements window. Position in the layout window. Change the name of this element in the usual way. Enter: Name: Technician

Random Sampling In real life, operations are subject to a certain degree of variability. You can introduce this variability into your model by using distributions. WITNESS provides a wide range of distributions for you to choose from (or lets you define your own, if you wish to use your own data). WITNESS uses random number streams to sample from distributions. You may either specify these or leave WITNESS to assign different random number streams in different places â&#x20AC;&#x201C; necessary for repeatable and proper experimentation.

Locate the cursor in the time between failures field of the breakdown mode section of the screen. Now you are going to use the distribution assistant to define this. In the element selector window, select the 'Assistants' tab. Expand the 'Distributions' heading to show all distributions available. Right-click the UNIFORM distribution (scroll down if necessary) and select Insert with Distribution Wizard. Enter the limits as 100 and 300, and press the Preview button. This can be very useful to visualize the shape of the distribution, especially when more complex distributions are used.

LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 48


Learning WITNESS Bi

Click OK to accept the information entered. Click on the Repair Time field. Use the same procedure as before to add a Triangle distribution Enter the parameters as Minimum=30, Most Likely=60 and Maximum=120. Click OK to accept the data entered & OK again to close the machine dialog. This means that the Wash machine now calculates: â&#x20AC;˘

the time between breakdowns using the uniform distribution with equal likelihood of any time between 100 and 300 minutes

â&#x20AC;˘

the repair time using the triangle distribution to sample a time between 30 minutes and 2 hours with the most likely value being 1 hour.

Now we will add the rules for the Wash and Pack machines to use labor:

Click on the Pack machine to select it. Click on the labor rule button then click on the Technician labor element. Click on the Save button, and then on the Close button Click on the Wash machine to select it. LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 49


Learning WITNESS Bi

Click on the labor rule button again, but don't select the technician yet This time change the type from Cycle to Repair using the pull-down list. This specifies the task that the labor performs on this machine. Now select the technician again as we did for the cycle of the Pack machine. Now that you have introduced breakdowns, you should run the model for a longer time, for example to time 5000, to ensure that several breakdowns occur. This is so that you can see the full interaction between processes and the competition between elements for labor. Even in this very simple model it is by now impossible to calculate all model statistics manually. The model should now look as follows:

This corresponds to the model in STAGE4.MOD.

Running the Model Run the model for 5000 time units (use the batch button to run fast if you wish). As you might predict from the figures for breakdown, the wash machine is not keeping up with the work rate. Note the queue of widgets in front of the wash machine â&#x20AC;&#x201C; the number of parts in this buffer is growing steadily. The statistics for the wash machine (use the right hand mouse button menu to access statistics) show us that the time spent waiting for the technician to come to repair the machine is small compared to breakdown times and therefore the main problem is the reliability of the machine itself. There are a number of alternative options. We'll look at just two. First let us try adding a second wash machine.

LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 50


Learning WITNESS Bi

Double click on the Wash machine and change the quantity to 2. Reposition the display by dragging the second main icon below the first – note that as the display items are locked, the other queues and icon representing the second wash machine move with the main icon. Your display should look as follows:

Running the model to 5000 now indicates that the wash is no longer the bottleneck of the system – however the bottleneck has just moved downstream. A powerful way to see this is to draw a net around all of your elements, and right-click to select statistics. This will initially show statistics for the Widget, and by clicking the double right arrows you can move on to buffers, machines etc. With the machines shown, press the Chart States button. This gives the graphical representation of how each machine was occupied, as shown below.

The model statistics show that the machine Weigh is blocked for a large percentage of the time and that the Pack machine is waiting for labor for a large percentage of the time. Therefore it is unlikely that any extra Weigh or Pack machines are needed. We could consider more labor at this point, and may have to – however there may be other alternatives. Although the Produce machine is fully used, we can see from the screen that the buffer in front of Weigh is getting full; so we may get more throughput by clearing this.

LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 51


Learning WITNESS Bi

And here is the power of simulation – we can try out what-if scenarios to evaluate many alternatives. What if we could improve the reliability of the Wash machine. It may be worth a Six Sigma project in this area. But is it? Let us try – what if the interval between breakdowns could be increased to between 150 and 300 minutes or even between 300 and 500 minutes. Try these experiments by altering the parameters in the uniform distribution on the breakdown tab for the Wash machine. The first has no great beneficial value. However if the second were possible then it would cure all throughput problems and even remove the need for a second wash machine (try this too!). This type of sensitivity analysis is a great result from simulation. What are the key production levels that require more machinery or labor – can improved control help – e.g. prioritizing work at different areas? All ideas can be tried. Of course in reality this model would be more complex. It may include shift patterns, raw material deliveries or availability and complex production rules. All manner of complexity can be included and tried in models.

LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 52


Learning WITNESS Bi

Stage 5 Looking at the Model in Three Dimensions We have built our WITNESS model as a two dimensional representation of the facility drawn in plan view. This can be extremely powerful for understanding the layout and the flow. In particular, the use of status colors to show what each machine is doing can add a great deal of extra information to the display. However, there are times when it is useful to see the model in three dimensions. Each of the two dimensional shapes in the WITNESS picture gallery is associated with a 3D shape. By using the Model/Quick 3D menu option, a three dimensional view of your model will be created. As you learn more about using WITNESS, you will discover how you can make adjustments to this 3D display. Beyond that, the WITNESS VR module is available to extend this to produce fully realistic 3D simulations of your own facility. You will notice that in the default 3D view that you created has all equipment at floor level, which may of course be correct. It is quite simple to adjust the height of items in the 3D display, and indeed to create additional floors if necessary. Let us suppose that the Produce machine, and the buffer before the Washers are at an elevated position two metres above ground. We will place this on a different 'layer' in the simulation model. Draw a net around the machine and the buffer, and change them from being on the 'Simulation Layer' to the layer called 'Floor plus 2 metres'. You will see that a number of additional layers are defined in the Startup model.

If you now run the Model/Quick 3D option again, you will find that machine and buffer appear at an elevated position as shown below. The 3D window contains a number of toolbar buttons to allow you to navigate around the 3D world and change its appearance. You will find details about how to use these options in the Help system. Look out too for a chapter on VR in the second Learning WITNESS book â&#x20AC;&#x201C; accessible from the Start Page.

LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 53


Learning WITNESS Bi

Summary We hope you have seen how easy it is to build models in WITNESS, and how quick changes can lead to quick results. Remember that you can use models in a group environment; to get new ideas, develop them, and obtain consensus by being able to try them out. This manual contains relatively simple models which introduce WITNESS, although WITNESS is capable of handling large, â&#x20AC;&#x153;real lifeâ&#x20AC;? problems as well. The complete, visual and interactive environment of WITNESS is unique and really does allow managers and engineers to obtain the benefits that simulation can offer. As well as interactive experimentation, WITNESS offers a number of methods to conduct experiments automatically including the Experimenter option from the model menu and the Scenario Manager with its database repository of full results. The WITNESS Experimenter includes Optimization with algorithms that provide intelligent searches for good solutions. Simply define what can vary in a model and the responses that are being looked for and the software will work tirelessly to find the best options.

LEARNING WITNESS BOOK ONE

BUILDING YOUR FIRST MODEL

Page 54


MODEL GALLERY Typical Manufacturing Model

A typical layout of a manufacturing facility model in WITNESS. It includes standard conveyors, robots, machines, a carousel, manufacturing cells and a power and free conveyor system. It incorporates a zoom view window and various customized reports. One of the standard WITNESS designer module sets can also be seen.

LEARNING WITNESS BOOK ONE

MODEL GALLERY

Page 55


Learning WITNESS Bi

Typical Warehouse Model

A typical warehouse model in WITNESS. It includes conveyors from production and three different uses of tracks and vehicles elements including a high bay racking area, an AGV network serving P&D stations, and a shuttle mechanism feeding a sortation lane system. A repeat timeseries is included showing min, max and mean levels of stock per hour of the day, a list of current tasks waiting to be done in the high bay area and a count of the number of stockouts experienced in the model run.

LEARNING WITNESS BOOK ONE

MODEL GALLERY

Page 56


Learning WITNESS Bi

Office Model

This model represents the layout and movement around an office complex. It uses WITNESS path elements for modeling all movement routings and timings. A key statistic in this model is the congestion at the cafeteria and the waiting times for people completing registration and application activities. The element tree display shown is standard in all models to enable easy access to data and reports. The table and central chart are standard reports.

LEARNING WITNESS BOOK ONE

MODEL GALLERY

Page 57


Learning WITNESS Bi

Call Centre Business Process

This model is a detailed business process model where each individual job carried out can be seen on screen. Each stage of the process is expanded to show the input queue, the entities being processed and the human resources used to perform the tasks. The model incorporates six sigma scores for achievement of the quality targets and process throughput timing targets and a range of other custom reports and charts indicating other key performance indicators.

LEARNING WITNESS BOOK ONE

MODEL GALLERY

Page 58


Learning WITNESS Bi

Airfield Logistics

This model shows an airfield logistics model where different strategies of local and central repair are being experimented with for a key navigational component. Success is measured in flying availability terms with the aim to keep all aircraft up and running for the minimum spares cost. Colored icons are used to distinguish components for different airfields; pie charts illustrate the flying availability and fitting times. A special type of WITNESS timeseries shows the maximum, mean and average repair loading across a repeated time period.

LEARNING WITNESS BOOK ONE

MODEL GALLERY

Page 59


Learning WITNESS Bi

Tracks and Vehicles

This model shows another example of WITNESS tracks and vehicles, with a shuttle mechanism feeding parts to and from machines. Parts are produced on four assembly machines from components held in the stores. The parts are then taken at random but in equal proportions to one of five paint booths. Colored icons are used to distinguish finished parts from the unpainted ones. Finally the parts are baked, tested and dispatched. A graph shows production per eight-hour shift.

LEARNING WITNESS BOOK ONE

MODEL GALLERY

Page 60


Learning WITNESS Bi

Garage Forecourt

These models of garage forecourts show the ability of WITNESS to model at different levels. Whilst one model is at the site level, the other models the exact distances between cars and the fuel dispensers.

LEARNING WITNESS BOOK ONE

MODEL GALLERY

Page 61


Learning WITNESS Bi

Chemical Processing Plant

This model represents a chemical processing plant. It shows the great variety of possibilities with WITNESS for the chemical and other process industries. There are filling stations, logistics, production by order priority, recipes, multicycle reactors, production planning etc. Continuous modeling elements of fluids, pipes, tanks and processors are all available in WITNESS.

LEARNING WITNESS BOOK ONE

MODEL GALLERY

Page 62


CASE STUDY: JETTY.MOD This model is a representation of a jetty where ships arrive to deliver a range of products. The crane labor element is used by the jetty machine to represent the constraint that only one ship may unload at any one time due to only one crane being available. Ships can only pass through the lock under certain tide conditions. The tide is represented by the tide processor element which has rising and falling warning levels to set the state of the tide.

To open this model, start WITNESS and then use the file/open command or the open file button on the standard toolbar to open JETTY.MOD in the DEMO folder. This folder is found using the sample models link from the WITNESS Start Page. Use the Window menu to view different windows which contain additional information.

LEARNING WITNESS BOOK ONE

CASE STUDY: JETTY.MOD

Page 63


Learning WITNESS Bi

A histogram of mooring delays can be seen by using the associated view from the histogram icon at the top left of the window entitled Facility Overview. The window entitled Jetty Utilization displays a series of pie charts showing jetty utilization’s.

This model can be used to illustrate the power of simulation in determining how facilities can be improved. To understand this scenario fully, it is necessary to find out more information. This is a typical phase of many simulation projects and generally you should do this before you start building a model. It is vital to understand the process or business situation being modeled as fully as possible and to establish the objectives of the modeling work to be done. For this particular scenario the Harbor Operations Manager has been targeted with establishing how business could be increased. Ships that pass this harbor have the option of using alternative facilities a short distance further on. If the outer harbor area here is full, no ships will wait, and they will move on to the alternative facilities. However if the outer harbor area is not full (and the current capacity for holding inbound ships here is 2 ships only) then all ships will wait. The above story illustrates an occasion when a skilled simulation practitioner will, at the very least, ask one or two more questions about this situation. When considering the alternatives open to the Harbor Operations Manager, it is important to verify the accuracy of the above rules. For example, it may be the case that the alternative facility owners may be enticing custom for some ships with special ‘two for the price of one’ offers. Therefore, it may not be the case that all ships will prefer this harbor, even if they are given the opportunity. It is vital that you establish as much information regarding the model as possible so that you can explore the ‘what-if’ scenarios accurately. In this case, we will take it that the above rules have been established to be true.

LEARNING WITNESS BOOK ONE

CASE STUDY: JETTY.MOD

Page 64


Learning WITNESS Bi

The timing data for the base case model has all been established and is already loaded into the model included in the WITNESS installation. Timings include: Lock timing for one ship Inter-arrival rate for ships Crane Unloading time for each ship Capacity of Outer Harbor Holding area for inbound ships Capacity of Inner Harbor Holding area for inbound ships Capacity of Inner Harbor Holding area for outbound ships Number of Cranes Tidal System

20 minutes NEGEXP(60,1) 150 minutes 2 3 2 1 High tide to low tide in 5 hours. Low tide to high tide in 5 hours. 1 hour at full tide.

Lock operates above 3 meter depth The inter-arrivals rate NEGEXP(60,1) means that, on average, one ship arrives every 60 minutes (but spread randomly). This random arrival pattern is represented by the Negative Exponential distribution which is one of WITNESS’s many standard distributions. The 1 represents pseudo random number stream 1. You could think of this as an electronic die which is rolled whenever a value needs to be used. In this way, different arrival intervals are set as the simulation runs. WITNESS experiments are repeatable in that every run will generate the same samples of random numbers (in this case, the same arrival pattern). Note that with WITNESS you do not need to specify random stream numbers – it is optional. NEGEXP(60) is also perfectly acceptable. Again, the distributions and accuracy of timings and so on can be vital to the simulation results. If a timing can vary between ten and twenty minutes, then you may need to model this. Dealing with uncertain data When data is uncertain, the best course of action is to use the ‘best guess’ data available, but make sure that sensitivity analysis on this data is carried out in the experimentation. For example, if a timing is given as 10 minutes but it could be anywhere between 5 and 15 minutes, then (if you cannot time it easily) use the value 10 in the model but do some model runs with values of 5 and 15, and perhaps several values in between. If the different timings make a significant difference to your results, then it is important that you establish the data more accurately. The simulation model has proved that you need to know this data if you are to predict ‘what-if’ information. However, if the different timings make little or no difference, then why waste time and energy in establishing the data more accurately?

LEARNING WITNESS BOOK ONE

CASE STUDY: JETTY.MOD

Page 65


Learning WITNESS Bi

Let us now look at the base experiment with the model. A suitable run time for this model is one hundred days. Please note that many simulation models should be run for a long time. This example model contains a particularly unpredictable distribution in the negative exponential. It is this that means that the model must be run for a fairly long time to cater for all the inherent variability in the process. If your machine is not powerful enough and is taking too long to perform the experiments then try shorter run lengths; although the results will not match the ones shown here exactly, the comparisons between runs will probably still largely be indicative of the true choices. However, please be aware of the problems of run lengths which are too short. Several of the standard texts on simulation give full explanations of how to establish run length (or in the case of non-equilibrium situations, the number of replications with different random number settings to be run). In essence, you need to run the model until the model has experienced all the variability â&#x20AC;&#x201C; a simple test of this is to look at the variability of the results over successive time segments. That is, if the result from each 1000 minutes over a 10,000 minute run is the same, then 1000 is possibly the right length of run for further experiments. However, this can be misleading (for example, if the data contains one event that will only happen in a million time units then a million or more may be necessary).

To run the model for 100 days you can enter 100*24*60 in the box in the execute toolbar at the bottom of the screen and then click on either the run or the batch (fast forward) button. The simulation model will stop at the entered time (as long as the clock button by the side of the box is depressed). To view results, display other windows by using the windows command. You can also look at the standard result tables by using the reports, select all the elements in the simulation section of the element selector and then click on the statistics button. The forward and backward arrow keys in the reports dialogs enable you to move through the different pages of the reports.

As explained above, the results shown below represent a run of the base model data for one hundred days, which is assumed to be sufficient in this case. This raises the question of which results should be examined. In this case the key result is the level of business â&#x20AC;&#x201C; that is, the number of ships unloaded versus the number rejected (and consequently lost to the competition). Other interesting results include the average time that a ship takes to be unloaded (from entering the harbor). This represents the level of service, which could affect the decision to return. Other statistics will guide us as to the key options for change by indicating high or low utilizationâ&#x20AC;&#x2122;s of different facilities, showing where bottlenecks occur in a process and where investment may help.

LEARNING WITNESS BOOK ONE

CASE STUDY: JETTY.MOD

Page 66


Learning WITNESS Bi

956 ships have been served, the average turnaround time is 1102.35 minutes and ships at berth positions have spent time waiting for the one crane available. If you examine the other WITNESS results windows, the other key figures here are : â&#x20AC;˘ Crane busy 99.86 % of the time â&#x20AC;˘ Lock busy 26.64% of the time (however, from calculation it is available only 5/11 or 45.45% of the time due to tidal considerations). It is often helpful to tabulate these results for comparisons with other runs: Scenario Title Ships Served Ships Rejecting Harbor because full Average Turnaround Time Crane Utilization Lock Utilization Berth Waiting for Crane Berth Blocked for ship leaving

Base Case Run 956 1450 1102.35 99.86 26.64 64.62% averaged over 3 jetties 1.58% averaged over 3 jetties

We will now assume that these results have been validated against actual performance data. This is another vital step in many simulation projects, as if the model is inaccurate then conclusions from comparative runs may also be wrong. Now we can examine the options open to the Harbor Operations Manager. In most simulation projects there are usually a number of real-life options favored by the experience of the management of the facility. This experience may uncover other data which may be relevant and need to be included in a model. Often this experience will help you to decide the most useful options for experimentation. However, it is also your duty as a simulation practitioner to explore the model that you have created; to understand the relationships between the model parameters and to get to know the full dynamics of the process. By playing with the model you can learn a lot which, in conjunction with other factors such as experience, should help you to determine the best way ahead. Some options may be ruled out as impractical or too costly. Cost is often to be taken into account. LEARNING WITNESS BOOK ONE

CASE STUDY: JETTY.MOD

Page 67


Learning WITNESS Bi

In this example we will first simply look at the options which may increase the number of ships served. You may care to think about this yourself before proceeding. What options do you think may lie open to the Harbor Manager?

Some options include: i) ii) iii) iv) v) vi)

Increasing the number of unloading cranes Increasing the speed of the unloading cranes Increasing the capacities of the different harbor areas to accept more ships (3 separate options here) Increasing the capability of the lock to handle ships for longer periods of time Increase the capacity of the lock Dredge the channels to the lock so that the lock can operate at lower levels.

There may well be other options which are dependent on the type of goods to be unloaded â&#x20AC;&#x201C; alternative unloading mechanisms, different traffic organization in the inner harbor, and so on. The results show that with the current situation the jetties are waiting for a crane for a long time. Therefore our first experiment here may be to try adding another crane. Double-click on the word crane on the jetty layout â&#x20AC;&#x201C; the jetty dialog should appear. Change the quantity of cranes to 2 and click on the OK button. Now run the model. (first begin and then batch the model) to the 100 day mark again.

LEARNING WITNESS BOOK ONE

CASE STUDY: JETTY.MOD

Page 68


Learning WITNESS Bi

The results this time show the following: Scenario Title Ships Served Ships Rejecting Harbor because full Average Turnaround Time Crane Utilization Lock Utilization Berth Waiting for Crane Berth Blocked for ship leaving

Base Case Run 956 1450

Two Cranes 1355 1055

1102

647

99.86% 26.64% 64.62% averaged over 3 jetties 1.58% averaged over 3 jetties

70.68% 37.67% 14.69% 22.69%

The comparisons show us that investing in a second crane would increase the number of ships that can be served by 41.7%. However the results also show that if this is done, the bottleneck is no longer the crane operation. With berths being blocked for over 20% of the time there is now a bottleneck beyond this operation. We can now try increasing the number of ships allowed in the inner harbor in the outgoing queue or perhaps try increasing the availability of the lock. To reset the capacity of the outward queue in the inner harbor, double-click on the appropriate queue and enter a capacity of 3 (for example) instead of 2. To change the capability of the lock, double-click on the tide processor element, select the warning levels page and alter both the rising and the falling level to 2. (You can do this by clicking on the level, altering the value in the box above and then updating the level). Try each of these options singly and then both together, keeping 2 cranes in each case. This table shows the evaluations of all five scenarios so far: Scenario

BaseCase

2

3

4

5

1 2 5

2 2 5

2 3 5

2 2 7

2 3 7

RESULTS Ships Served Ships Rejecting Harbor because full Average Turnaround Time Crane Utilization

956 1450 1102 99.86%

Lock Utilization

26.64%

Berth Waiting for Crane (jetty average) Berth Blocked for ship leaving (jetty average)

64.62%

1355 1055 647 70.68 % 37.67 % 14.69 % 22.69 %

1379 1031 626 71.93 % 38.33 % 14.17 % 12.82 %

1696 714 488 88.44 % 47.14 % 20.74 % 7.11 %

1705 705 473 88.91 % 47.39 % 21.02 % 1.94 %

DATA Number of Cranes Outgoing Harbor Queue Capacity Lock availability in hours out of 11

LEARNING WITNESS BOOK ONE

1.58%

CASE STUDY: JETTY.MOD

Page 69


Learning WITNESS Bi

This shows that if the channels to the lock can be dredged to enable it to operate for 7 hours out of 11 instead of 5, this has a much bigger effect than enabling more queuing space in the inner harbor for outgoing ships. However all these results must be balanced with the practicality of the solution and the costs. For this example we shall establish some costs: • • • • • • • •

Cost of an additional crane is $10Million (depreciated over 500 days) Cost of additional labor for new crane $1000 per day Cost of dredging channels to lock $2,000 per day Cost of increasing outgoing harbor queue to 3 (through new organization/flow buoy installation/extra drainage) $1,000 per day Profit cleared on normal operations for unloading one boat $4,000 Cost of third crane would be the same as the second Cost of increasing other queuing capacity areas by one in the model is the same as for the outgoing harbor queue. Cost of building a second lock $10Million (depreciated over 500 days)

Lanner’s challenge to you is to establish the best option for this harbor, based on the information given above. You can submit the result to support@lanner.co.uk for verification.

LEARNING WITNESS BOOK ONE

CASE STUDY: JETTY.MOD

Page 70


WITNESS ESSENTIALS REFERENCE SECTION Introduction This section of the Learning WITNESS books builds from the Overview section and the example models shown. It provides further basic facts about building WITNESS models that are essential to know before embarking on a model of your own. Read this section thoroughly before proceeding to the second Learning WITNESS Workbook. It covers the following topic areas: • Key element details for the Basic WITNESS Elements o Parts o Buffers o Machines o Labor • WITNESS Rules o How to enter rules o List of Rules Allowed o Labor Rules • WITNESS Actions Language • Using Variables, Functions, Expressions and Distributions o Variables o Inbuilt Functions o User defined functions o Distributions • Attributes o System Attributes o Attribute Elements o Tag Displays • Reports o Statistics o Used o Explode • Breakdowns and Setups o Breakdowns o Setups • Quantities • N and M • Model Displays • Basic Working with Data from Excel

LEARNING WITNESS BOOK ONE

WITNESS ESSENTIALS REFERENCE SECTION

Page 71


Key Element Details for Basic Elements

Introduction In this section the four elements Parts, Buffers, Machines and Labor are examined. This builds on the information about these elements listed at the overview section of this book. It is assumed that the methods of bringing a modeling element into a model are already well understood through the Building your first model chapter. Some of the properties discussed of the different elements will already have been encountered in the model build and demo examples in this book but some will be new – the aim of this section is to give a fuller appreciation of these elements and how they work in a variety of modeling situations.

Parts When the Part detail dialog is opened the following options can be seen (some fields and tabs are dependent on which option is chosen from the pull down list for Type).

Name: This identifies the part and can be changed easily here. Any changes made to the name will be cascaded throughout the model – i.e. all references to the name will be updated automatically. Arrivals: The Type may be set to Passive, Active or Active with Profile. •

Passive: Parts are called into the model by machines or other model elements when required.

Active: Parts arrive in the model as dictated by an inter-arrival time which can be a constant figure or distributional. The parts arriving are routed by the rule entered in rule dialog accessed using the To… button

LEARNING WITNESS BOOK ONE

KEY ELEMENT DETAILS FOR BASIC ELEMENTS

Page 72


Learning WITNESS Bi

Active with Profile: Parts arrive in the model according to a profile set in the profile tab on the Part detail screen. This sets the number of arrivals that are required in a series of timeslots. The parts arriving are routed by the rule entered in rule dialog accessed using the To… button

On all detail dialogs are Actions boxes. These allow commands to be executed at different times in a model. There are hundreds of commands and functions that can be accessed to find and set different data in these actions boxes – we will see several examples as we model. For example on the part dialog is “Actions on Create”. This allows commands to be run whenever a part is created – e.g. to set attributes or maybe something more complex – e.g. if this is the 50th arrival then a flag may be set to allow a certain machine to start elsewhere in the model. The possibilities are endless!! Depending on the type of arrivals chosen there are different fields to set in the detail dialog. For example with arrival profiles an extra tab is displayed – this could be setup as below to set a repeated 2 hour arrival profile alternating between 5, 10, 15 and 5 arrivals each half hour.

Parts appear in most WITNESS models. Part arrivals are often passive when it is desired to check the capacity of a line for production – i.e. the line is assumed to have a constant feed of parts. In this case the first machine in the line is set to have a pull rule – such as the following: Pull from PartA out of World This will pull a part from outside of the model whenever the machine is idle. Active part arrivals are used when there is a constant rate of arrival (or a constant distributional rate). i.e. for the entire run length of the model the same inter-arrival time figure, distribution or expression can be used. Part Arrivals with Profile are used where the flow of parts into a model varies over time according to a data profile. This is more common in the service industries where passengers arrive at a restaurant or patients at a hospital. Schedules It is important with WITNESS to understand the best ways to input a schedule into a manufacturing model. There are two ways to do this.

LEARNING WITNESS BOOK ONE

KEY ELEMENT DETAILS FOR BASIC ELEMENTS

Page 73


Learning WITNESS Bi

1. One method is to use a Part File â&#x20AC;&#x201C; this is another WITNESS element in one of the designer tabs. It links to a file that may be edited to list each part arriving and the time that the part arrives. The dialog for the Part File element also contains the output rule to direct parts into the model. Using this method the different part dialogs for parts should be set to Passive arrivals. 2. It is more common however for part schedules to read data on the schedule in from Excel. A simple example of this is shown in the chapter on part schedules in the second Learning WITNESS workbook. Using this method the different part dialogs for parts should be set to Passive arrivals.

LEARNING WITNESS BOOK ONE

KEY ELEMENT DETAILS FOR BASIC ELEMENTS

Page 74


Learning WITNESS Bi

Machines When the Machine detail dialog is opened the following options can be seen. (some fields are dependent on which option is chosen from the pull down list for Type).

Name: This identifies the machine and can be changed easily here. Any changes made to the name will be cascaded throughout the model – i.e. all references to the name will be updated automatically. Quantity:

How many of this machine can process parts concurrently.

Priority: Used to set priorities to obtain labor resources Type:

Seven types of machine – offering a range of powerful choice:

Single: 1 part in, 1 out

Batch: x parts in x out

Assembly: x parts in 1 out

Production: 1 part in x out

General x parts in y out

Multiple Cycle: 1 part in processed in several steps – each inputting more parts and outputting more parts as required. Each cycle can have a separate timing, labor rule (i.e. require different resources), etc. Very powerful WITNESS option!

Multiple Station: 1 part in processed in several steps. When first part passes to second step another part can enter the machine.

More Key details for Machines Input Rules – govern how parts arrive at a machine. Cycle Time – the timing to machine the part(s)

LEARNING WITNESS BOOK ONE

KEY ELEMENT DETAILS FOR BASIC ELEMENTS

Page 75


Learning WITNESS Bi

Labor rule – which labor resources are needed for the machine Output Rules and Actions – govern how parts leave a machine Breakdowns: A tab of information on machine failures (see later) Setups: A tab of information governing timings between machine operations (see later) Fill/Empty Tab: Used to fill parts with fluids Shifts: Handles the assignment of shifts to machines On all detail dialogs are Actions boxes. These allow commands to be executed at different times in a model. There are hundreds of commands and functions that can be accessed to find and set different data in these actions boxes – we will see several examples as we model. For example on the machine dialog is “Actions on Start”. This allows commands to be run whenever the machine is starting to cycle. It might be used to look at the type of part being processed and set the cycle time accordingly. See later in the section on using variables, functions, expressions and distributions for details on how to do this.

LEARNING WITNESS BOOK ONE

KEY ELEMENT DETAILS FOR BASIC ELEMENTS

Page 76


Learning WITNESS Bi

Buffers When the Buffer detail dialog is opened the following options can be seen. (some fields are dependent on which options are chosen).

Name:

This identifies the buffer and can be changed easily here. Any changes made to the name will be cascaded throughout the model â&#x20AC;&#x201C; i.e. all references to the name will be updated automatically.

Quantity:

The number of separate buffer queues that this element represents

Capacity:

The number of parts that can be in each buffer queue

Input:

Details of where in the buffer an incoming part is placed

Delays:

Buffers can demand that a part stays for a minimum or a maximum time. Together with associated timing fields and rule fields.

Output:

Details of where in a buffer a part can exit from

LEARNING WITNESS BOOK ONE

KEY ELEMENT DETAILS FOR BASIC ELEMENTS

Page 77


Learning WITNESS Bi

Labor When the Labor detail dialog is opened the following options can be seen:

Name: This identifies the labor element and can be changed easily here. Any changes made to the name will be cascaded throughout the model – i.e. all references to the name will be updated automatically. The main setting in the simple labor detail dialog is the shift that the labor resource is allocated to. If there are no special shift elements in a model then the default Shift “Always Available” is used. Again there is a quantity field that allows the number of labor to be varied. When shifts are defined it is possible to have different numbers of the same labor element on different shifts. Although called labor, these elements can be used for any resource needed in the model – e.g. a specific piece of equipment or even a particular room. All resources defined as labor elements can be requested by other elements in order to do specific events. e.g. labor elements can be required by Machines to cycle, or to repair a breakdown, Tanks for cleaning, Conveyors to repair a breakdown, etc.

LEARNING WITNESS BOOK ONE

KEY ELEMENT DETAILS FOR BASIC ELEMENTS

Page 78


WITNESS Rules Introduction WITNESS Rules are used to direct the flow of parts (or fluids) around a model. There are input rules and output rules – i.e. rules that select parts to a particular element and rules that send the parts already at an element elsewhere. The following table shows where input and output rules are found in WITNESS: Element Type

Input Rule

Output Rule

Comments / Special Cases

Parts

Parts (when the type of arrival is set to active) can output themselves into a model (e.g. to a machine or a buffer). This would commonly be a simple PUSH rule.

Machines

Both input and output rules can be defined for machines. For multiple cycle machines there are input and output rule options for all defined cycles. When a machine breaks down another output rule is possible in case the part(s) in this case need redirection.

Conveyors

Both input and output rules can be defined for conveyors.

Buffers

An output rule may only be defined for a buffer when the buffer has a maximum delay time set – the rule will only be enacted at that time. Normally buffers are pushed to and pulled from other elements (e.g. machines)

Vehicles

Vehicles do not output parts – but at the start of a model a vehicle must output itself to a starting track position in the model using the vehicle output rule.

Tracks

Tracks output vehicles travelling along them to another track

Tracks (Loading)

A track loading rule inputs parts to the vehicle currently at the head of the track.

Tracks (Unloading)

A track Unloading rule outputs parts from the vehicle currently at the head of the track.

Carriers

Carriers do not output parts – but at the start of a model a carrier must output itself to a starting power and free station or section in the model using the carrier output rule.

Sections

Sections output carriers travelling along them to another section or station.

Stations

Stations output carriers to another station or a section.

Stations (Loading)

A loading station rule inputs parts to the carrier currently at the station.

Stations (Unloading)

An Unloading station rule outputs parts from the carrier currently at the station.

LEARNING WITNESS BOOK ONE

WITNESS RULES

Page 79


Learning WITNESS Bi

The default rule in each of the above places is WAIT. Other permitted rules are: Input Rules

Output Rules

Pull Sequence Percent Most Parts Least Free Select Match

Push Sequence Percent Least Parts Most Free Select

IF / ENDIF loops may be used in all rules for conditional logic. Rules may be typed in to the relevant rule boxes accessed from the element detail dialogs. Simple rules such as Push, Pull, Sequence and Percent may be entered using the visual rules toolbar buttons – there are many examples of how this is done in the model builds in this book and the second Learning WITNESS workbook. Examples Push to BufferA

This rule will push all the parts being output to the element BufferA

Pull from MachineA(1)

This rule will pull parts from the first indexed element of MachineA. i.e. if MachineA has a quantity of 3 only the first of the three will be pulled from

Sequence /Wait BA#(1),BB#(1)

This sequence rule will sequence TO or FROM (depending on whether this is an input or an output rule) the two elements BA and BB – one from each. The rule will WAIT if BA or BB cannot accept or provide the parts required. (other options with SEQUENCE include moving on to the next choice (NEXT) or starting the sequence again (RESET).

Percent BA 50.0,BB 50.0

This percent rule will direct parts TO or FROM (depending on whether this is an input or an output rule) the two elements BA and BB with an equal likelihood of 50 percent. Each individual routing will be sampled randomly from a distribution so there will be no fixed pattern. Over time the numbers being routed each way will be approximately the same. Any percentage figures can be entered – if they do not add up to 100 then WITNESS will adjust the figures automatically (i.e. normalize the figures).

PUSH to SHIP

Pushes parts out of the model.

LEARNING WITNESS BOOK ONE

WITNESS RULES

Page 80


Learning WITNESS Bi

Labor Rules Labor Rules are used to allocate Labor elements for different activities. It may be the cycling of a machine, a repair on a machine or a conveyor, etc. The rules may be entered in the Labor rule box situated on many element dialogs. Alternatively Labor rules may be set using the Visual Labor Rules toolbar button - there are many examples of how this is done in the model builds in this book and the second Learning WITNESS workbook. Examples Simple Labor Rules Operator#1

Use one Operator element to carry out the task (if the Operator is not available the task will be delayed)

WorkerA#1 OR WorkerB#1

Either WorkerA or WorkerB will be used. (WorkerA in preference to WorkerB)

WorkerA#1 AND WorkerB#2

One WorkerA and 2 WorkerB will be used when available

More complex rules It is possible to use IF / ENDIF loops for conditional logic IF NAVAIL(WorkerA)>3 WorkerA#1 Else WorkerB#1 ENDIF

This rule will use a WorkerA if there are more than 3 of them available (idle) at the time of request. Otherwise a WorkerB will be used.

LEARNING WITNESS BOOK ONE

WITNESS RULES

Page 81


WITNESS Actions Language The WITNESS actions language is the syntax used in all the action boxes which are found on most WITNESS element dialogs. These action boxes allow calculations to made, values of variables to be set and many other actions to be made to happen (such as moving fluid between tanks, scheduling a new event, writing out results to a file, etc). In the actions boxes many of the things explained in the following sections can be used – system functions, the setting and accessing of variables and attributes. An action may be as simple as setting the value of a variable. For example the following action: IFLAG=1 will set the value of the variable IFLAG to 1. This may make something else happen in the model – for example if the input rule for a machine is IF IFLAG=1 Pull from BA Else Wait Endif then before the model continues to run a part from BA will be selected into the machine (if a part is available in BA). Alternatively actions can sometimes be many, many lines – e.g. working out where in a highbay warehouse the next pallet should be stored. The WITNESS actions language allows many commands including: • • • • •

IF / ELSE/ ELSEIF / ENDIF constructs FOR / NEXT loops DO WHILE constructs DIM statements to define LOCAL variables ! to start a line to allow a comment line

LEARNING WITNESS BOOK ONE

WITNESS ACTIONS LANGUAGE

Page 82


Learning WITNESS Bi

An example of a piece of actions code is as follows: DIM IBUFA as INTEGER ! ! ! check each of 10 buffer contents ! FOR IBUFA = 1 to 10 IF NPARTS(BA(IBUFA))>7 IFLAG=IBUFA ENDIF NEXT IBUFA

This code defines a local variable IBUFA (this will only be used in this set of actions statements). Then a FOR/NEXT loop checks each of the 10 BA buffers in turn. If the number of parts in the buffer exceeds 7 the variable IFLAG is set to the current value of IBUFA. At the end of the actions code the variable IFLAG has been set to the highest number buffer (out of the 10 BAâ&#x20AC;&#x2122;s available) that has more than seven parts in it. This again might be useful as it might tell another machine which buffer to now draw parts from.

LEARNING WITNESS BOOK ONE

WITNESS ACTIONS LANGUAGE

Page 83


Using Variables, Functions, Distributions and Expressions Variables Variables are a WITNESS element type that must be defined. They hold values just as variables in normal programming do. WITNESS variables may be of 4 different types Integer, Real, Name and String. • • •

Integer and Real variables are set to number values Name variables are set to WITNESS element names defined in the current model String variables are set to any text string enclosed in quote marks. In general these are more friendly but less efficient than number values..

Variables are defined from the designer element variables tab. They may be set to be up to 16 dimensions with a maximum total array size of 99,999,999 A 3 by 3 array is set in the variable element dialog in the quantity field by typing 3,3 Variables are values that may be accessed globally within a model, i.e. within any elements action code or rules. They are very powerful as they can be used to set logic choices. For example the NAME variable WHICHEL could be set to the name of the element that a machine is to pull from next and the machine can just have the input rule: PULL from WHICHEL or as we’ve seen in the previous section a simple variable IFLAG (integer) can be used to determine the correct location to pull from: IF IFLAG=1 Pull from BA Else Wait Endif A useful system variable that does not need to be defined is TIME. This returns the current simulation time in a model.

LEARNING WITNESS BOOK ONE

USING VARIABLES

Page 84


Learning WITNESS Bi

Inbuilt Functions WITNESS has many functions defined to provide information about the status of a WITNESS model. In some cases these functions carry out actions too â&#x20AC;&#x201C; see later. Some functions are used more regularly than others. Some of the most common are: NPARTS(Element Name)

This returns the number of parts at the specified element (e.g. a buffer or a machine)

NSHIP(PartName)

This returns the number of parts of the specified type that have been shipped in the model.

NAVAIL(LaborName)

This returns the number of units of labor that are currently idle of the specified labor.

NOPS(ElementName)

This returns the number of operations completed at the specified element (e.g. machine).

NWIP(PartName)

This returns the current amount of parts in the whole model (work in progress)

AWIP(PartName)

This returns the average work in progress over the whole model run for the specified part type.

Breakdwn(ElementName)

This function will put the specified element into a break down state (this can only be reversed with a Repair fn).

There are hundreds of functions. It is well worth looking at the list in the quick reference guide accessed from the start page in the software. The list can also be seen in the software in the Model Assistant Tree â&#x20AC;&#x201C; split into a number of different groupings.

LEARNING WITNESS BOOK ONE

USING VARIABLES

Page 85


Learning WITNESS Bi

User Defined Functions WITNESS allows you to define your own functions too. These may return values that are integer, real, name or string (just like variables) or they may be void functions that do not return a value but just run a series of actions. These are used a lot in WITNESS and it is well worth mastering them. They offer much flexibility in the modeling process. For example in a cycle time field in a machine a function can be entered. e.g. CycleTimeMachine() (note the brackets on the end – these need to be added whenever a function is called – in fact they can even include a list of parameters if you wish). The function CycleTimeMachine could contain the following actions IF LABORAT(Machine1(1),1,1)=LaborA Return UNIFORM(3.0,4.0) Else Return UNIFORM(4.0,5.0) ENDIF

Note that a function contains the same actions language as introduced above and it can also use all the inbuilt functions mentioned in the previous section – here LABORAT is used that returns the labor element currently at the element Machine1.(first indexed machine, first part, first cycle). In this case the cycle time will be returned as either a sample value between 3 and 4 or a sample value between 4 and 5 depending on whether LaborA is at the machine.

LEARNING WITNESS BOOK ONE

USING VARIABLES

Page 86


Learning WITNESS Bi

Distributions WITNESS contains many standard statistical distributions – from NORMAL to POISSON, from UNIFORM to WEIBULL. These can be used in dialog fields or in actions statements such as functions to sample values – i.e. select a value randomly from a particular shaped curve – where each value on the curve has a particular chance of being chosen. They can also be used directly in rules. Some distributions return discrete values and some real values. It is important to understand distributions when using them in models – there are many textbooks on Statistics which explain the basics. In WITNESS it is possible to define your own distributions as well as use the standard ones. Use the Distribution elements from the Data designer tab to set these up. An example of the use of a standard distribution is given in Stage 1 of the second Learning WITNESS Workbook chapter on MultiCycle Machine and Labor Modeling. This also covers the use of the distribution wizard to insert the distribution in the required field.

LEARNING WITNESS BOOK ONE

USING VARIABLES

Page 87


Attributes Introduction Attributes hold information about a particular element in a model. In most cases they hold information about individual parts, but they can also be defined to hold information about machines, labor, vehicles, etc. Some attributes are automatically available – i.e. they are defined and reported on by WITNESS with no element definition required. These are called System Attributes. Other attributes need to be defined as normal WITNESS elements. Attributes, like variables, can be one of four kinds, Integer, Real, Name and String. However attributes are different to Variables and it is important to understand the difference. If we take the case of a single quantity attribute e.g. Weight. Once defined a separate attribute value is held by WITNESS for EVERY part running through a model – each part can have its own weight. A variable would have a single value and could only apply to a single part at any one time – and it would be difficult to know which part it was attached to. When using attributes in the WITNESS actions code or rules WITNESS automatically knows that an attribute used is referring to the CURRENT part being processed at that element. This makes the logic very easy to enter. See the examples in the sections below.

LEARNING WITNESS BOOK ONE

ATTRIBUTES

Page 88


Learning WITNESS Bi

System Attributes WITNESS automatically creates a few attributes and assigns values to them for each part. TYPE

This is the same as the element name

ICON

This is the number of the icon in the picture gallery that the element is displayed as.

PEN

A color setting that refers to text displays for parts â&#x20AC;&#x201C; please see help for details

LENGTH WIDTH HEIGHT

These attributes are all set to 1 by default. LENGTH and WIDTH are used (dependent on orientation) by WITNESS continuous conveyors. They can also be set and used anywhere else in the logic of the model.

Most attributes can be reset easily by using an = sign. ICON=33 PEN=3 LENGTH=3.45 But TYPE is different. To change TYPE you must use a CHANGE TYPE command CHANGE TYPE to PartB Or CHANGE PartA to PartB

LEARNING WITNESS BOOK ONE

ATTRIBUTES

Page 89


Learning WITNESS Bi

Attribute Elements Attributes can be defined in the model as new elements – selected from the Attributes designer elements tab. •

Iattr – An integer attribute

Rattr – A real attribute

Nattr – A name attribute

Sattr – A string attribute

Labat – A Labor attribute (set to REAL)

Macat – A Machine attribute (set to REAL)

Note that other types of Labor and Machine attributes are possible too and that Vehicles and Carriers can also have attributes. The key is to define an attribute that is in Group 0 (a setting on an attribute dialog). To define a different one than those supplied in the designer window simply right click in any model display window and choose define – then enter the name, group, quantity and type. Attributes are usually used for simple identification of parts – for example color. A string attribute might be defined called Color. Then in any actions language box the following could be typed to set the attribute: IF UNIFORM(0,1)>0.6 Color=”Red” ELSE Color=”Blue” ENDIF This would set 40% of the parts being processed to Red and 60% to Blue.

LEARNING WITNESS BOOK ONE

ATTRIBUTES

Page 90


Learning WITNESS Bi

In rules the attributes can be used just as they are For example an output rule for a machine might be: IF Color=”Red” PUSH to BufferX ELSE PUSH to SHIP ENDIF In this case all the Blue parts would be shipped and the red ones sent to the element BufferX. Note too that System attributes can be used in this way For example the output rule for a machine might be: IF TYPE=PartA PUSH TO SCRAP ELSEIF TYPE=PartB PUSH TO SHIP ELSE PUSH TO Rework Buffer ENDIF Here the System attribute TYPE is used to direct the flow and the system elements SHIP and SCRAP are used. Parts that are not PartA or PartB end up at the Rework Buffer. Note here the use of the ELSEIF statement – an optional inclusion in an IF / ENDIF construct.

LEARNING WITNESS BOOK ONE

ATTRIBUTES

Page 91


Learning WITNESS Bi

Tag Displays Part attributes can be displayed alongside the parts as they move around the model. To do this the attribute should be selected in the tree view or from the model display and the right mouse menu used to select Display. In the display bar the option Draw is selected from the first pull down box and then Tag Style from the second.

Then the button should be pressed to enter the dialog where tag attributes can be enabled. (Then update and finally press the tick button at the end of the display toolbar). It is also necessary to enable tag displays for each part type. From the model display right click on the part icon (not at a machine but where initially brought into the model) and choose update display. On this dialog enable tags. The example below shows a tag attribute below each part â&#x20AC;&#x201C; in this case indicating the stages of production completed (an Integer attribute).

To enable tag displays for parts on vehicles and carriers it is more complex â&#x20AC;&#x201C; please see the help for details.

LEARNING WITNESS BOOK ONE

ATTRIBUTES

Page 92


Reports Introduction WITNESS produces a lot of information automatically when a model runs. Some of the most useful reports that are available are the Statistics, the Used Report and the Explode Report.

Statistics These are the tables of results that WITNESS produces for all elements in the model. Accessed in many different ways (right mouse menus from tree or display, toolbar button, menu, etc) it is common to look at multiple element statistics at the same time. In the report below the three parts A, B and C show the standard statistics that are displayed.

There are many examples in this book and the second Learning WITNESS workbook that show the different results and charts that can be viewed.

Used Report The Used report lists all the places where an element name is referenced in the actions language or rules in the current model. For variables and attributes it will additionally identify where the element is Set and where it is merely accessed. This is very useful for checking that the logic in a model is complete. Each line in the report can be clicked to access the element dialog where the name being checked is used.

LEARNING WITNESS BOOK ONE

REPORTS

Page 93


Learning WITNESS Bi

Explode Report The Explode report shows full detail on a machine element at the current time in the model. It will display information on the current status of the element and list all parts currently present together with all their attributes. (options exist to filter these for viewing long lists more easily). In the example below the attributes Customer and OrderNumber have been added to the System attributes. These 3 parts (all of type Axle) are in the Buffer called Store.

LEARNING WITNESS BOOK ONE

REPORTS

Page 94


Breakdowns and Setups Breakdowns WITNESS can have patterns of breakdown defined for a number of different elements including Machines, Conveyors, Sections, Processors and Pipes. To illustrate the machine element dialog has a breakdown tab on it. Machines do have more functionality in this area than the other elements in that multiple breakdowns are allowed for machines, other elements only allow a single breakdown pattern to be defined. The machine breakdown tab offers a grid display

Lines are added and deleted using the buttons above the grid and each line defines a breakdown pattern. Here there are two. One is based on the number of operations (every 50 operations some maintenance is needed). The other is based upon busy time and the machine will breakdown between 100 and 200 time units of busy use. The repair will take 5 time units and 15 time units respectively to be repaired. There are many other settings for control, including labor rules to carry out the repairs (which may of course cause delays if they are unavailable), options to output a part on breakdown for it to be re-routed elsewhere, an option for a new setup to be needed after a repair. Please see the help text for full details. The functions BREAKDWN and REPAIR allow interactive breakdown of elements at any time in the actions statements. This is a useful alternative where breakdowns occur in a complex manner â&#x20AC;&#x201C; e.g. where one area of factory stopping requires another area also to be stopped at the same time.

LEARNING WITNESS BOOK ONE

BREAKDOWNS AND SETUPS

Page 95


Learning WITNESS Bi

Setups Machines in WITNESS can have setups in addition to breakdowns. These are planned interruptions to the machine cycling to replace tooling, or for recalibration, etc. Machines can have multiple setups. Setups can be defined to take place whenever a part type changes (e.g. a new batch enters production), after a set number of operations (e.g. a tool wearing out), or a value change. This last option is very flexible as simply changing a variable value in an actions statement will cause the machine to need a setup to continue.

In this example the first setup will take place every 1500 operations and will take 20 time units. The second one will be undertaken every time the part being processed changes taking 5 time units. There are many other options including Labor rules to undertake the setup, options to setup when no part is present (or not!) and points to add actions statements. Note that the option above does not include distributions but the numeric fields here can all accept distributions, variables, even functions to allow the most complex of logic to be enabled

LEARNING WITNESS BOOK ONE

BREAKDOWNS AND SETUPS

Page 96


Quantity WITNESS elements have the option to define Quantity. Variables, as explained above can have up to 16 dimensions in their array definitions. Most other elements can have a single dimension array defined with a maximum quantity of 999. Machines, Buffer, Tracks, Vehicles, Pipes, Tanks, Processors, Conveyors, Labor (across all shifts), Carriers, Sections, Stations â&#x20AC;&#x201C; all allow these multiple quantities to be defined. Each indexed item in the quantity acts as an individual element but with the same definition as the other indexed items. For example a quantity of 2 machines may have the same breakdown pattern set but if the timings are distributional then the sampling for when the two machines will break down will happen separately resulting in different occurrences.

LEARNING WITNESS BOOK ONE

QUANTITY

Page 97


N and M N and M are also system variables that can be used in every WITNESS model. N refers to the Index number of the current element (see the section on Quantity above for an explanation of this). This has many uses â&#x20AC;&#x201C; for example a variable with an array size of 6 could be used in the cycle time field for a machine with a quantity of 6. If the variable is called CTime then the expression Ctime(N) could be used in the machine detail dialog in the cycle time field so that different values could be set for each machines. Another example of the use of N is in Rules If there is a machine M1 and a buffer B1 each with a quantity of 6 then the rule Push to B1(N) in the output rule of M1 would push to the same indexed buffer position â&#x20AC;&#x201C; reflecting laned storage for example. M is also useful. M is the index of the part being processed by the current element. Therefore in a machine that has cycled and produced four parts, say in a batch operation, the following output rule can be used to differentiate between each part. IF M=1 PUSH to B1 ELSEIF M=2 PUSH to B2 ELSEIF M=3 PUSH to B3 ELSE PUSH to B4 ENDIF

LEARNING WITNESS BOOK ONE

N AND M

Page 98


Displays Element displays can be selected and dragged around the screen with the mouse. There are different selection modes for this movement. Shift click can be used to add items to a selection and also a net can be dragged to select all elements within the net. These four options from this button on a toolbar refer to any display selection. If unlocked the display item can be moved around by itself. Individual lock moves all display items belonging to that index. Element lock moves all element display items with the chosen item. Module Superlock can be used to move all items in the same module together.

Display Selection

• A solid outline surrounds the display element that is clicked on. A dotted line surrounds all other items that will move if the selected element is moved. In the picture to the left individual locking is turned on and hence the display shows that all the display items linked with the third indexed machine will move if the yellow square status icon is moved.

• When in a dialog that offers the ability to update an icon all the icons that will be affected are now shown on the display. In the picture to the left each of the three yellow square status icons are shown with a solid surround.

• The right mouse menu gives access to many graphic setup options through the update graphic option.

A quick method to delete a graphical display of an element is to first select the graphic to remove using the right mouse button and then select the Delete Graphics option using the left mouse button. LEARNING WITNESS BOOK ONE

DISPLAYS

Page 99


Learning WITNESS Bi

The ‘display’ option shown above gives access to the display bar for an element. This allows the drawing of new display items for an element.

The Display toolbar The first drop down list has two options, draw and update. Draw

: This is used to create a new representation of the selected element. In this mode the second drop down list offers all the different display types available to the currently selected element.

Update

: This is used to change the detail of a display that has already been created. In this mode the second drop down list shows the display items already drawn for this element.

Select the display mode from the first drop list and the display type you wish to draw or update from the second drop list. Use the pencil button

to draw or update the selected item.

Many of the display items can be altered using the display edit toolbar – e.g. fonts, colors, etc.

This toolbar is turned on and off using

another toolbar button.

Only when this is pressed in can any of the display items be changed in the WITNESS windows. WITNESS also allows you to lock displays on windows or display layers, and also to link the various display items for an element together. To lock displays use the view/layers option or the window/control option. Icon Rotation on Screen

LEARNING WITNESS BOOK ONE

DISPLAYS

Page 100


Learning WITNESS Bi

To rotate an icon press the Ctrl key and move the mouse cursor near the circle displayed above the icon. When it is correctly located the cursor will change to a rotation handle. Then by clicking the left mouse button and dragging the icon may be rotated to the desired orientation.

Example Display Items for Elements Parts

As default these include a name and a ‘Style’ display (usually icon chosen)

Machines As default these include a name, a picture icon, a status icon and a part queue and a labor resource queue (in the default these show all parts and labor – but they can be changed to counts. Buffers

As default these include a name and a part queue

Status icons show different colors dependent on what is happening. The colors are also used in the report charts. The basic colors used are: (many more please see the help for more detail of Element States). Green: Yellow: Red: Magenta: Cyan:

Busy Idle Broken Down Blocked Being Set up

Other typical display options include: Text – Write anything on screen in free format Expression – Write an expression to be updated at a chosen time interval Rectangle/Ellipse/Line – Draw these display items To draw these and any other new items choose display from the right mouse menu when the element is selected (or Element display from the menus) and use the display bar that appears. Select Draw in the first box and then your chosen item before selecting the pencil button on the display bar.

LEARNING WITNESS BOOK ONE

DISPLAYS

Page 101


Basic Working with Microsoft Excel To read values in from Excel the easiest way is to use the wizard which is present in the details dialog for any variable. Simply locate the Actions tab. This tab exists for most elements and amongst other buttons offers a section for initialize actions.

From this tab press the Initialize button and then the Excel button on the Actions box. This offers: i) ii)

a choice of spreadsheets to open open the spreadsheet and offer selection of the value(s) to read. The area chosen with the mouse MUST match the dimensions of the array defined

LEARNING WITNESS BOOK ONE

BASIC WORKING WITH MICROSOFT EXCEL

Page 102


Learning WITNESS Bi

After selecting the region the dialog automatically pastes in the correct function as follows:

Then Simply OK the dialog to set. Every time the model is run the values in DataArray2 will be updated from the Excel cells.

An example of a model that reads a schedule in from Excel is shown in detail in the second Learning WITNESS book accessible from the start page. b) Output of Results to Excel The function XLWriteArray is the easiest way to write data out to Excel and this can be done in any Actions statements, however there is no wizard to write this statement for you and it must be copied or typed in. The structure of the function is the same as the XLReadArray used in the section above.Hence to write out to the same spreadsheet use XLWriteArray ("XLBook1.xlsx","Sheet1","$D$4",Vreal001,1) This would write out the the value of the variable VReal001 to cell D4 of Sheet1 of the spreadsheet. Note that for absolute references double backslashes must be used between folder levels. There are many other specific functions for use with Excel but many users of WITNESS only ever need to use these two functions to easily take data in and pass results out. Please see the help for further details

LEARNING WITNESS BOOK ONE

BASIC WORKING WITH MICROSOFT EXCEL

Page 103


is a trademark of Lanner Group Ltd All rights reserved. No part of this publication may be reproduced or transmitted in any form or by any means, including photocopying and recording, without written permission of Lanner Group Ltd. Such written permission must also be obtained before any part of this publication is stored in a retrieval system of any nature.

Copyright Š 2013 Lanner Group Ltd



Workbook