Computer Simulation with Enhanced Three-Phase Modeling using the Activity cycle Diagram

Evon Abu-Taieh Computer Information Systems Department The Arab Academy for Banking and Financial Science P.O Box 13190-11942 Amman-Jordan Phone:-962-6-5858822, Fax: 962-6-5527233 Email: [email protected]

Keywords: Discrete event simulation, Excel, threephase method, activity cycle diagram (ACD). Abstract There are many problems that hinder the simulation development process, two of those problems are: (1). Communication during the development life cycle. (2). The length of the development life cycle. This empirical paper proposes a solution for those two problems by using spreadsheets as simulation environment and by simplifying the program code. The proposed solution is based on discrete event simulation. INTRODUCTION “Simulation is the use of a model to represent over time essential characteristics of a system under study” [El Sheikh, 1987]. “Discrete event simulation is one which employs a next-event-technique to control the behavior of the model” [Pidd, 1998]. There are a number of methods to build a discrete simulation program structure, the three well known methods are: process method, event method and three phase method [Pidd, 1998]. Each simulation project goes through four basic phases: modeling, data and knowledge, implementation and validation [Amico et al., 2000]. Each method has advantage and disadvantages and to each phase has critical issues. Each of the three famous methods to structure the simulation program has an affect on the ease of modifying the program code. The three phase method recognizes two distinct types of events: bound (B-activity) and conditional (C-activity). B-activity is operations whose start or finish time can be predicted and therefore can be scheduled. Operations or activities who is not of type B are regarded as C-activity [Pidd, 1998]. In three-phase method there are three phases: A-phase, B-phase, and C-phase. The A-phase is for advancing the clock to the next event. The B-phase is for executing all bound events. The C-phase is for trying to execute all the conditional activities. Activity Cycle Diagrams(ACD) are one way of modeling the interactions of

the entities and particularly useful for systems with strong queuing structure[see Pidd, 1998]. With each of the four basic phases in simulation projects there are critical issues that determine the effectiveness of the simulation. The length of the development cycle and the communication during the development cycle are two factors that hinder the simulation development process [Amico et al., 2000]. This research paper shows that by simplifying the programming part of the simulation model and by using graphical User Interface (GUI) spreadsheet as simulation environment (i.e. Excel) such problems will be elevated [Bonder and McGinnis, 2002]. Implementation environment or “simulation platform refers to the software environment used to develop, test, and run simulation experiment” [Seila, 2001]. USE OF SPREADSHEETS AS SIMULATION PLATFORM The use of spreadsheets in simulation and modeling is not new; many suggested such idea [Leathrum et al.,2000], [Amico, 2000], [Seila, 2001], [Evans, 2000],and [Diab, 1997] to name a few. “Spreadsheets provides a means to store and manage data, run statistical analyses, conduct mathematical modeling, import and export tables and graphs, and interface with other more powerful computer packages” [Hill, 2002]. Needless to say, such simulation platform is also WYSIWYG in the case of Microsoft Excel Spreadsheet. Using Spreadsheet as simulation platform to solve the problem of communication during development cycle [see Amico, et al., 2000] is the answer. Rather than reading from the initial requirements document and building a program that reflects the original requirement, the writer of the document can build the model using the spreadsheet. Such approach can eliminate the communication problem. One may ask here How is this possible? Who will write the program code? The answer is to simplify the coding to nothing. In other words, there will be no code to write since

Abu-Taieh, E. (2004). INFORMATION RESOURCES MANAGEMENT ASSOCIATION INTERNATIONAL CONFERENCE, New Orleans, Louisiana, USA , May 23-26, 2004.

the code is already written. Next section will explain the concept. SIMPLIFY THE CODE OF THE THREE-PHASE MODELING In this section an overview of the terminology used will be given based on the original algorithm cited in the book Computer Simulation by Michael Pidd [see Pidd, 1998]. Then the implementation of the simplified code is shown in the implementation section.

Overview In the simulated system that is based on ACD, using the three-phase method, entities are divided into two types: Entities that are being served and entities that are servers. Each entity in the ACD is described by attributes: Name, Availability, TimeCell, NextActivity, and Utilization. The Name attribute of the entity is usually to distinguish from other entities. The Availability attribute describe if the entity available to interact with other entities. TimeCell is the next time the entity will be able to change its state. NextActivity this attribute is the activity the entity will be engaged in next, if the Available field is false. Utilization attribute is usually a percentage that reflects how much the entity worked. In the ACD based three-phase approach each activity must begin, end, and be executed. In other words, the entity is scheduled to begin an activity, then when all condition are appropriate it is executed, and then scheduled to end. Activities can be either bounded (begin and end time are known) or conditional (resource must be available for the activity to begin). Next is an over view of ACD. Activity Cycle Diagram (ACD) Activity cycle diagram make use of two symbols shown in the figure below. The diagram shows the life history of each entity and displays graphically their interactions.

where the entity wait for something to happen [ see Pidd,1998]. It is recommended that an entity alternate between the two states; in other words, an entity must go through a dead state after an active state. IMPLEMENTATION The idea in this empirical research is as follows: one procedure is defined for beginning any activity, one procedure is defined for ending any activity, and one procedure is defined for any activity process. This is possible by using each entity as a parameter being passed from one procedure to another, where each activity is represented by procedure. The job arrival procedure or B1 is one that increment the queues and schedules job arrivals for any entity. The procedure B2 or end service is the one that will decrement queues and schedules the end of service. The conditional Beginning or the C procedure is the one that will increment the number of OUTs and decrement the queues when the resources (server entities) are available. The algorithm is described as follows: The first procedure (figure 2) needed is the schedule procedure (figure 1) which receives the entity name and it’s next activity and time needed for such activity (line 1). The procedure then finds the entity (line 2) and schedules the time of execution (line 3); and sets the name of the next activity (line 4) then increments the time of utilizing such entity (line 5). 1. 2. 3. 4. 5. 6.

Procedure schedule(EntityName, Activity, Time) Find EntityName EntityName.TimeCell=Clock+time EntityName.Activity=Activity EntityName.Utility= EntityName.Utility+time End procedure Schedule

Figure 2: Producer schedule

Active State

Dead State (Waite in Queue)

Entity Name

Dead State (Waite in Queue)

Active State

The Procedure B1(figure 3) is the one procedure responsible for generating the job for the model. B1 will increment the number of jobs coming to a certain entity (line 2). Then put the job in a queue (line 3). Final, B1 will schedule the job for execution by calling the schedule procedure (line 4). 1. 2. 3. 4. 5.

Procedure B1 (EntityName) “Job Arrival” In(EntityName)= In(EntityName)+1 Q(EntityName)= Q(EntityName)+1 Schedule(EntityName, Activity, Time) ‘Activity could only be begin, end, or execute service End procedure B1

Figure 3: Procedure B1 Job Generator Figure 1: Generic activity cycle diagram Active state usually involves the co-operation of different entities. On the other hand, a dead state involves no cooperation between different entities, generally a state

Procedure B2 (figure 4) is the one that will do the following: first, increment the number OUT by 1 (line 2), then it will decrements the queue (line 3). Finally it will call the schedule procedure to schedule the entity end time.

Abu-Taieh, E. (2004). INFORMATION RESOURCES MANAGEMENT ASSOCIATION INTERNATIONAL CONFERENCE, New Orleans, Louisiana, USA , May 23-26, 2004.

1. 2. 3. 4. 5.

Procedure B2 (EntityName) “End Service” OUT(EntityName)= OUT(EntityName)+1 Q(EntityName)= Q(EntityName)-1 Schedule(EntityName, Activity, Time) End procedure B2

Figure 4: Procedure B2 or End service. Procedure C(figure 5) is the conditional procedure designed to begin executing the conditional events. In line 2 the procedure starts with a loop that will not quit until the queue of the entity is empty or there are no available server type entities. Inside the loop this procedure looks for a free server type entity, once it finds a free server entity it decrements the queue (line 4) and select a random service time (line 5). Finally it schedules an end of service or B2 (line 6). 1.

Procedure C(EntityName) “Begin service”

2. 3. 4. 5. 6. 7.

While Q(EntityName) >0 and Server_Entity_Count < Last_server Find free Server entity Q(EntityName)= Q(EntityName)-1 Service_Time=My_random(Entity_randome_type, EntityName) Schedule (Server_entity,b2,Service_Time) End while

8.

End procedure

Figure 5: procedure C or begin service. In line 5 in the figure 5 a random service time was selected based on the following procedure (figure5). The following procedure produces a random service time based on the user selection. In simulation models many distributions of time is used: logarithms, exponential etc. This procedure allows the user to select the type of distribution s/he may like. In fact it allows the user to select different distributions for different entities. This producer receives as input the name of the entity and finds from the spread sheet the type of distribution associated with that entity (line 2). Then based on the type of the distribution the procedure returns a random number (line 3-5). 1. 2. 3. 4.

5.

6.

Function My_random(Entity_ distribution _type, EntityName) Find EntityName If EntityName.Entity_distribution_type=”random” i. Generated_random=use random function ElseIf EntityName.Entity_distribution_type=”Logarithm” i. Generated_random=use log function ElseIf EntityName.Entity_distribution_type=”Exponential ” i. Generated_random=use Exponential function Return(Generated_random)

7.

End Function

Figure 6: Random number generator based on type of distribution As one can see from the algorithm that the use of entity as a parameter has cut down on the code which allowed flexibility to define as many entities (server, and served). Which in turn allowed us to limit the activities to three activities all are defend. The rest of the phases of the program are same as any three-phase approach with the A phase, B phase and C phase. For the clarity of the picture all three phases are described in the following: The first is A-phase procedure (figure 7)); this procedure sorts all the entities based on the value of the Time_Cell in ascending order (line 2). Then the procedure advances the clock to the nearest time based on the value of Time_Cell closest to the system Clock (line 3). 1. 2. 3. 4.

Procedure A phase Sort the entities based on the Time_Cell in Ascending order Find entities with pending job ( where Time_Cell=Clock) and mark the entity as Current End A phase

Figure 7: A-phase producer The B-Phase procedure (figure 8) is the second procedure that is called. In this procedure each entity that has a Time_Cell equals the clock will be executed. In this procedure all the bounded events of type B will executed, 1. 2.

Procedure B Phase For each current entity i. Case ii. Next activity of Current Entity =1 1. Call B1(EntityName) ‘B1=arrival iii. Next activity of Current Entity =2 1. Call B2(EntityName) ‘B2=End Service 3. End Case 4. End B-phase Figure 8: B-phase procedure In the following procedure all the C type events are executed (figure 9), if server entities are available by calling the C procedure. 1. Procedure C phase 2. For each entity that needs a C to start its activity 3. Call C (EntityName) 4. End C procedure Figure 9: C-phase procedure

Abu-Taieh, E. (2004). INFORMATION RESOURCES MANAGEMENT ASSOCIATION INTERNATIONAL CONFERENCE, New Orleans, Louisiana, USA , May 23-26, 2004.

For an overall look at the program the following figure 10 three-phase executive gives and idea taken form [Pidd, 1998].

Start

Time scan

A Phase

Execute Bs due now

B Phase

Attempt all Cs

C Phase

Any Activity? yes no Time up

no

yes Stop

Figure 10: A three-phase executive THE INPUT OF THE PROGRAM The Inputs of the program are as follows especially needed for the initial start up(figure 11): Each entity must be entered with its name which is unique identification number, availability, TimeCell, next_activity. All are in Excel sheet with two means for each entity one for the inter arrival time and one for the service mean time. One must choose a distribution type (logarithm, exponential, random) from a drop down list, needless to say many distribution types can be added here as desired. The final step is to hit the button to simulate.

CONCLUSION This paper looks at the abstract view of any ACD as entities and activities. Each Activity has a beginning, an end, and process; and each entity has attributes. With some modifications of the original algorithm cited in the book Computer Simulation by Michael Pidd. One can simulate any ACD based system without the need to program. The modifications will be based on the changes made on the Bs and Cs procedures. The changes will limit the Bs procedures to B1 (Job Arrivals) and B2 (End Service) to two instead of 2 X number of entities procedures. Also, limit the Cs procedures to be only one C procedure. All this is possible by dealing with the entity as a parameter passed to each procedure when needed. The complete algorithm is made of the following: • A random number generator: based on the type of distribution desired, this function generates a random number. • A scheduler: schedules for each entity the next activity(sets TimeCell value) • Arrival scheduler: Bound type, schedules the next job arrival for entity. • Beginning Service: Conditional type, only executed for an entity when server entity is available, decrement queue, schedules end of service for entity. • End service: B type, schedules the end of job and increment number of OUTs and frees resource(server entity) • A Phase • B phase • C Phase

Once the procedures are written and parameters are utilized one can use these procedures to write the simulation program or even not need to write it, nor to intervene in the programming. SUGGESTED FUTURE IMPROVEMENTS The final objective for this program is for the user to draw the ACD and the operations can be simulated. Also instead of using regular distribution methods like logarithm or exponential one can embed a neural network matrix based on the sector being simulated. Acknowledgement This research materialized with help, patience and cooperation of Dr. A. El-Sheik. Deep thanks goes to Senator Alia Abu-Tayeh and Engr. Akef Abu-Tayeh for their financial help and support.

Figure 11: Excel worksheet

Abu-Taieh, E. (2004). INFORMATION RESOURCES MANAGEMENT ASSOCIATION INTERNATIONAL CONFERENCE, New Orleans, Louisiana, USA , May 23-26, 2004.

References [Amico, 2000]

[Bonder and McGinnis, 2002]

[Diab, 1997]

[Elsheikh, 1987] [Evans, 2000]

[Hill, 2002]

[Leathrum et al.,2000]

[Pidd,1998] [Paul & Balmer,1993 ]

Amico, V., Bruzzone, A. Guha, R. “Critical Issues in Simulation” Summer Computer Simulation Conference 2000, http://scs.affinitycity.com/XRM/DLbin.asp?DB=scs_1&ID=1117&TB=Tabl e5 Bodner, D. and McGinnis, L. “A Structured Approach to Simulation Modeling of Manufacturing Systems”, Proceedings of the 2002 Industrial Engineering Research Conference http://factory.isye.gatech.edu/vfl/publications/papers/2002/BodnerMcGinnis_Si mulation_IERC_2002.pdf DIAB, H. “Simulation of Cache-based Parallel Processing Systems using Spreadsheets*”,International Journal of Engineering Education, Vol 14 – 2,1997. http://www.ijee.dit.ie/articles/Vol14-2/ijee1011.pdf El Sheikh, A. 1987, “Simulation Modeling Using A Relational Database Package”, PHD Thesis, The London School of Economics Evans, J.R. (2000), “Spreadsheets as a Tool for Teaching Simulation,” INFORMS Transactions on Education, Vol. 1, No. 1, http://ite.informs.org/Vol1No1/evans/evans.html Hill, R. (2002), “Process Simulation in Excel for a Quantitative Management Course” INFORMS Transactions on Education, Vol. 2, No. 2, http://ite.informs.org/Vol2No3/Hill/ Leathrum, J., Mielke, R.and Frith, T. “An Integrated Spreadsheet Approach to Simulation Interfaces”, Proceedings of the Summer Computer Simulation Conference, Vancouver, July 2000. www.scs.org, http://scs.affinitycity.com/XRM/DLBin.asp?ID=875&TB=Table5 Pidd, M.(1998) Computer Simulation In Management Science.Wiley,4th edition. Paul, R. Balmer, D.(1998) “Simulation Modeling”. Brunel University.

R.J. Paul and D.W. Balmer (1993) Simulation Modelling. Lund, Sweden: Chartwell-Bratt Student-Text Series. ISBN 0-86238-2807. [Siela, 2001]

Seila, A. “Spreadsheet Simulation” Pages: 74 – 79 Series-Proceeding-Section-Article Year of Publication: 2001 ISBN:0-7803-7309-X, IEEE Computer Society Washington, DC, USA http://www.informs-cs.org/wsc02papers/003.pdf

Abu-Taieh, E. (2004). INFORMATION RESOURCES MANAGEMENT ASSOCIATION INTERNATIONAL CONFERENCE, New Orleans, Louisiana, USA , May 23-26, 2004.

Computer Simulation with Enhanced Three-Phase ...

method has advantage and disadvantages and to each phase has critical issues. Each of the three famous methods to structure the simulation program has ..... El Sheikh, A. 1987, “Simulation Modeling Using A Relational Database. Package”, PHD Thesis, The London School of Economics. [Evans, 2000]. Evans, J.R. (2000) ...

93KB Sizes 0 Downloads 97 Views

Recommend Documents

D6.5: NUBOMEDIA Computer vision enhanced phone calls
Jan 31, 2017 - ... ICT-2013.1.6. Connected and Social Media ... NUBOMEDIA: an elastic PaaS cloud for interactive social multimedia. 2. This is a ..... Page 10 ...Missing:

ClementRA-1982-Computer-simulation-of-EOM-cooperation.pdf ...
that the projection onto these axes represented the amount of the forces exerted by each ... Robinson (1975) ... of Collins and O'Meara cited in Robinson (1975).

ClementRA-1982-Computer-simulation-of-EOM-cooperation.pdf ...
Retrying... ClementRA-1982-Computer-simulation-of-EOM-cooperation.pdf. ClementRA-1982-Computer-simulation-of-EOM-cooperation.pdf. Open. Extract.

ClementRA-1982-Computer-simulation-of-EOM-cooperation.pdf ...
University of Aston in Birmingham, Birmingham B4 7ET, U.K.. {Received 10 .... is a function of its length and its innervation level. Innervation cannot be measured.

Precalculus-Enhanced-With-Graphing-Utilities-7th-Edition.pdf ...
lawyers soon after you. eBook ID: 57-A8EC2F25192F3B6 | Author: Michael Sullivan. Precalculus Enhanced With Graphing Utilities (7th Edition) PDF eBook.

Collaboration-Enhanced Receiver Integrity Monitoring with Common ...
greatly enhancing fault-detection capability. Keywords-Collaborative Navigation, CERIM, RAIM. I. INTRODUCTION. In safety-critical applications of the Global Navigation. Satellite System (GNSS), such as vehicle automation, it is critical to verify ran

Mumzworld Reaches 300% ROAS With Enhanced ...
The Mumzworld and InfoTrust team started by implementing Google. Analytics Enhanced Ecommerce. Custom data attributes for products and channels helped ...

Magnetic levitation of metamaterial bodies enhanced with ...
Mar 26, 2012 - tions including superlens-based imaging26,28,33 and wireless power32 ..... advantage of the cylindrical symmetry of the problem and use the ...

Manufactured seed with enhanced pre-emergence survivability
Jun 7, 1995 - Redenbaugh et al., “Encapsulation of Somatic Embryos in. Synthetic ...... a low wet strength. subsequent irrigation would moisten and soften the ...