You are on page 1of 13

Evaluating Library Services

Problem Description
Problem Statement
Library management is considering improving the service at their closed stack library by adding
additional clerks to improve the time borrowers take to check out a book (that is the time from
which the borrower arrives at the service desk to the time the borrower leaves with the book). In
addition, management is also interested in ensuring that clerks are sufficiently busy.
SUI Details
The diagram shows the setup of the library with a
close stack policy.
C

Library clerks are responsible for retrieving books


from the stacks for the borrowers.
Borrowers: A borrower checks, using the library
inventory system, that a book is available. The
borrower prints out a checkout slip for the desired
book using the library inventory system and
deposits it the service desk. The borrower then
waits for his or her name to be called by a clerk to
obtain the desired book.
The library inventory system ensures that
the borrower can check out only one book
and that it is available.

Library Clerks

Library Stacks
C

Checkout Slips

Service Desk

B
Depositing Checkout Slip

Receiving book

Clerks: A clerk picks up a maximum of 4 checkout


slips from the service desk. The clerks will then
retrieve the four books requested on the slips. The
Waiting for Clerk with book
clerk returns to the service desk and calls out the
names of each borrower for them to retrieve the requested books.
Checkout slips are picked up by clerks on a first-come, first-served basis. Books are
returned to customers also on a first-come first-serve basis.
If two or more clerks are idle when a borrower arrives at the checkout desk, the clerk who
has been idle the longest services the borrower.
If two or more slips are at the checkout desk and two or more clerks are available, the
clerks DO NOT divide the work evenly among themselves. One clerk takes up to 4 slips;
then if there are still borrowers with slips to be picked up, the next clerk takes as many
slips as possible, and so on

Project Goal
The main goal of this study is to find the effect of changing the number of clerks on the
utilization of the clerks and the average turnaround time for borrowers (time it borrowers stay in
the library after submitting a slip).
A steady-state study is to be used to study the operation of the library during the busy period
using the number of customers served for terminating the simulation (note that although the busy
period is of finite time, for the purposes of the study, the busy period is being extended). A single
parameter has been defined the number of clerks servicing borrowers (from the current 3 to 4
and 5).
Parameters

numClerks: The number of clerks in the library.

Experimentation

Time units: minutes


Observation interval: Steady state study.
The parameter numClerks is varied from 3 to 4 to 5, that is, there are three cases to this
project.

Output

avgBorrowerResponseTime: The average turnaround time of borrowers.


clerkUtil[numClerks] : Clerk utilization. This is a set of numClerk scalar values that
shows the utilization (percent time each clerk was busy).

ABCmod Conceptual Model


High Level Conceptual Model
Simplifications

Checkout slips are not explicitly modelled. Instead, the Customer entities serve as surrogates
for the slips.

Structural View
Q.ClerksIdle

RQ.Clerk[numClerks]
1

Q.Slips
Legend
iC.
iC.
iC.

iC.Borrower

Figure 1 Library Structural Diagram


Entity Structures
1. Borrower: represents the persons arriving to borrow a book.
2. Clerk: A set of resource queue entities that represents the clerks that carry out the
retrieval of books.
3. Slips: This queue represents the queue of checkout slips presented by the borrowers. Note
that the Borrower entities serve as surrogates for the slips.
4. ClerksIdle: This queue represents the queue of clerks that are idle. Note that identifiers to
the Clerk entities are found in this queue.
Notes:
Clerks can service up to 4 borrowers at a time. Servicing is completed (i.e. the check out)
on a first-come first serve basis. Thus the Clerk entities have a dual role resource and
queue.
Note that the slips are not explicitly modeled. When the Clerks are finding books using
the slips, the Borrower entity is attached to the Clerk entity in lieu of an explicit Slip
entity. This represents the servicing of the Borrower by the Clerk (i.e. finding a book for
the borrower). This Queue role of the Clerk entity ensures that Borrower entities are
serviced on a first-come first-serve basis.
The diagram shown shows the state of the system when an idle clerk is about to pick up
the slips from 3 borrowers waiting for a clerk.
The ClerksIdle Queue contains identifiers of R.Clerk entities; this queue is required to
ensure that the clerk who has been idle the longest services borrowers first.

Behavioural View
BorrowerArrival

FindBooks

CheckOut

(a) Borrower Lifecycle

CheckOut

FindBooks

b) Clerk Lifecycle
Library Behaviour Diagram

Scheduled Action Constructs:


BorrowerArrival: Arrival of borrowers to the checkout counter.
Activity Constructs:
FindBooks: Condition activity where a clerk searches stacks for up to 4 books for the
Borrowers.
Checkout: A conditional activity where the clerk checks out a single borrower after finding
their book.
Notes
The FindBooks activity has been placed in the Borrowers life cycle. Although in reality the
Clerk is searching for books using the slips picked up from the borrowers (which means that
the Borrowers are not really interacting with the Clerk resource), and that the slips are not
modelled explicitly (instead the iC.Borrower entities are attached to the R.Clerk[j] entity to
represent the slips), the activity was included in the Borrowers lifecycle diagram. The
perspective adopted is that the FindBooks activity is one in which the Clerk services the
Borrower.
The Clerk initially starts in the wait point at the top of the Clerk Lifecycle diagram waiting
for slips to become involved in a FindBooks activity instance.
Input
Variable
uBorrowerArr

Variable
uFindBooksTime
uCheckOutTime

Exogenous Input (Entity Streams)


Description
Domain Sequence
Input entity stream variable
for borrowers at the
checkout counter.

RVP.DuBorrowerArr()

Range Sequence
N/A 1 borrower arrives at
each arrival time.

Endogenous Input (semi-independent)


Description
Values
Time to find books in the
stacks for 1 to 4 borrowers.
Time to check out a book
for a borrower.

RVP.uFindBooksTime(num), where num defines the


number of borrowers.
RVP.uCheckOutTime()

Detailed Conceptual Model


Structural Components
Constants
Description

Name
MAX_SLIPS

Maximum number of slips that the clerk picks up


at the checkout desk to find books in the stacks.

Parameters
Description

Name
numClerks

Value
4

Number of clerks for servicing borrowers.

Value
3, 4 and 5

Consumer Class: Borrower


A person wishing to borrow a book.

Attributes
arrivalTime

Description
Time the person arrived at the desk to check out a book. Used to compute the
response time.

Resource Queue Set[numClerks]: Clerk


The clerks for servicing the borrowers. The number of clerks available is defined by the parameter
numClerks. Since the entity can service multiple borrowers at the same time, in the same order that it
received the slips, the role of Queue has been added.

Attributes
status

n
list
servicing

Description
Set to IDLE when waiting for Borrowers (i.e. placed the Q.ClerksIdle), and
BUSY otherwise. This attribute is required to observe the amount of time the
Clerk is busy.
Number of borrowers being serviced when Status is set to Busy (one to
MAX_SLIPS).
List of iC.Borrower's being serviced. Slips are not explicitly modeled. Instead a
reference to the iC.Borrower is attached to the RQ.Clerk member.
This attributes reflects the phase of servicing in which the Clerk is involved. It
is only significant when the Status attribute is set to BUSY. I can have one of
two values:
FINDBOOKS - when searching for books in the stacks
READYCHECKOUT - ready to check out a book with a borrower
CHECKINGOUT - checking out a book with a borrower.

Queue Unary: Slips


The borrowers line up at the checkout desk to present a slip for borrowing a book. This queue
represents the line of borrowers waiting to give their slip to a clerk.

Attributes
n
list

Description
Number of borrowers waiting to give a slip to a clerk.
List of references to iC.Borrower's waiting to give a slip to a clerk.

Queue Unary: ClerksIdle


This queue represents the clerks that are idle and waiting for slips from borrowers.

Attributes
n
list

Description
The number of idle clerks.
The list of identifiers to RG.Clerk members that are idle.

Behavioural components
Time units: minutes
Observation interval: Steady state study.

Action: Initialise
TimeSequence
Event SCS

<0>
Q.Slips.n 0
num 0
WHILE(num < numClerks)
RQ.Clerk[num].status IDLE
SP.InsertQue(Q.ClerksIdle, num)
num num+1
END

Output
OUTPUTS
Trajectory Sets
Name

Description

TRJ[RQ.Clerk[id].status]

There are numClerk trajectory sets are defined: id is varied from 0 to


numClerks-1, to monitor the status attribute of each clerk
(RQ.Clerk[id].status).

Sample Sets
Name

Description

PHI[responseTime]

Name

Collects the times it takes the response times for borrowers to check out a
book (from the time the borrower arrives at the checkout desk to the time he
or she leaves with the book). When the checkout procedure is completed for a
borrower, the time is computed as (t-iC.Borrower.arrivalTime).

Derived Scalar Output Variables (DSOV's)


Description
Data Set Name

AvgResponseTime
ClerkUtil[id]

The average response time


for borrowers.
Where id is numbered 0 up
to numClerks-1. There are
numClerk scalar output
variables defined, one for
each clerk in the model.

Operator

PHI[responseTime]

AVG

TRJ[RQ.Clerk[id].Status]

AVG

User Defined Procedures


Name
ClerkReadyToCheckOut()

User Defined Procedures


Description
This procedure returns an identifier for an RQ.Clerk member that is
ready to checkout a book with a borrower. This conditions exists when:
1) The status attribute of the member is set to BUSY
2) The servicing attribute of the member is set to READYCHECKOUT
2) The n attribute of the member is non-zero.
If no RQ.Clerk member is ready to check out the books, the procedure
returns NONE (-1).

Input Constructs

Name

Random Variate Procedures


Description
Data Model

DuBorrowerArr()

The times borrowers


arrive at the checkout
desk with slips.

uFindBooksTime(n)

Returns the amount of


time required to find
books according to the
number of books to
find.

uCheckOutTime()

Returns the time to


check out a book.

{tk: k = 0, 1, 2, ----}
with t0 = EXP(ARRIVAL_MEAN) and for k>0,
tk = t(k-1) + EXP(ARRIVAL_MEAN)
where ARRIVAL_MEAN = 2 minutes
n=1: Normal(MEAN_ONE,STD_DEV_ONE)
n=2: Normal(MEAN_TWO, STD_DEV_TWO)
n=3: Normal(MEAN_THREE, STD_DEV_THREE)
n=4: Normal(MEAN_FOUR, STD_DEV_FOUR)
where:
MEAN_ONE = 4 min.,STD_DEV_ONE = 0.8 min
MEAN_TWO = 7 min.,STD_DEV_ TWO = 1.4 min
MEAN_ THREE = 9 min.,STD_DEV_ THREE = 1.8 min
MEAN_ FOUR = 12 min.,STD_DEV_ FOUR = 2.4 min
UNIFORM(CHECK_OUT_MIN, CHECK_OUT_MAX)
where
CHECK_OUT_MIN = 1 min., CHECK_OUT_MAX = 3 min.

Action: BorrowerArrival
The arrival of a borrower with a slip to borrow a book.
TimeSequence RVP.DuBorrowerArr()
Event SCS
iC.Borrower SP.Derive(Borrower)
iC.Borrower.arrivalTime t
SP.InsertQue(Q.Slips, iC.Borrower)

Behavioural Constructs
Activity: FindBooks
Pickup slips and find the books in the stack.
Precondition (Q.Slips.n > 0) AND (Q.ClerksIdle.n > 0)
Event SCS
clerkId SP.RemoveQu(Q.ClerksIdle)
IF(Q.Slips.n > MAX_SLIPS)
numSlips MAX_SLIPS
ELSE
numSlips Q.Slips.n
ENDIF
num 0
WHILE (num < numSlips)
iC.Borrower SP.RemoveQu(Q.Slips)
SP.InsertQu(RQ.Clerk[clerkId], iC.Borrower)
num num+1
ENDWHILE
RQ.Clerk[clerkId].status BUSY
RQ. Clerk[clerkId].servicing FINDBOOKS
Duration
RVP.uFindBooksTime(RQ.Clerk[clerkId].n)
Event SCS
RQ.Clerk[clerkId].servicing READYCHECKOUT

Activity Construct: CheckOut


Time to process the end of the checkout of books with each customer.
Precondition UDP.ClerkReadyToCheckout() NONE
Event SCS
clerkId UDP.ClerkReadyToCheckOut()
RQ.Clerk[clerkId].servicing CHECKINGOUT
Duration
RVP.uCheckOutTime()
Event SCS
iC.Borrower SP.RemoveQu(RQ.Clerk[clerkId])
SP.Put(PHI[ResponseTime], t - iC.Borrower.arrivalTime)
SP.Leave(iC.Borrower)
IF(RQ.Clerk[clerkId].n = 0)
RQ.Clerk[clerkId].status IDLE
SP.InsertQu(Q.ClerksIdle, clerkId)
ELSE
RQ.Clerk[clerkId].servicing READYCHECKOUT
ENDIF

Design of Verification/Validation Experimentation


Given the simplicity of the model, it is possible to validate the model using a trace log as
described below.
Trace Logging
The state of the simulation model is monitored by tracking the length of the two queues and each
of the RQ.Clerk resource queues.. These values are presented as follows (shown for 3 clerks):
-------->Clock: xxx<----------------Current State: Q.Slips.n = xxx, Q.ClerksIdle.n = xxx
RQ.Clerk[0].n = xxx RQ.Clerk[1].n = xxx RQ.Clerk[2].n = xxx

where the xxxs are replaced with the current value of the clock and designated attribute values.

Simulation Model
Design of Simulation Model and Program
The simulation model is implemented in the class Library (an extension of the ABSmod/J class
AOSimulationModel) and a number of other classes used to implement the various constructs
from the ABCmod conceptual model. All Java classes that make up the Java Library simulation
model are placed in the Java package librarySimModel.
The following table shows how the various ABCmod entity structures are mapped to Java
classes and how objects instantiated from these classes are reference by the Library class.
Entity Structures
Java Class

ABCmod
Construct
iC.Borrower

Borrower

Typically by the reference


variable icBorrower in the
various methods that
manipulate Component
objects.

RQ.Clerk

Clerk

Library.rqClerk

The enum types Status and Servicing are


defined to restrict the values of the status and
servicing attributes respectively. The list
attribute is implemented as a reference variable
list to an ArrayList object. The methods
getN() provides the value of the attribute n and
the method spRemoveQue() implements the
standard procedure SP.RemoveQue for the entity.
Q.Slips

ArrayList<Borrower>

The queue is implemented using the ArrayList


(standard Java Class), referenced by the private
reference variable qSlips
Notes
The various methods available in the
ArrayList class provide the implementation
of the various ABCmod procedures, such as
SP.InsertQue (qSlips.add) SP.RemveQue
(sqSlips.remove).
The attribute n is maintained within the
ArrayList object (adjusted automatically
when ArrayList methods are called). The
method qSlips.size() provides the value of
the Q.Slips.n attribute.

Object References

The above reference


variable references an array
of numClerks Clerk
objects.

Library.qSlips

The above reference


variable references an
ArrayList object.

Q.ClercksIdle

ArrayList<Integer>

The queue is implemented using the ArrayList


(standard Java Class), referenced by the private
reference variable qSlips
Notes
See the description of Q.Slips for the use of
the various ArrayList methods to implement
attributes and standard procedures.
Note that since RQ.Clerk (with scope=Set)
are queued, the identifiers, i.e. integer values,
are stored in the queue. Java autoboxing
with convert integers to/from Integer objects.
Examples (clerkId is an integer variable):
o qClerksIdle.add(clerkId)
o

Library.qClerksIdle

The above reference


variable references an
ArrayList object.

clerkId = qClerksIdle.remove(0)

The following table provides mapping between the conceptual model Action/Activities to Java
classes.
Actions/Activities
ABCmod Constructs
Java Classes
BorrowerArrival
BorrowerArrival
FindBooks
FindBooks
CheckOut
CheckOut
Other classes that make up the Library ABSmod/J simulation model include:
Output (referenced by Library.output): Contains the Trajectory sets and methods for
computing the DSOVs.
RVPs (referenced by Library.rvp): Contains the Java methods used to implement the CM
RVPs.
UDPs (referenced by Library.udp): Contains the Java methods used to implement the CM
UDPs.
Seeds: The class used to pass seeds for random number generators used in implementing the
various RVPs.
The package librarySimModel provides public access to the following:
The constructor Library to allow creation and initialisation of a Manufacturing object,
The methods getAverageResponseTime(),getClerkUtil(),access the value of the output
variables avgResponseTime, clerkUtil[id] respectively.
The methods clearAllOutput() and clearResponseTimeOutput() to support the warm
up time.
All public methods provided by the class AOSimulation (e.g. runsimulation) for
supporting experimentation.

Results of the Verification/Validation Experimentation


Beginning of the observation interval
Run with 3 clerks
-------->Clock: 0.0<----------------Current State: Q.Slips.n = 0, Q.ClerksIdle.n = 3
RQ.Clerk[0].n = 0 RQ.Clerk[1].n = 0 RQ.Clerk[2].n = 0
------------SBL---------TimeStamp:2.0252182936660885 Activity/Action: librarySimModel.BorrowerArrival
TimeStamp:20.0 Stop Notification
----------------------------->Clock: 2.0252182936660885<----------------Current State: Q.Slips.n = 0, Q.ClerksIdle.n = 2
RQ.Clerk[0].n = 1 RQ.Clerk[1].n = 0 RQ.Clerk[2].n = 0
------------SBL---------TimeStamp:6.519692166753867 Activity/Action: librarySimModel.FindBooks
TimeStamp:11.62419301944119 Activity/Action: librarySimModel.BorrowerArrival
TimeStamp:20.0 Stop Notification
----------------------------->Clock: 6.519692166753867<----------------Current State: Q.Slips.n = 0, Q.ClerksIdle.n = 2
RQ.Clerk[0].n = 1 RQ.Clerk[1].n = 0 RQ.Clerk[2].n = 0
------------SBL---------TimeStamp:7.519692166753867 Activity/Action: librarySimModel.CheckOut
TimeStamp:11.62419301944119 Activity/Action: librarySimModel.BorrowerArrival
TimeStamp:20.0 Stop Notification
----------------------------->Clock: 7.519692166753867<----------------Current State: Q.Slips.n = 0, Q.ClerksIdle.n = 3
RQ.Clerk[0].n = 0 RQ.Clerk[1].n = 0 RQ.Clerk[2].n = 0
------------SBL---------TimeStamp:11.62419301944119 Activity/Action: librarySimModel.BorrowerArrival
TimeStamp:20.0 Stop Notification
----------------------

Period when all clerks are busy


-------->Clock: 13.839792900157727<----------------Current State: Q.Slips.n = 0, Q.ClerksIdle.n = 0
RQ.Clerk[0].n = 1 RQ.Clerk[1].n = 1 RQ.Clerk[2].n = 1
------------SBL---------TimeStamp:15.026303443584254 Activity/Action: librarySimModel.BorrowerArrival
TimeStamp:16.193886624826657 Activity/Action: librarySimModel.FindBooks
TimeStamp:16.527374079181612 Activity/Action: librarySimModel.FindBooks
TimeStamp:17.961138619785153 Activity/Action: librarySimModel.FindBooks
TimeStamp:20.0 Stop Notification
----------------------------->Clock: 15.026303443584254<----------------Current State: Q.Slips.n = 1, Q.ClerksIdle.n = 0
RQ.Clerk[0].n = 1 RQ.Clerk[1].n = 1 RQ.Clerk[2].n = 1
------------SBL---------TimeStamp:16.016732145570312 Activity/Action: librarySimModel.BorrowerArrival
TimeStamp:16.193886624826657 Activity/Action: librarySimModel.FindBooks
TimeStamp:16.527374079181612 Activity/Action: librarySimModel.FindBooks
TimeStamp:17.961138619785153 Activity/Action: librarySimModel.FindBooks
TimeStamp:20.0 Stop Notification
----------------------------->Clock: 16.016732145570312<----------------Current State: Q.Slips.n = 2, Q.ClerksIdle.n = 0
RQ.Clerk[0].n = 1 RQ.Clerk[1].n = 1 RQ.Clerk[2].n = 1
------------SBL---------TimeStamp:16.193886624826657 Activity/Action: librarySimModel.FindBooks
TimeStamp:16.527374079181612 Activity/Action: librarySimModel.FindBooks

TimeStamp:16.998957837932423 Activity/Action: librarySimModel.BorrowerArrival


TimeStamp:17.961138619785153 Activity/Action: librarySimModel.FindBooks
TimeStamp:20.0 Stop Notification
----------------------------->Clock: 16.193886624826657<----------------Current State: Q.Slips.n = 2, Q.ClerksIdle.n = 0
RQ.Clerk[0].n = 1 RQ.Clerk[1].n = 1 RQ.Clerk[2].n = 1
------------SBL---------TimeStamp:16.527374079181612 Activity/Action: librarySimModel.FindBooks
TimeStamp:16.998957837932423 Activity/Action: librarySimModel.BorrowerArrival
TimeStamp:17.193886624826657 Activity/Action: librarySimModel.CheckOut
TimeStamp:17.961138619785153 Activity/Action: librarySimModel.FindBooks
TimeStamp:20.0 Stop Notification
----------------------------->Clock: 16.527374079181612<----------------Current State: Q.Slips.n = 2, Q.ClerksIdle.n = 0
RQ.Clerk[0].n = 1 RQ.Clerk[1].n = 1 RQ.Clerk[2].n = 1
------------SBL---------TimeStamp:16.998957837932423 Activity/Action: librarySimModel.BorrowerArrival
TimeStamp:17.193886624826657 Activity/Action: librarySimModel.CheckOut
TimeStamp:17.527374079181612 Activity/Action: librarySimModel.CheckOut
TimeStamp:17.961138619785153 Activity/Action: librarySimModel.FindBooks
TimeStamp:20.0 Stop Notification
----------------------

Annex A Data Modelling


1) Borrower Arrivals: Borrowers arrive in the library with an arrival rate of 30
borrowers/hour. Borrower arrivals will be modelled using a Poisson arrival process. That is,
interarrival times between parts are exponentially distributed with a mean arrival time of 60
minutes/30 borrowers = 2 minutes.
2) Finding books: The time to find books is normally distributed and depends on the number of
books to find. The following table gives the parameters of the normal distribution according
to the number of books to find:
Number
of books
1
2
3
4

Mean
(min)
4
7
9
12

Standard
Deviation
(min)
0.8
1.4
1.8
2.4

3) Check out time: The time to check out 1 book is uniformly distributed between 1 and 3
minutes.

You might also like