Professional Documents
Culture Documents
M ECHANISMS F OR Q O S P ROVISIONING
I N W I MAX N ETWORKS
Master of Engineering
in
Electronics and Telecommunication Engineering
by
ROMESH LAISHRAM
U ndertheguidanceof
PROF . I TI
S AHA M ISRA
JADAVPUR UNIVERSITY
KOLKATA-32
MAY 2010
1
i1
Certificate
This is to certify that the thesis entitled Adaptive Call Admission Control
Mechanisms for QoS Provisioning in WiMAX Networks submitted by
MR.ROMESH LAISHRAM in partial fulfillment of the requirements for the
award of degree in Master of Electronics and Telecommunications Engineering
of Jadavpur University is an authentic work carried by him under my supervision
and guidance.
To the best of my knowledge, the matter embodied in the thesis has not been
submitted to any other University / Institute for the award of any Degree or
Diploma.
Supervisor
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnJadavpur University
Kolkata -700032
COUNTERSIGNED
nnnnnnnnnnnnnnn
n
n
(Prof.Niladri chakraborty)
Dean
Faculty of Engineering and
Technology
Jadavpur University
Kolkata -700032
ii1
JADAVPUR UNIVERSITY
FACULTY OF ENGINEERING AND TECHNOLOGY
DEPARTMENT OF
ELECTRONICS & TELE-COMMUNICATION ENGINEERING
Certificate of Approval *
The foregoing thesis is hereby approved as a creditable study of an engineering
subject, carried out and presented in a manner satisfactory to warrant its acceptance
as a prerequisite to the degree for which it has been submitted. It is understood that
by this approval the undersigned do not necessarily endorse or approve any
statement made, opinion expressed or conclusion drawn therein but approve the
thesis only for the purpose for which it has been submitted.
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
iii1
Acknowledgement
I would like to express great appreciation to my supervisor, Prof. Iti Saha
Misra, for her complete patience, valuable guidance and generous assistance
throughout the year. She has been a constant source of advice and encouragement
since the very beginning of my M.E project. Her support and precious time spent
in discussions have guided me through the duration of this work. Without her close
supervision, the completion of this piece of work would not have been possible.
Also I wish to express my sincere gratitude to her for reviewing my thesis and for
her valuable comments and suggestions regarding the manuscript. I would also like
to thank her for giving me the opportunity to work on this interesting topic.
I would like to thank the entire E.T.C.E Department and all the people, who
directly or indirectly helped me, complete my thesis within the stipulated time.
Place: Kolkata
Date: /
/
(Romesh Laishram)
Department of Electronics and
Telecommunications Engineering
Jadavpur University
Kolkata -700032
iv1
Abstract
Emergence of different wireless technologies in recent past has projected wireless
as an alternate medium for internet connectivity. Wireless technologies are able to
provide mobility and portability that makes it more attractive as compared to wired
technologies. Further, increasing requirement to support ubiquitous connectivity
with higher data rate for mobile computers and communication devices are fuelling
a growing interest in broadband wireless access (BWA) networks. To solve issues
related to BWA and frame specifications for it, study group 802.16 was formed
under IEEE project 802 to recommend an international standard for Wireless
Metropolitan Area Networks (Wireless MAN). Quality of Service (QoS) is one of
the added values for IEEE 802.16 standard over other existing wireless standards.
WiMAX is defined as Worldwide Interoperability for Microwave Access by the
WiMAX Forum, an industrial body formed in June 2001 to promote conformance
and interoperability of the IEEE 802.16 standard. The Forum describes WiMAX as
a standards-based technology enabling the delivery of wireless broadband as an
alternative to cable and DSL. It is being seen as a tool to bridge the Digital Divide
by providing applications over the air to sparsely populated regions across the
world.
Although IEEE 802.16 standard defined the QoS parameters, they do not specify
how these QoS parameters are satisfied and it is an open issue for research.
This thesis analyses the design of Call Admission Control (CAC) scheme for QoS
provisioning in IEEE 802.16 based WiMAX networks. First a bandwidth efficient
CAC scheme is propose with bandwidth and delay guarantee that generally
operates at the (Medium Access Control) MAC layer. The concept of adaptive
bandwidth degradation is introduced to improve the bandwidth utilization of the
system. A Markov Chain based analytical model is developed to evaluate the
performance of the CAC scheme. The proposed CAC scheme is compared with an
existing CAC scheme that uses the concept of fixed step size degradation. Second
an adaptive guard channel based CAC scheme is propose considering the Adaptive
Modulation and Coding (AMC) that basically operates at the (Physical) PHY layer.
v1
vi 1
CONTENTS
1. Introduction
1.1 Introduction 2
1.2 Objective of Work..7
1.3 Outline of thesis..................................................................................... 8
2. Markov Chains
2.1 Introduction.. 10
2.2 Chapman-Kolmogorov Equations 11
2.3 Classification of States. 13
2.4 Representation of the Analytical Model of a BS as a Markov Chain
Model . 15
2.5 Performance Evaluation of the CAC Mechanisms using Analytical
Model 17
3. Adaptive CAC for QoS Provisioning in WiMAX Networks
3.1 Introduction...21
3.2 Related Work 21
3.3 Adaptive bandwidth degradation - CAC (ABD-CAC) 23
3.3.1 Notations used ..23
3.3.2
vii 1
5.1 Introduction.. 50
5.2 Related works... 51
5.3 Adaptive Guard Channel CAC (AGC-CAC) Scheme . 53
5.3.1 Notation used ... 53
5.3.2 AGC-CAC algorithm ...54
5.4 System model .. 56
5.5 Simulation results 58
5.6 Summary .. 64
6. Conclusion and Future Scope of Work
6.1 Conclusion.66
6.2 Future Scope of Work...67
References..69
viii 1
Chapter-1
Introduction
1 2
Introduction
1.1
Introduction
Since the final decades of the twentieth century, data networks have shown
steadily growing success. Until the year 2000, users of the Internet accessed its
contents primarily through wired, fixed infrastructure sites (e.g., universities, home
dial-up connections, and corporate and government facilities). However,
technology has evolved such that a significant number of users today access
Internet services wirelessly. The cumulative result has created an informationcentric society where users rely on network services in most aspects of their dayto-day life. The emerging wireless Internet architecture aims to continue the access
revolution by supporting an increasing number of users at increased data rates,
such that the user experience is similar to the experience from a wired, high-speed
connection. A variety of wireless technologies have been proposed, both in
standards organizations and by industry consortiums, to enable wireless network
access.
Today the buzzword in the communication domain is Broadband Wireless Access
(BWA). Broadband wireless is about bringing the broadband experience to a
wireless context, to support access at broadband rates. According to popular ITU
definition broadband rates means providing service at a rate of at least 1.544 Mbps
[1]. There are two fundamentally different types of broadband wireless services.
The first type attempts to provide a set of services similar to that of the traditional
fixed-line broadband but using wireless as the medium of transmission. This type,
called fixed wireless broadband, can be thought of as a competitive alternative to
DSL or cable modem. The second type of broadband wireless, called mobile
broadband, offers the additional functionality of portability, nomadicity and
mobility. Mobile broadband attempts to bring broadband applications to new user
experience scenarios and hence can offer the end user a very different value
proposition.
1 3
TM
since
1 4
1 5
As the IEEE STD 802.16 has grown must of the evolution has occurred in the
physical layer (PHY), which is the primary arbiter of the physical environment in
which the technology can operate. All of this development, however, is based on
the essence of the standard: its medium access control layer (MAC) specification.
This MAC, which supports all of the standards PHY options, was originally
designed for the first application: carrier quality, enterprise based
telecommunications services .Because of this history, the IEEE 802.16 standard
can support the most demanding service requirements, even as it evolves towards
more consumer-friendly applications. This is a key factor in applicability of the
standard. One of the Primary MAC-related features of the standard is its support
for differentiated quality of service (QoS) among its users. An IEEE 80.16 base
station (BS) can simultaneously support a variety of customer service
requirements, for example, very demanding services such as real-time video
conferencing along with T1/E1 service, voice over internet protocol (VOIP) and
best effort internet.
Initially the IEEE 802.16 was aimed at providing high speed internet access in the
Point-to-Multipoint (PMP) manner only. The deployment of PMP mode of
operation is as depicted in figure 1.2, where all traffic between subscriber stations
(SS) or mobile stations (MS) are controlled by a base station (BS). In PMP mode
traffic directions is used to distinguish two types of data channels: uplink (UL)
channel where data is sent from the SSs to the BS, and downlink (DL) channel
where data bursts are sent from BS to all SSs. Another type of operational mode
was later included which id called the mesh mode of operation. In mesh mode,
traffic can be routed directly between SSs or between the SS and the BS.11There are
two modes for granting requested bandwidth to SS by the BS: Grant per
connection (GPC) and Grant per subscriber station (GPSS). In our study we have
assumed PMP and GPC mode.
1 6
1 7
air interface, support to a mesh mode of the MAC was also added, so as to allow SSs
to relay packets directed to the BS or other SSs. Finally, the Orthogonal Frequency
Division Multiple Access (OFDMA) [7] was tailored to mobile BWA applications,
even though support to mobile terminals was only added in the 2005 release of the
IEEE 802.16 standard, i.e. IEEE 802.16e [2]. To support a wide variety of
applications, the IEEE 802.16 std. defines five scheduling services that should be
supported by the BS MAC scheduler for data transport over a connection. Table
1.1 shows the different types of service flows supported in WiMAX and typical
example of each service flow.
Table 1.1: Service Flows supported in WiMAX
Service Flow Designation
Defining QoS
Parameters
Maximum Sustained Rate
Unsolicited Grant
Maximum Latency
Service (UGS)
Tolerance
Jitter Tolerance
Minimum Reserved Rate
Maximum Sustained Rate
Maximum Latency
Tolerance
Traffic Priority
Application Examples
Traffic Priority
transfer
Maximum Latency
Tolerance
suppression
Jitter Tolerance
Traffic Priority
1 8
PHY feature of IEEE 802.16e includes uses Scalable OFDMA to carry data,
supporting channel bandwidths of between 1.25 MHz and 20 MHz, with up to
2048 sub-carriers. It supports adaptive modulation and coding (AMC), so that in
conditions of good signal, a highly efficient 64 QAM coding scheme is used,
whereas where the signal is poorer, a more robust BPSK coding mechanism is
used. In intermediate conditions, 16 QAM and QPSK can also be employed. AMC
provides the flexibility to match the modulation-coding scheme to the average
channel conditions for each user. With AMC, the power of the transmitted signal is
held constant over a frame interval, and the modulation and coding format is
changed to match the current received signal quality or channel conditions. In a
system with AMC, users close to the Base station are typically assigned higher
order modulation with higher code rates (e.g. 64 QAM with R=3/4 Turbo codes),
but the modulation-order and/or code rate will decrease as the distance from Base
station increases.
1 9
1 0
Chapter-2
M arkov Chains
1 2.1
Markov Chains
2.1 Introduction
A stochastic process X={X (t), t T} [36] is a collection of random
variables. That is for each t in the index set T, X (t) is a random variable. We often
interpret t as time and call X (t) as the state of the process at time t. If the index set
T is countable set, say T = {0, 1, 2}, we say that X is a discrete time stochastic
processes, whereas if T consists of a continuum of possible values, we say that X is
a continuous time stochastic processes.
A discrete time stochastic processes Xn, n = 0, 1, 2 takes on finite or
countable number of possible values. This set of possible values will be denoted by
the set of nonnegative integers 0, 1, 2 If Xn, = i, then the processes is said to be
in state i at time n. Suppose that whenever the process is in state i, there is a fixed
probability
(2.1)
For all states i0, i1 , , in-1, i, j and all n 0. Such a stochastic process is
known as a Markov chain [35]. Equation (2.1) may be interpreted as stating that,
for a Markov chain, the conditional distribution of any future state Xn+1, given the
past states X0, X1, . .Xn-1 and the present state Xn, is independent of past states and
depends only on the present state. That is, given the present state, the past and
future states of Markov chain are independent. If this is the case, the time period
for which the process has stayed in the current state should play no role in
determining the next state. The duration for which a process has stayed in a
particular state doesnt influence next state transition.
The value Pi, j represents the probability that the processes will, when in
state i, next make a transition into state j. As probabilities are nonnegative and the
processes must make a transition into some state, we have
(2.2)
(2.3)
1 221
, then P can be
P0,0 P0,1
P1,0 P1,1
P = ... ...
Pi ,0 Pi,1
... ...
that it is snowy two days from now is the disjoint union of the following three
1 231
events: 1) it is rainy tomorrow and snowy two days from now, 2) it is nice
tomorrow and snowy two days from now, and 3) it is snowy tomorrow and snowy
two days from now. The probability of the first of these events is the product of the
conditional probability that it is rainy tomorrow, given that it is rainy today, and
the conditional probability that it is snowy two days from now, given that it is
rainy tomorrow. Using the transition matrix P, we can write this product as
The other two events also have probabilities that can be written as products of
entries of P. Thus, we have
This equation is similar to a dot product of two vectors; we are dotting the
first row of P with the third column of P. In general, if a Markov chain has r states,
then
of the Markov
chain is defined as the conditional probability, given that the chain is currently in
state i, that it will be in state j after n additional transitions. That is,
(2.4)
And it can be represented in the form of equations as
(2.5)
in state i, will go to state j after n+m transitions through a path that takes it into
state k at the nth transition. Hence, summing these probabilities over all immediate
states k yields the probability that process will be in state j after n+m transitions.
Formally, we have
1 241
=
=
=
These equations are known as The Chapman-Kolmogorov equations and
they provide a method of computing the n-step probabilities.
If we let
, then the
(2.6)
where the dot represents matrix multiplication. Hence,
and, by induction,
(2.7)
In our example
is as shown below
i, we will reach j for the first time after exactly n steps. Moreover define
transient.
Proposition 1: i is recurrent
1 251
E (# of visits to i | X0 = i) =
i is transient P(i infinitely often | X0 = i) = 0
and
E (# of visits to i | X0 = i) <
Definition 2: Let i and j be two states. We call j reachable from i and write i j if
there exists an n 0 such that
i then i is transient.
Preposition 5: All states in a finite, closed, and irreducible set S are recurrent.
1 261
> 0 }.
exists and is
said to be a stationary Markov chain. Because the Markov chain is thus stationary
when its initial state is chosen according to the probability
, these probabilities
are called stationary probabilities and their defining equations (2.1) and (2.2) are
called the stationary equations.
1 271
connection admission. Consider the simple CAC mechanism in which the BS will
admit the connection whenever there is sufficient amount of bandwidth left at the
BS, to accommodate the connection. Otherwise the BS will reject the connection.
In this scenario the BS can be uniquely represented in the form of a State s = (nu,
nr, nn) based on the number of admitted connections of each type. State s = (nu, nr,
nn) represents that the BS has currently admitted nu, nr, and nn number of UGS,
rtPS and nrtPS connections respectively into the network. The BS will be in a
particular State s = (nu, nr, nn) until a new connection of either type (UGS, rtPS,
nrtPS) is admitted into the network or an ongoing connection of either type (UGS,
rtPS, nrtPS) is terminated. The arrival process of new requests for UGS, rtPS and
nrtPS connections is assumed to be Poisson with rate U, r, n respectively. The
service time for UGS, rtPS and nrtPS connections is assumed to be exponentially
distributed with mean 1/u, 1/r, and 1/n respectively.
Based on this, the BS changes state from one to another upon the admission
or rejection of a connection. Further it is assumed that the BS either admits or
rejects only one connection at a particular instant of time. The next state of the BS,
depends only on the present state the BS currently is in and does not depends on
the previous states the BS is in. From the previous sections we can conclude that
the states of the BS form a Markov Chain, and hence the BS can be analytically
modeled using the Markov Model.
Furthermore we can say that the Markov Chain obtained has the ergodic
property. That is we obtain an irreducible and aperiodic Markov Chain. This can be
proved by taking an example. Consider the BS has a total bandwidth of 128 Kbps
and UGS, rtPS, and nrtPS connections require 32 Kbps, 64 Kbps, and 64 Kbps of
bandwidth respectively Initially the BS the BS is assumed to be in State s = (0, 0,
0). The state transition diagram of this BS is as shown in Figure 2.1.
From the Figure 3.1 we can see that every state s = (nu, nr, nn) in state space
S is reachable from every other state. That is each state communicates with other
states in the state space S. Therefore the state space S forms a closed set and all the
states are recurrent. Therefore the Markov chain is irreducible. Also all the states in
the state space S is aperiodic. Therefore we can conclude that the state space S
forms an ergodic Markov Chain.
Therefore using the properties of the ergodic Markov Chain (3.8, 3.9, 3.10)
we can calculate the performance of the system. According to equation 3.8 the
1 281
steady state probability of all the states s in the state space S exists and is
independent of the initial state. The steady state probabilities of all the states s can
be obtained by solving the (3.9) and (3.10). After obtaining the steady state
probabilities we can obtain the Performance of the CAC mechanism.
+ r
+ n
(2.11)
Similarly we can get the steady state balance equations of all the states s in
the state space S. If there are n numbers of states, we get n dependent steady state
balance equations. Also we know that the sum of all the steady state probabilities
of all the states should be equal to one (2.10). By substituting (2.10) in place of any
one of the n dependent equations obtained, we can calculate the steady state
probabilities of all the states by solving the state balance equations [36].
1 291
that we consider in our thesis are Blocking Probabilities of UGS, rtPS, nrtPS
service flows and the Bandwidth Utilization of the system. For calculation of
steady state probabilities the following steps are followed:
1. Define the proposed CAC mechanism.
2. Based on the proposed CAC mechanism, obtain the state space S of the
Markov Chain. The state space will be different for different CAC
mechanisms.
3. Obtain the state balance equation for each state s in the state space S of the
Markov Chain.
4. Obtain the Steady State Probabilities of the all the states in the state space S
of the Markov Chain by solving the state balance equations.
The steady state probability of the state s represents the probability of the
BS being in that particular state S at any given instant of time.
a. Calculation of new connection blocking probability
Using the steady state probabilities the blocking probabilities of the
connections can be calculated. The new connection blocking probability is
the probability of rejecting a new request for connection. For example the
blocking probability of a new arriving UGS request is the sum of all the
steady state probabilities of the states s = (nu, nr, nn) in the state space S for
which there is no transition to the state s = (nu+1, nr, nn). In the above
example the blocking probability of new UGS requests is equal to the sum
of the steady state probabilities of the states (4, 0, 0), (2, 1, 0), (0, 2, 0), (0,
1, 1), (2, 0, 1), (0, 0, 2). In similar manner the blocking probabilities of rtPS
and nrtPS connections can be calculated.
Where Bu, Br, Bn are the bandwidth requirement of the UGS, rtPS, nrtPS
connections respectively.
1 201
1
1
1
1
1
1
1
Chapter-31
1
Introduction
1 3.1
In this chapter a band width efficient CAC mechanism is proposed for QoS
provisioning in WiMAX networks. As IEEE 802.16e MAC is connection-oriented,
the Mobile Stations (MSs) must establish an end-to-end connection before actually
transmitting the data. As there is a provision for mobility of the users in IEEE
802.16e the request for connection establishment at the Base Station (BS) may be a
Handoff connection request from the neighboring BS or a newly originated
connection request from the MS within the BS. Once the BS receives the
connection request, it takes a decision on whether to accept the connection or not,
based on the current network load and the bandwidth required by the connection
during its lifetime. The proposed CAC scheme is mainly focused on achieving high
bandwidth utilization of a stressed WiMAX network with QoS guarantees and thus
ensuring no wastage of network bandwidth resources. To show the effectiveness of
the proposed CAC scheme comparative analysis with another CAC scheme is
presented at the end of the chapter.
3.2
Related works
Although there are substantial literatures on Call Admission Control (CAC), to the
best of our knowledge there are no proposed CAC scheme in literatures that has
100 % bandwidth utilization with both bandwidth and delay guarantees for a
stressed network.
In [8], the authors proposed a dynamic CAC scheme based on the scheduling
service characteristics for IEEE 802.16d Fixed WiMAX. The proposed CAC
scheme uses bandwidth reservation and degradation policies. Bandwidth
reservation policy is used to prioritize the UGS connections, as UGS is the most
common way used by the people to communicate in every day life. Degradation is
the method of decreasing the bandwidth allocated to the admitted connections in
order to accommodate more number of connections. Degradation is possible in
rtPS and nrtPS connections since these connections generate variable bit rate
traffic. The bandwidth of these connections may vary between Maximum sustained
traffic rate (MSTR) and Minimum reserved traffic rate (MRTR). In this CAC
scheme only nrtPS connections are degraded. The authors showed that degradation
model improves the bandwidth utilization of the system as well as decreases the
1 321
blocking probabilities of the service flows than that of the constant rate CAC
scheme. The constraint of this scheme is that it does not provide any delay
guarantees to the delay sensitive rtPS connections. Also the CAC scheme is
proposed for Fixed WiMAX which does not support mobility. The CAC scheme
proposed in [9] also followed the similar approach as that in [8]. The authors in
[10] proposed a CAC scheme that also uses Bandwidth reservation and provides
QoS provisioning by keeping new connection blocking probability (NCBP) and
Handoff connection dropping probability (HCDP) below a threshold which is
dynamically adjusted. The CAC scheme proposed in [11] controls the number of
connections admitted to the network by limiting it below a threshold and the
bandwidth allocation is considered at the scheduling stage. A fractional guard
channel policy was developed in [12] [13] [14], but the resource partitioning
among different classes led to the waste of bandwidth in the under-loaded classes.
In [15], Liping Wang et al. proposed a CAC scheme based on the IEEE
802.16e Mobile WiMAX standard. Handoff connections are given higher priority
than newly originated connections, because it is more annoying to drop an ongoing
connection rather than blocking a newly originated connection. The authors also
use degradation for increasing Bandwidth Utilization (BU), NCBP and HCDP. But
like [8] delay guarantees are not considered. In [16], Yin Ge et al. proposed a CAC
scheme for IEEE 802.16e Mobile WiMAX. In that the authors gave priority to
handoff connections by allowing them to use the degraded bandwidth of the
admitted connections, contrary to [15] where bandwidth reservation is used. The
drawback of this scheme is that it does not provide any delay guarantees to
admitted connections. In [17]-[18] the authors proposed a scheduling algorithm
and CAC policy for QoS in IEEE 802.16 Fixed WiMAX. In that the CAC scheme
provides both bandwidth guarantees to all service flows and delay guarantees to
rtPS service flows. Both the CAC schemes were token bucket based CAC
schemes, but the CAC schemes proposed were simple which do not use any
degradation mechanism to improve BU, NCBP and HCDP.
In [19], the authors proposed a non-reservation CAC policy with degradation
which provides bandwidth and delay guarantees and improves BU, NCBP and
HCDP compared to the previous schemes. The proposed CAC scheme is obtained
from modifying the CAC scheme proposed in [8]-[19]. However in the previously
1 331
3.3
In the proposed CAC policy all the hand off connections are given equal priorities
unlike [19]. Degradations are performed on both rtPS and nrtPS connections but to
maintain the priorities of the connections the bandwidth obtain from the
degradation of rtPS and nrtPS connections are given to handoff connections only.
For newly originated UGS connections only nrtPS connections are degraded. No
degradation is performed for new rtPS and nrtPS connections. The BE connections
are not considered in the proposed CAC scheme, because they are designed to
support best effort flows which does not need any QoS guarantees and are always
admitted into the network and are handled on bandwidth availability. Also ertPS
connections requests are considered to be same as rtPS connections, because both
connections have same QoS parameters and differ only by the way of
Request/Transmission policy.1
3.3.1
Notations used
The QoS parameters of each UGS, rtPS and nrtPS connection and the
terminologies used in this paper is given below.
1 341
di
mi
: di /f (an integer)
BU
max
Br
min
Br
max
Bn
min
Bn
nu
nr
nn
Br
Bn
Balloc
: Allocated bandwidth
ri
bi
Breq
(3.1)
1 351
Else
Reject the connection;
End
Else
// Perform Degradation of nrtPS connections
Else
Reject the connection;
End
Else
// Perform Degradation of rtPS connections
1 361
bandwidth;
Else
Reject the connection;
End
End
End
Else
Reject the connection;
End
Else
// Perform Degradation of nrtPS connections
Else
1 371
End
End
End
(iii) CAC for new rtPS connection
Else
Reject the connection;
End
End
(iv) CAC for new nrtPS connection
If (new nrtPS connection arrives at BS)
If (Bn <= (B-Balloc)) // Check for bandwidth availability.
If equation (3.1) is satisfied //Check for Delay Guarantees if both bandwidth
// and delay guarantees are satisfied
Admit the Connection;
Else
Reject the connection;
End
End
3.4
Analytical model
1 381
hr
hn
hu
hand off connections and the subscript o represents newly originated connections
in a cell. Therefore the total arrival rate of the connection requests at the base
station is equal sum of all the individual arrival rates of all the connections i.e.
hu
hr
hn
+ ou +
hor
+ on
(n u , n r , B r , n n , B n ) is
(n u ,n r ,Br ,n n ,Bn )
(n u , n r , B r , n n , B n )
(n u + 1, n r , Br , n n , Bn )
Transition
rate
tu
(n u 1, n r , Br , n n , Bn )
n u u
(n u , n r + 1, Br , n n , Bn )
tr
Next State
1 391
(n u , n r 1, Br , n n , Bn )
n rr
(n u , n r , Br , n n + 1, Bn )
tn
(n u , n r , Br , n n - 1, Bn )
n nn
ou
u
u
r
r
n
n
tu = hu
,
otherwise
hu
+ , if n * B + ( n + 1) * Bmax + n * Bmax < B
or
u
u
r
r
n
n
tr = hr
,
otherwise
hr
+ , if n * B + n * Bmax + ( n + 1) * Bmax < B
on
u
u
r
r
n
n
tn = hn
, otherwise
hn
(v +1,w, x,y,z)
+ tr .
+ tn .
+ r.
(v,w,x, y1,z)
(v,w,x,y,z)
= tu .
.
(v1,w,x , y,z ) (v,w,x , y,z )
.
+ n .
.
(v,w,x ,y1,z) (v,w,x , y1,z )
(v, w -1, x , y, z ) (v, w -1, x , y, z )
+ (v + 1). u .
.
(v,w,x ,y+1,z). (v,w,x ,y+1,z )
1, ( v, w, x, y, z) S
0, otherwise
(v,w,x,y,z) =
1 301
= 1 and using
s S (v, w, x, y, z)
recursive algorithm, the steady state probability of each state can be obtained [20].
Using the steady state probabilities of all the states the following performance
parameters can be obtained.
CBP-UGS =
sS ( n u , n r , B r , n n , B n )
sS ( n u , n r , B r , n n , B n )
Where S' = {s = (n u , n r , Br , n n , Bn ) | nu * Bu + nr * Br + (nn + 1)* Bn > B }
CBP-NRTPS =
sS ( n u , n r , B r , n n , B n )
min
Where S' = {s = (n u , n r , Br , n n , Bn ) | (n u + 1)* Bu + n r * Bmin
r + n n * Bn > B}
HCDP-UGS =
HCDP-RTPS =
sS ( n u , n r , B r , n n , B n )
min
Where S' = {s = (n u , n r , Br , nn , Bn ) | nu * Bu + (nr +1)* Bmin
r + nn * Bn > B}
HCDP-NRTPS =
sS ( n u , n r , B r , n n , B n )
min
Where S' = {s = (n u , n r , Br , n n , Bn ) | nu * Bu + nr * Bmin
r + (nn +1)* Bn > B }
iii. Bandwidth Utilization:
1 4.1
The bandwidth utilization is defined as the average ratio of used bandwidth to the
total bandwidth. The Bandwidth Utilization can be calculated as follows
BU =
(s)
(n u . Bu + n r . Br + n n . B n )
(
,
,
,
,
)
n
n
B
n
B
u r r n n
s S
Where reru, rerr, rern are the revenue rates of UGS, rtPS and nrtPS respectively.
MSTR
(Kbps)
MRTR
(Kbps)
UGS
rtPS
nrtPS
256
1024
1024
256
256
256
Bucket
Size
(bi bits)
64
1024
1024
Delay
(ms)
21
-
(1/sec) 1/(sec)
0.4 x
0.3 x
0.2 x
10
5
2
In table 3.2, the parameter is defined as the service request parameter. The arrival
rate and the service times of all the handoff connections are assumed to be same as
the new connections. The simulation results are shown in the following figures.
1 421
1 431
1 441
Figure 3.1, 3.2 and 3.3 compares the blocking probabilities and dropping
probabilities of UGS, rtPS and nrtPS respectively. In these figures CAC1 is the
scheme with fixed step size degradation while CAC2 is the newly proposed
adaptive scheme. Since the two schemes differ only in the method of degradation,
no significant improvement can be achieved in the dropping probability and
blocking probability of all services as indicated in figure 3.1, figure 3.2 and figure
3.3 respectively. Figure 3.4 gives the bandwidth utilization of the system. It is quite
evident from the figure that with adaptive degradation the bandwidth utilization of
the system is excellent when the network is stressed. This is a significant
improvement of the proposed scheme over fixed step size degradation scheme.
Also Table3.3 shows that the average bandwidth allocated to rtPS and nrtPS
connections are more with adaptive degradation.
Table 3.3: Average bandwidth allocated to different services
Service
CAC2
UGS
256
256
rtPS
828.138
869.65
nrtPS
680.3
703.35
For simulation study of the long term average revenue the revenue rates of the
service flows can be as follows:
reru = 6, rerr = 4, rern = 2.
Where reru, rerr and rern are the revenue rates of UGS, rtPS and nrtPS connections
respectively.
The results of the comparative study of the long term average revenue for different
service flows are shown in the following figures.
1 451
1 461
1 471
Figure 3.5 indicates that the average revenue of UGS connections for fixed type
degradation CAC scheme and the proposed adaptive CAC scheme remains same
because UGS connections are allocated fixed bandwidth. However for rtPS and
nrtPS connections the average revenue are higher with adaptive CAC scheme
compared to fixed type degradation CAC scheme as shown in figure 3.6 and figure
3.7 respectively. This will increase the long term average revenue of the system.
Figure 3.8 shows the percentage increase in the long term average revenue of the
system. The increase in long term average revenue is direct consequence of
adaptive degradation and no penalty will be incurred on the system.
From the above results we can conclude that with adaptive degradation the
network under stressed condition has an efficient utilization of the available
network bandwidth resources.1
3.6 Summary
Efficient network resource utilization with QoS guarantees in the next high
speed bandwidth intensive multimedia wireless cellular networks poses great
challenges due to scarce radio bandwidth. Efficient Call Admission Control (CAC)
is important for the efficient utilization of the limited bandwidth. In this chapter, a
token bucket based CAC policy is proposed that provides efficient bandwidth
resource utilization with both bandwidth and delay guarantees under stressed
network conditions. The adaptive degradation has negligible effect on the dropping
and blocking probability of all services but it addresses one of the important issues
of wireless communication of efficient utilization of the limited scarce bandwidth
resources. The proposed policy may be considered as an optimal policy in terms of
the bandwidth utilization of the system.
1 481
Chapter-4
Tradeoffanalysis
1
1
1 491
1 401
narrowband service. In our study we follow the approach of [23] and applied to
WiMAX networks. The results show that the CAC scheme proposed in chapter 3 is
improved by making a fair trade off between NCBP and HCDP.
i.
When
new
UGS
connection
arrives,
if
the
inequality
min
(n u + 1)* Bu + n r * (Bmax
r Bth) + n n * Bn < B is satisfied and if equation (3.1) is
also satisfied then accept the new UGS call request otherwise reject it.
ii.
When
new
rtPS
connection
arrives,
if
the
inequality
max
nu * Bu + (nr + 1)* (Bmax
r Bth) + n n * (Bn Bth) < B is satisfied and if equation
(1) is also satisfied then accept the new UGS call request otherwise reject it.
iii.
When
new
nrtPS
connection
arrives,
if
the
inequality
max
nu * Bu + nr * Bmax
r + (nn +1)* (Bn Bth) < B is satisfied and if equation (3.1)
is also satisfied then accept the new UGS call request otherwise reject it.
iv.
When
handoff
UGS
connection
arrives,
if
the
inequality
min
(nu +1)* Bu + nr * Bmin
r + nn * Bn < B is satisfied and if equation (3.1) is also
satisfied then accept the new UGS call request otherwise reject it.
v.
When
handoff
rtPS
connection
arrives,
if
the
inequality
min
nu * Bu + (nr +1)* Bmin
r + nn * Bn < B is satisfied and if equation (3.1) is also
satisfied then accept the new UGS call request otherwise reject it.
1 5.1
vi.
When
handoff
nrtPS
connection
arrives,
if
the
min
inequality n u * Bu + n r * Bmin
r + (nn +1)* Bn < B is satisfied and if equation (3.1)
is also satisfied then accept the new UGS call request otherwise reject it.
The degradation variable Bth is optimized to minimize a cost function and it varies
for different traffic conditions. When Bth=0, the algorithm degenerates to simple
ABDCAC algorithm. In the next section we developed an analytical model for
implementing both the algorithms.
(4.1)
(4.2)
Where w1+w2+w3=1 and different w1, w2 and w3 means different priority of the
services. Therefore the weights are selected such that w1>w2>w3.
Because of the dynamic characteristic of traffic flow, the arrival rates of new call
and handoff call of both NB and WB vary with time. And the value of CF changes
with traffics, so the threshold Bth is periodically adjusted such that CF is
1 521
minimized. Bth can be varied in the interval 0 < Bth < B min
n .For a particular arrival
rate every feasible value of Bth is used to evaluate CF.The value of Bth that
corresponds to the smallest CF is the optimal value of Bth for that arrival rate.
Figure 4.1 shows the changes in the optimal value of Bth for different arrival rates.
As the arrival rates increases the network is stressed and since Handoff
connections are given higher priorities the degradation threshold is lower and
finally equals to zero. This lower in Bth is necessary to maintain minimum CF
when the arrival rate increases.
1 531
1 541
Figure 4.2-4.3 shows the comparative results of NCBP of UGS, rtPS and nrtPS
respectively. The figures showed that with the introduction of the degradation
threshold Bth, the blocking probabilities of the different connections for ABDCAC
scheme with fairness are lower than the simple ABDCAC scheme at lower arrival
rates. And the blocking probabilities with ABDCAC scheme with fairness are
different for different weights w1, w2 and w3. However as the arrival rate
increases the blocking probabilities of the two schemes becomes equal and the
ABDCAC scheme with fairness degenerates to the simple ABDCAC scheme. This
is because the degradation threshold is zero at higher arrival rates as indicated in
fig 4.1.The effect of the degradation threshold on nrtPS connections is minimal
because it is the lowest priority connections.
1 551
1 561
Figures 4.5-4.7 shows the HCDP for UGS, rtPS and nrtPS connections
respectively. Although the degradation threshold
connections the dropping probabilities are increased. But it can be observed for the
above figures that the increase in HCDP is not as significant as the decrease in
NCBP. Hence the CAC scheme will not degrade the performance of the network.
From the above results we can conclude that with the introduction of degradation
threshold variable, fairness between NCBP and HCDP can be achieved at lower
arrival rates.
1 571
4.6 Summary
1 581
Chapter-5
1 591
1 501
types of call i.e. new calls, handoff calls and modulation changed calls. Second, we
verify that the proposed CAC model can perform better compared to fixed guard
channel under varying traffic load conditions.
Spectral efficiency
Relative coverage
(b/s/Hz)
(%)
QPSK
1.5
100
16-QAM
49
-9
64-QAM
4.5
23
-17
Relative link
margin(dB)
1 6.1
There are substantial literatures for CAC schemes that generally consider
two types of call requests: new calls and handoff calls [26]-[29]. Due to the user
mobility, ongoing calls of current cell might be handed over to another cell.
However, the receiving cell might have insufficient resources due to the network
overload or hostile channel conditions. Therefore if the arrival rate of new or
handoff calls exceeds the capacity of a cell, it may start dropping calls or refuse
handoff attempts. Since call dropping is generally considered more annoying than
call blocking, many CAC mechanisms put a higher priority to handoff calls than
new calls. The guard channel CAC strategy is one of those schemes that provide
handoff-prioritized services for the mobile networks [29], [13].
The AMC induced call dropping has been ignored while designing the
CAC model. Only in few work the AMC has been considered at CAC level. In
[30], CAC with AMC was proposed for IEEE 802.16 networks using the concept
of fixed guard channel. The guard channels are available only to handoff calls and
modulation changed calls. Fixed guard channel is not an ideal option for providing
priority to handoff calls and modulation changed calls in a varying traffic load
network. Also only one type of call which supports two different types of
modulations (QPSK and 16-QAM) was considered in the scheme. But it does not
conform to IEEE 802.16 standard. The CAC model proposed in [31] follows a
similar approach as in [30]. In [32]-[33],the author have studied a performance
analysis of CAC with AMC for a general wireless network supporting one type of
calls and it shows that the CAC model considering AMC performs better than a
CAC model without AMC.
In this paper we have assumed two different types of calls i.e. (i) Real time
(RT) calls (ii) Non-real time (NRT) calls. Both the calls support two types of
modulation schemes. We named it as modulation type1 and modulation
type2.Therefore there will be total four different types of calls. In order to make
the system conform with IEEE 802.16 standard the Real time calls is made of UGS
and rtPS services while the non-real time calls consists of nrtPS and BE services.
The authors in [34] showed that neither QoS delay nor blocking parameters are
greatly affected by considering UGS traffic within the rtPS traffic class. Since the
BE service can be always admitted without regard to the system resources, we can
consider the CAC operation only for the guaranteed services.
1 621
GC
Brt1, Brt2 : Number of channel blocks required to a real time connection with
modulation type 1 and type 2, respectively
Bnrt1, Bnrt2 : Number of channel blocks required to a non- real time connection
with modulation type 1 and type 2, respectively
n1 , n 2
n ,n
3 4
nr1
nr2
hr1
hr2
nnr1
nnr2
: arrival rate of new NRT calls with modulation type 1 and type 2
respectively
1 631
hnr1
hnr2
1/ r1 ,1/ r2
1/ nr1 , 1/ nr2 : Average service times of NRT calls with modulation type 1 and
type 2 respectively
1/ mr1 , 1/ mr2 : Average service times of a RT call until changing modulation
from type 1 to type 2 or from type 2 to type1, respectively
1/ mnr1 , 1/ mnr2 : Average service times of a NRT call until changing
modulation from type1 to type 2 or from type 2 to type1,
respectively
GOS =BP_RT1+DP_RT1+BP_NRT1+DP_NRT1
(5.1)
Where
BP_RT = Blocking probability of new RT call
DP_RT = Dropping probability of handoff RT call
BP_NRT = Blocking probability of new NRT call
DP_NRT1 = Dropping probability of handoff NRT call
1 641
A new call can only be admitted when current bandwidth usage is less than (CGC). When the resource is not enough during the handoff or modulation change,
the call is dropped rather than degrading QoS.
The performance parameters i.e. the blocking and the dropping probabilities
depend on the arrival rate of the different calls and also on the amount of channels
reserved or Guard Channel (GC) for handoff calls and the modulation changed
calls. For a fixed arrival rate of the different calls the blocking probabilities,
dropping probabilities and GOS are calculated by varying GC. The objective is to
find the GC which gives minimum GOS and this value of GC is chosen for that
arrival rate. We allow the GC to vary up to 50 % of the total channel (C).The
distribution of the available channel is shown in figure 5.2.
else
Reject the connection;
End
1 651
End
If (a handoff call or modulation changed call request arrives)
If (Cr <= (C-GC))
Admit the connection;
else
Reject the connection;
End
End
For a given state s the transition occurs when a new request is accepted or an
ongoing connection terminates. The new request may be due to new call, handoff
call and modulation changed calls. The general state transition diagram for a state s
is shown in Table-5.2.
1 661
(n , n , n , n )
1 2 3 4
Next State
(n + 1, n , n , n )
1
2 3 4
(n - 1, n , n , n )
1
2 3 4
(n , n + 1, n , n )
1 2
3 4
(n , n - 1, n , n )
1 2
3 4
(n , n , n + 1, n )
1 2 3
4
(n , n , n - 1, n )
1 2 3
4
(n , n , n , n + 1)
1 2 3 4
(n , n , n , n - 1)
1 2 3 4
(n + 1, n - 1, n , n )
1
2
3 4
(n - 1, n + 1, n , n )
1
2
3 4
(n , n , n + 1, n - 1)
1 2 3
4
(n , n , n - 1, n + 1)
1 2 3
4
Transition rate
tr1
n1 r1
tr2
n 2 r2
tnr1
n 3 nr1
tnr2
n 4 nr2
n 2 mr2
n1 mr1
n 4 mnr2
n
3 mnr1
Where
hr1 + nr1, if (n1 + 1) * Brt1 + n 2 * Brt2 + n3 * Bnrt1 + n 4 * Bnrt2 < C - GC
tr1 =
, otherwise
hr1
1 671
Let
(n ,n ,n ,n )
1 2 3 4
the transition rate table we can obtain the balance equation of a state and using the
normalization
states can be computed, which can be used for obtaining the performance
parameters like blocking probability of new calls and dropping probability of
handoff calls.
RT1
RT2
NRT1
NRT1
RT1_chmod
RT2_chmod
NRT1_chmod
NRT2_chmod
New
calls
Handoff
calls
0.6 x
0.5 x
0.4 x
0.3 x
0.1 x
0
0.1 x
0
-
1/ sec
2.5
2
5
10
10
5
10
5
1 681
Where is defined as the service request parameter. The first column of Table-III
gives the different types of calls handled by the system. RT1and RT2 is the real
time calls with modulation type1 and type2 respectively. NRT1 and NRT2 denote
the non-real time calls with modulation type1 and type2 respectively. RT1_chmod
and RT_chmod denotes the modulation changed calls request of real time calls for
changing modulation from type1 to type 2 and from type 2 to type1, respectively.
NRT1_chmod and NRT2_chmod represent the modulation changed calls request
of non- real time calls for changing modulation from type1 to type 2 and from type
2 to type1, respectively.
For comparative study, simulations were performed for Fixed Guard
Channel (FGC) scheme and the Adaptive Guard Channel (AGC) scheme. Three
different cases of FGC was studied with GC=4, GC=8 and GC=16 respectively.
The simulation results are provided in figures 5.2 to 5.9.
1 691
1 601
1 7.1
1 721
1 731
probabilities are lower than the scheme with FGC and the dropping probabilities of
hand off calls are high but the increase in the dropping probabilities is not
significant. As the arrival rate increases the blocking probabilities of new calls
increases but the rate of increase is not so high compared to FGC scheme. In any
guard channel scheme the channel utilization is high for lower value of guard
channel and low for large guard channel. In the AGC scheme it is well managed
according to the traffic as observed from Fig 5.8. Fig 5.9 shows the variation of the
guard channel with traffic arrival rate. As expected the guard channel is small at
lower arrival rate and as the arrival rate increase the guard channel becomes larger
but its value is chosen according to GOS. Figs 5.6-5.7 show the blocking
probabilities of modulation changed calls of real time and non-real time calls
respectively. Since the modulation changed calls has the same priority with the
handoff calls the blocking probability of modulation changed calls follows the
same pattern as that of handoff calls dropping probability.
We can conclude that adaptive guard channel based CAC scheme is a proper way
of deciding the guard channel which otherwise is difficult in fixed guard channel
based CAC and useful to optimize scarce radio resources. The proposed model and
analysis can be a guide to configure AMC based wireless networks.
5.6 Summary
In a limited resource wireless network an efficient CAC scheme is necessary to
satisfy all the QoS parameters. In this chapter, a dynamic CAC scheme is proposed
which also considers the AMC induced call blocking at the CAC process. The
proposed CAC scheme is an adaptive guard channel scheme which takes in
consideration three types of call requests: new calls, handoff calls and modulation
changed calls. Simulation results show that the proposed scheme has not only
made the guard channel adaptive to the traffic arrival rates but also a fair tradeoff
can be obtained between blocking probability and dropping probability of the
different calls. We can conclude that adaptive guard channel based CAC scheme is
a proper way of deciding the guard channel which otherwise is difficult in fixed
guard channel based CAC and useful to optimize scarce radio resources. The
proposed model and analysis can be a guide to configure AMC based wireless
networks.
1 741
Chapter-6
Conc
Conclusion and FutureScopeof
W ork
1 751
Conclusion
Although IEEE 802.16 standard based WiMAX is one of the promising
solutions for bridging the digital divide and providing cost effective Broadband
wireless services. Any such architecture will be successful only if it is able to cater
services taking care of their various diverse QoS requirements. The standard
defines only the QoS requirements of different services but does not provide any
solution to guarantee these QoS parameters. In this thesis we have investigated and
proposed new schemes for providing QoS Guarantees at the connection level. The
problem is analyzed during the Call admission control stage. In the course of this
thesis we have proposed CAC mechanisms taking into consideration both the
service providers and the subscribers. We summarize the thesis as follows.
1 761
6.3
1 771
1
1
References
1 781
References
[1]
http://www.itu.int/ITU-D/imt-2000/documents/Yaounde2006/Presentations
[2]
[3]
Networks. Part
Metropolitan Area Networks Part 16: Air Interface for Fixed and Mobile
Broadband Wireless Access Systems Amendment 2: Physical and Medium
Access Control Layers for Combined Fixed and Mobile Operation in
Licensed Bands and Corrigendum 1, 2006, pp. 0_1822.
[5]
[6]
[11]
1 791
[13]
[14]
Journal of Communication Systems, vol. 16, issue 1, February 2003, pp. 8196.
[18]
Chi-Hong Jiang, Tzu-Chieh Tsai, Token Bucket Based CAC and Packet
Scheduling for IEEE 802.16 Broadband Wireless Access Networks,
Kalikivayi Suresh, Iti Saha Misra and Kalpana Saha Roy, Bandwidth and
Delay Guaranteed Connection Admission Control Scheme for QoS
Provisioning in IEEE 802.16e Mobile WiMAX, proc. IEEE GLOBECOM
2008.
1 701
[20]
[22]
[23]
[25]
[26]
1 8.1
[31]
Lee J., Kwon E., Yeon H.-J., Jung K., Markov Model for Admission
Control in the Wireless
Communications, 2006.
[32]
Noh, S.-K., Hwang, Y.-H., Ye, B.-H. and Kim, S.-H., New CAC
Algorithm using Adaptive Modulation Control, IFIP International
8th International Conference, vol.1, no., pp.6 pp.-418, 20-22 Feb. 2006
[34]
[35]
[36]
1 821
Appendix
1 831
A-I
MATLAB code ABD_CAC scheme proposed in chapter-3
%----------------------- PROGRAM1 -------------------------------%------------------------ABD_CAC---------------------------------% The following function calculates the total number of allowable
states,
% the state transition matrix and the steady state probability of
the
% allowable states for the proposed ABD_CAC mechanism.
% From the obtained steady state probabilities we can calculate
the
% Blocking Probabilities of all connections and Bandwidth
% Utilization of the System.
% Input
% BU = Bandwidth exclusively reserved for UGS connections.
% Here BU=0, Since not reservation based CAC scheme
%
%
%
%
Output
noofstates = number of allowable states for CAC1
s = State Transition Matrix of the allowable states
ssprob = Steady State Probabilities of the allowable states.
function [noofstates,s,ssprob]=ABD_CAC(BU)
%Initialization of Variables.
B=10240; %Total Bandwidth available at BS
f=0.001; %Frame Duration in (sec)
delay=0.021; %Maximum Delay experienced by rtPS connections (sec)
m=delay/f;
BUGS=256; %Amount of Bandwidth allocated for UGS calls (Kbps)
bRTPS=10.240; %Bucket size of rtPS connections (Kilobits)
BRTPSMAX=1024; %Max. Amount of Bandwidth allocated for RTPS calls
(Kbps)
BRTPSMIN=512; %Min. Amount of Bandwidth allocated for RTPS calls
(Kbps)
BNRTPSMAX=1024; %Maximum Amount of BW allocated for NRTPS calls
(Kbps)
BNRTPSMIN=512; %Minimum Amount of BW allocated for NRTPS calls
(Kbps)
BU=0;
%Calculation of Maximum Number of connections that can be admitted
% at the BS at any particular instant. These values are used as
%limits while calculating the total number of allowable states
nugsmax=(B/BUGS); %Max. no UGS calls that can be admitted
nrtpsmax=((B-BU)/BRTPSMIN); %Maximum number RTPS calls that can be
admitted
nnrtpsmax=((B-BU)/BNRTPSMIN); %Max. no NRTPS calls that can be
admitted
%----------------------------------------------------------------%Calculation of possible MARKOV States
noofstates=0;
for nnrtps=0:nnrtpsmax
1 841
for nrtps=0:nrtpsmax
for nugs=0:nugsmax
Bn=BNRTPSMAX;
Br=BRTPSMAX;
k=0;
%u=0;
%v=0;
%w=0;
%------------------------------------------------%Verify whether the current state is allowable
%without any degradation to rtPS and nrtPS calls.
%The following if condition checks for BW
%availability
if (nugs*BUGS+nrtps*BRTPSMAX+nnrtps*BNRTPSMAX<=B
CRTPS=(nrtps*BRTPSMAX);%BW required by rtPS
calls
CNRT=B-nugs*BUGS-CRTPS; %BW available for NRT
calls.
if CRTPS==0
%if no rtPS connections, no need of delay
guarantees
noofstates=noofstates+1;
state(noofstates).a=nugs;
state(noofstates).b=nrtps;
state(noofstates).c=Br;%bandwidth
%availaible after degradation of rtps connections
state(noofstates).d=nnrtps;
state(noofstates).e=Bn;%bandwidth
%availaible after degradation of nrtps connections
else %Check for delay guarantees
if bRTPS <= ((m-1)*(1+CNRT/CRTPS)-1)*BRTPSMAX*f
noofstates=noofstates+1;
state(noofstates).a=nugs;
state(noofstates).b=nrtps;
state(noofstates).c=Br;
state(noofstates).d=nnrtps;
state(noofstates).e=Bn;
else
%norejected=norejected+1;
state1(norejected).x=nugs;
state1(norejected).y=nrtps;
state1(norejected).z=nnrtps;
end
end
%------------------------------------------------%------------------------------------------------%First Degrade the admitted nrtPS connections until the
%the BW and delay guarantees are satisfied or max
%degradation step is reached. If max degradation step
%is reached without satsfying BW and delay
%guarantees degrade the rtPS calls, until the BW and
%delay guarantees are satisfied or max degradation step
%is reached.If max degradation step is reached without
%satsfying BW and delay guarantees the current state is
%not the allowable Markov state
else
%The following If statements check if there are either
% nrtPS or rtPS calls then only degradation is possible
if (nnrtps>0)|(nrtps>0)
if nnrtps>0
1 851
1 861
noofstates=noofstates+1;
state(noofstates).a=nugs;
state(noofstates).b=nrtps;
state(noofstates).c=Br;
state(noofstates).d=nnrtps;
state(noofstates).e=Bn;
end
end
end
%----------end of degradation of rtPS calls
end
end
%--------------------------------------------------------end
end
end
for p=1:noofstates
s(p,1)=state(p).a;
s(p,2)=state(p).b;
s(p,3)=state(p).c;
s(p,4)=state(p).d;
s(p,5)=state(p).e;
end
for p=1:norejected
s1(p,1)=state1(p).x;
s1(p,2)=state1(p).y;
s1(p,2)=state1(p).z;
end
%End of obtaining possible Markov States
%----------------------------------------------------------------%To calculate steady state balance equations from the given
possible states
%of a markov chain s
%x represents the coefficient matrix of the steady state balance
equations
b=1;
for eta=1:1:10 %eta is the service request parameter
%Calculate SS probabilities for different arrival rates
lambdaugs=0.4*eta; %arrival rate of UGS calls entering a BS
lambdartps=0.3*eta; %arrival rate of RTPS calls entering a BS
lambdanrtps=0.2*eta; %arrival rate of NRTPS calls entering a BS
muugs=0.1; %the mean service time of a UGS call
murtps=0.2; %the mean service time of a RTPS call
munrtps=0.5; %the mean service time of a NRTPS call
lambdatotal=lambdaugs+lambdartps+lambdanrtps;
%------------------------------------------------------------------------%Calculation of state balance equations
for i=1:noofstates
for j=1:noofstates
if i == j
if s(i,1)==0&s(i,2)==0&s(i,4)==0
x(i,j)=lambdatotal;
elseif s(i,1)==0&s(i,2)==0
x(i,j)=0;
1 871
c=0;
d=0;
e=0;
g=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)&s(i,2)==s(k,2)&
s(i,4)==s(k,4)&c==0)
if
(s(k,1)*BUGS+s(k,2)*BRTPSMAX+s(k,4)*BNRTPSMIN<=B)
x(i,j)=x(i,j)+lambdaugs;
else
x(i,j)=x(i,j)+lambdaugs/2;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)& s(i,4)==s(k,4)&d==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+s(k,4)*BNRTPSMIN<=B-BU)
x(i,j)=x(i,j)+lambdartps;
else
x(i,j)=x(i,j)+lambdaugs/2;
end
d=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)& (s(i,4)+1)==s(k,4)&e==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+ s(k,4)*BNRTPSMAX<=B-BU)
x(i,j)=x(i,j)+lambdanrtps;
else
x(i,j)=x(i,j)+lambdanrtps/2;
end
e=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)& (s(i,4)-1)==s(k,4)&g==0)
x(i,j)=x(i,j)+s(i,4)*munrtps;
g=1;
end
if (c==1&d==1&e==1&g==1)
break;
end
end
elseif s(i,1)==0&s(i,4)==0
x(i,j)=0;
g=0;
c=0;
d=0;
e=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)&s(i,2)==s(k,2)& s(i,4)==s(k,4)&c==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+ s(k,4)*BNRTPSMIN<=B)
x(i,j)=x(i,j)+lambdaugs;
else
x(i,j)=x(i,j)+lambdaugs/2;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)& s(i,4)==s(k,4)&d==0)
1 881
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+ s(k,4)*BNRTPSMIN<=B-BU)
x(i,j)=x(i,j)+lambdartps;
else
x(i,j)=x(i,j)+lambdartps/2;
end
d=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)& (s(i,4)+1)==s(k,4)&e==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+s(k,4)*BNRTPSMAX<=B-BU)
x(i,j)=x(i,j)+lambdanrtps;
else
x(i,j)=x(i,j)+lambdanrtps/2;
end
e=1;
end
if (s(i,1)==s(k,1)&(s(i,2)-1)==s(k,2)& s(i,4)==s(k,4)&g==0)
x(i,j)=x(i,j)+s(i,2)*murtps;
g=1;
end
if (c==1&d==1&e==1&g==1)
break;
end
end
elseif s(i,2)==0&s(i,4)==0
x(i,j)=0;
g=0;
c=0;
d=0;
e=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)&s(i,2)==s(k,2)& s(i,4)==s(k,4)&c==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+ s(k,4)*BNRTPSMIN<=B)
x(i,j)=x(i,j)+lambdaugs;
else
x(i,j)=x(i,j)+lambdaugs/2;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)& s(i,4)==s(k,4)&d==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+ s(k,4)*BNRTPSMIN<=B-BU)
x(i,j)=x(i,j)+lambdartps;
else
x(i,j)=x(i,j)+lambdartps/2;
end
d=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)& (s(i,4)+1)==s(k,4)&e==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+s(k,4)*BNRTPSMAX<=B-BU)
x(i,j)=x(i,j)+lambdanrtps;
else
x(i,j)=x(i,j)+lambdanrtps/2;
end
e=1;
end
if ((s(i,1)-1)==s(k,1)&s(i,2)==s(k,2)& s(i,4)==s(k,4)&g==0)
1 891
x(i,j)=x(i,j)+s(i,1)*muugs;
g=1;
end
if (c==1&d==1&e==1&g==1)
break;
end
end
elseif s(i,1)==0
x(i,j)=0;
g=0;
h=0;
c=0;
d=0;
e=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)&s(i,2)==s(k,2)& s(i,4)==s(k,4)&c==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+ s(k,4)*BNRTPSMIN<=B)
x(i,j)=x(i,j)+lambdaugs;
else
x(i,j)=x(i,j)+lambdaugs/2;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)& s(i,4)==s(k,4)&d==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+ s(k,4)*BNRTPSMIN<=B-BU)
x(i,j)=x(i,j)+lambdartps;
else
x(i,j)=x(i,j)+lambdartps/2;
end
d=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&(s(i,4)+1)==s(k,4)&e==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+s(k,4)*BNRTPSMAX<=B-BU)
x(i,j)=x(i,j)+lambdanrtps;
else
x(i,j)=x(i,j)+lambdanrtps/2;
end
e=1;
end
if (s(i,1)==s(k,1)&(s(i,2)-1)==s(k,2)&s(i,4)==s(k,4)&g==0)
x(i,j)=x(i,j)+s(i,2)*murtps;
g=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)& (s(i,4)-1)==s(k,4)&h==0)
x(i,j)=x(i,j)+s(i,4)*munrtps;
h=1;
end
if (c==1&d==1&e==1&g==1&h==1)
break;
end
end
elseif s(i,2)==0
x(i,j)=0;
g=0;
h=0;
c=0;
1 801
d=0;
e=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)&s(i,2)==s(k,2)& s(i,4)==s(k,4)&c==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+s(k,4)*BNRTPSMIN<=B)
x(i,j)=x(i,j)+lambdaugs;
else
x(i,j)=x(i,j)+lambdaugs/2;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)& s(i,4)==s(k,4)&d==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+s(k,4)*BNRTPSMIN<=B-BU)
x(i,j)=x(i,j)+lambdartps;
else
x(i,j)=x(i,j)+lambdartps/2;
end
d=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&(s(i,4)+1)==s(k,4)&e==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+s(k,4)*BNRTPSMAX<=B-BU)
x(i,j)=x(i,j)+lambdanrtps;
else
x(i,j)=x(i,j)+lambdanrtps/2;
end
e=1;
end
if ((s(i,1)-1)==s(k,1)&s(i,2)==s(k,2)& s(i,4)==s(k,4)&g==0)
x(i,j)=x(i,j)+s(i,1)*muugs;
g=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)& (s(i,4)-1)==s(k,4)&h==0)
x(i,j)=x(i,j)+s(i,4)*munrtps;
h=1;
end
if (c==1&d==1&e==1&g==1&h==1)
break;
end
end
elseif s(i,4)==0
x(i,j)=0;
g=0;
h=0;
c=0;
d=0;
e=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)& s(i,2)==s(k,2)& s(i,4)==s(k,4)&c==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+s(k,4)*BNRTPSMIN<=B)
x(i,j)=x(i,j)+lambdaugs;
else
x(i,j)=x(i,j)+lambdaugs/2;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)& s(i,4)==s(k,4)&d==0)
1 9.1
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+ s(k,4)*BNRTPSMIN<=B-BU)
x(i,j)=x(i,j)+lambdartps;
else
x(i,j)=x(i,j)+lambdartps/2;
end
d=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)& (s(i,4)+1)==s(k,4)&e==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+ s(k,4)*BNRTPSMAX<=B-BU)
x(i,j)=x(i,j)+lambdanrtps;
else
x(i,j)=x(i,j)+lambdanrtps/2;
end
e=1;
end
if (s(i,1)==s(k,1)&(s(i,2)-1)==s(k,2)& s(i,4)==s(k,4)&h==0)
x(i,j)=x(i,j)+s(i,2)*murtps;
h=1;
end
if ((s(i,1)-1)==s(k,1)&s(i,2)==s(k,2)& s(i,4)==s(k,4)&g==0)
x(i,j)=x(i,j)+s(i,1)*muugs;
g=1;
end
if (c==1&d==1&e==1&g==1&h==1)
break;
end
end
else
x(i,j)=0;
g=0;
h=0;
o=0;
c=0;
d=0;
e=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)&s(i,2)==s(k,2)& s(i,4)==s(k,4)&c==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+s(k,4)*BNRTPSMIN<=B)
x(i,j)=x(i,j)+lambdaugs;
else
x(i,j)=x(i,j)+lambdaugs/2;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)& s(i,4)==s(k,4)&d==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+s(k,4)*BNRTPSMIN<=B-BU)
x(i,j)=x(i,j)+lambdartps;
else
x(i,j)=x(i,j)+lambdartps/2;
end
d=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&(s(i,4)+1)==s(k,4)&e==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+s(k,4)*BNRTPSMAX<=B-BU)
x(i,j)=x(i,j)+lambdanrtps;
1 921
else
x(i,j)=x(i,j)+lambdanrtps/2;
end
e=1;
end
if ((s(i,1)-1)==s(k,1)&s(i,2)==s(k,2)& s(i,4)==s(k,4)&g==0)
x(i,j)=x(i,j)+s(i,1)*muugs;
g=1;
end
if (s(i,1)==s(k,1)&(s(i,2)-1)==s(k,2)& s(i,4)==s(k,4)&h==0)
x(i,j)=x(i,j)+s(i,2)*murtps;
h=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&(s(i,4)-1)==s(k,4)&o==0)
x(i,j)=x(i,j)+s(i,4)*munrtps;
o=1;
end
if (c==1&d==1&e==1&g==1&h==1&o==1)
break;
end
end
end
else
if s(i,1)==(s(j,1)+1)&(s(i,2)==s(j,2))&(s(i,4)==s(j,4))
if (s(i,1)*BUGS+s(i,2)*BRTPSMAX+s(i,4)*BNRTPSMIN<=B)
x(i,j)=-lambdaugs;
else
x(i,j)=-lambdaugs/2;
end
elseif s(i,1)==s(j,1)&s(i,2)==(s(j,2)+1)&s(i,4)==s(j,4)
if (s(i,1)*BUGS+s(i,2)*BRTPSMAX+s(i,4)*BNRTPSMIN<=B-BU)
x(i,j)=-lambdartps;
else
x(i,j)=-lambdartps/2;
end
elseif s(i,1)==s(j,1)&s(i,2)==s(j,2)&(s(i,4)==s(j,4)+1)
if (s(i,1)*BUGS+s(i,2)*BRTPSMAX+s(i,4)*BNRTPSMAX<=B-BU)
x(i,j)=-lambdanrtps;
else
x(i,j)=-lambdanrtps/2;
end
elseif s(i,1)==(s(j,1)-1)&s(i,2)==s(j,2)&s(i,4)==s(j,4)
x(i,j)=-s(j,1)*muugs;
elseif s(i,1)==s(j,1)&(s(i,2)==s(j,2)-1)&s(i,4)==s(j,4)
x(i,j)=-s(j,2)*murtps;
elseif s(i,1)==s(j,1)&s(i,2)==s(j,2)&(s(i,4)==s(j,4)-1)
x(i,j)=-s(j,4)*munrtps;
else
x(i,j)=0;
continue;
end
end
end
end
%End of calculation of State balance Equations
%----------------------------------------------------------------%Calculation of steady state probabilities from steady state
equation
for i=1:noofstates
1 931
1 941
[noofstates,s,ssprob]=ABD_CAC(BU);
%Calculation of Blocking Probabilities of the Service Flows and
the
%Bandwidth Utilization of the system.
%Initiaslization
for j=1:10%j:Total arrival rate of the Service Flows.
BP_UGS(j)=0;%Blocking Probability of UGS calls
DP_UGS(j)=0;%Dropping Probability of UGS calls
BP_RTPS(j)=0;%Blocking Probability of rtPS calls
DP_RTPS(j)=0;%Dropping Probability of rtPS calls
BP_NRTPS(j)=0;%Blocking Probability of nrtPS calls
DP_NRTPS(j)=0;%Dropping Probability of nrtPS calls
BW_UTLN(j)=0;%Bandwidth Utilization of the system
avg_rev_ugs(j)=0;
avg_rev_rtps(j)=0;
avg_rev_nrtps(j)=0;
end
avg_brtps=0;
avg_bnrtps=0;
for j=1:10
for i=1:noofstates
if (s(i,1)+1)*BUGS+s(i,2)*BRTPSMAX+s(i,4)*BNRTPSMIN > B
BP_UGS(j)=BP_UGS(j)+ssprob(i,j);
end
if (s(i,1)+1)*BUGS+s(i,2)*BRTPSMIN+s(i,4)*BNRTPSMIN > B
DP_UGS(j)=DP_UGS(j)+ssprob(i,j);
end
if s(i,1)*BUGS+(s(i,2)+1)*s(i,3)+s(i,4)*s(i,5) > B-BU
BP_RTPS(j)=BP_RTPS(j)+ssprob(i,j);
end
if s(i,1)*BUGS+(s(i,2)+1)*BRTPSMIN+s(i,4)*BNRTPSMIN > B-BU
DP_RTPS(j)=DP_RTPS(j)+ssprob(i,j);
end
if s(i,1)*BUGS+s(i,2)*s(i,3)+(s(i,4)+1)*s(i,5) > B-BU
BP_NRTPS(j)=BP_NRTPS(j)+ssprob(i,j);
end
if s(i,1)*BUGS+s(i,2)*BRTPSMIN+(s(i,4)+1)*BNRTPSMIN > B-BU
DP_NRTPS(j)=DP_NRTPS(j)+ssprob(i,j);
end
avg_rev_ugs(j)=avg_rev_ugs(j)+rer_ugs*s(i,1)*BUGS*ssprob(i,j);
avg_rev_rtps(j)=avg_rev_rtps(j)+rer_rtps*s(i,2)*s(i,3)*ssprob(i,j;
avg_rev_nrtps(j)=avg_rev_nrtps(j)+rer_nrtps*s(i,4)*s(i,5)*
ssprob(i,j);
BW_UTLN(j)=BW_UTLN(j)+(s(i,1)*BUGS+s(i,2)*s(i,3)+
s(i,4)*s(i,5))*ssprob(i,j);
end
BW_UTLN(j)=BW_UTLN(j)/B;
end
for i=1:noofstates
avg_brtps=avg_brtps+s(i,3);
avg_bnrtps=avg_bnrtps+s(i,5);
end
avg_brtps=avg_brtps/noofstates;
avg_bnrtps=avg_bnrtps/noofstates;
1 951
1 961
A-II
MATLAB code ABD_CAC scheme with acceptable trade off between new call
blocking probability and handoff call dropping probability proposed in chapter-4.
1 971
else
x(i,j)=x(i,j)+lambdaugs/2;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)&
s(i,4)==s(k,4)&d==0)
if (s(k,1)*BUGS+s(k,2)*(BRTPSMAXcth(z))+s(k,4)*(BNRTPSMAX-cth(z))<=B-BU)
x(i,j)=x(i,j)+lambdartps;
else
x(i,j)=x(i,j)+lambdartps/2;
end
d=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
(s(i,4)+1)==s(k,4)&e==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+
s(k,4)*(BNRTPSMAX-cth(z))<=B-BU)
x(i,j)=x(i,j)+lambdanrtps;
else
x(i,j)=x(i,j)+lambdanrtps/2;
end
e=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
(s(i,4)-1)==s(k,4)&g==0)
x(i,j)=x(i,j)+s(i,4)*munrtps;
g=1;
end
if (c==1&d==1&e==1&g==1)
break;
end
end
elseif s(i,1)==0&s(i,4)==0
x(i,j)=0;
g=0;
c=0;
d=0;
e=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)&s(i,2)==s(k,2)&
s(i,4)==s(k,4)&c==0)
if (s(k,1)*BUGS+s(k,2)*(BRTPSMAXcth(z))+ s(k,4)*BNRTPSMIN<=B)
x(i,j)=x(i,j)+lambdaugs;
else
x(i,j)=x(i,j)+lambdaugs/2;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)&
s(i,4)==s(k,4)&d==0)
if (s(k,1)*BUGS+s(k,2)*(BRTPSMAXcth(z))+ s(k,4)*(BNRTPSMAX-cth(z))<=B-BU)
1 981
x(i,j)=x(i,j)+lambdartps;
else
x(i,j)=x(i,j)+lambdartps/2;
end
d=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
(s(i,4)+1)==s(k,4)&e==0)
if
(s(k,1)*BUGS+s(k,2)*BRTPSMAX+s(k,4)*(BNRTPSMAX-cth(z))<=B-BU)
x(i,j)=x(i,j)+lambdanrtps;
else
x(i,j)=x(i,j)+lambdanrtps/2;
end
e=1;
end
if (s(i,1)==s(k,1)&(s(i,2)-1)==s(k,2)&
s(i,4)==s(k,4)&g==0)
x(i,j)=x(i,j)+s(i,2)*murtps;
g=1;
end
if (c==1&d==1&e==1&g==1)
break;
end
end
elseif s(i,2)==0&s(i,4)==0
x(i,j)=0;
g=0;
c=0;
d=0;
e=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)&s(i,2)==s(k,2)&
s(i,4)==s(k,4)&c==0)
if (s(k,1)*BUGS+s(k,2)*(BRTPSMAXcth(z))+ s(k,4)*BNRTPSMIN<=B)
x(i,j)=x(i,j)+lambdaugs;
else
x(i,j)=x(i,j)+lambdaugs/2;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)&
s(i,4)==s(k,4)&d==0)
if (s(k,1)*BUGS+s(k,2)*(BRTPSMAXcth(z))+ s(k,4)*(BNRTPSMAX-cth(z))<=B-BU)
x(i,j)=x(i,j)+lambdartps;
else
x(i,j)=x(i,j)+lambdartps/2;
end
d=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
(s(i,4)+1)==s(k,4)&e==0)
if
(s(k,1)*BUGS+s(k,2)*BRTPSMAX+s(k,4)*(BNRTPSMAX-cth(z))<=B-BU)
1 991
x(i,j)=x(i,j)+lambdanrtps;
else
x(i,j)=x(i,j)+lambdanrtps/2;
end
e=1;
end
if ((s(i,1)-1)==s(k,1)&s(i,2)==s(k,2)&
s(i,4)==s(k,4)&g==0)
x(i,j)=x(i,j)+s(i,1)*muugs;
g=1;
end
if (c==1&d==1&e==1&g==1)
break;
end
end
elseif s(i,1)==0
x(i,j)=0;
g=0;
h=0;
c=0;
d=0;
e=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)&s(i,2)==s(k,2)&
s(i,4)==s(k,4)&c==0)
if (s(k,1)*BUGS+s(k,2)*(BRTPSMAXcth(z))+ s(k,4)*BNRTPSMIN<=B)
x(i,j)=x(i,j)+lambdaugs;
else
x(i,j)=x(i,j)+lambdaugs/2;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)&
s(i,4)==s(k,4)&d==0)
if (s(k,1)*BUGS+s(k,2)*(BRTPSMAXcth(z))+ s(k,4)*(BNRTPSMAX-cth(z))<=B-BU)
x(i,j)=x(i,j)+lambdartps;
else
x(i,j)=x(i,j)+lambdartps/2;
end
d=1;
end
if
(s(i,1)==s(k,1)&s(i,2)==s(k,2)&(s(i,4)+1)==s(k,4)&e==0)
if
(s(k,1)*BUGS+s(k,2)*BRTPSMAX+s(k,4)*(BNRTPSMAX-cth(z))<=B-BU)
x(i,j)=x(i,j)+lambdanrtps;
else
x(i,j)=x(i,j)+lambdanrtps/2;
end
e=1;
end
if (s(i,1)==s(k,1)&(s(i,2)1)==s(k,2)&s(i,4)==s(k,4)&g==0)
x(i,j)=x(i,j)+s(i,2)*murtps;
1 901
g=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
(s(i,4)-1)==s(k,4)&h==0)
x(i,j)=x(i,j)+s(i,4)*munrtps;
h=1;
end
if (c==1&d==1&e==1&g==1&h==1)
break;
end
end
elseif s(i,2)==0
x(i,j)=0;
g=0;
h=0;
c=0;
d=0;
e=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)&s(i,2)==s(k,2)&
s(i,4)==s(k,4)&c==0)
if (s(k,1)*BUGS+s(k,2)*(BRTPSMAXcth(z))+s(k,4)*BNRTPSMIN<=B)
x(i,j)=x(i,j)+lambdaugs;
else
x(i,j)=x(i,j)+lambdaugs/2;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)&
s(i,4)==s(k,4)&d==0)
if (s(k,1)*BUGS+s(k,2)*(BRTPSMAXcth(z))+s(k,4)*(BNRTPSMAX-cth(z))<=B-BU)
x(i,j)=x(i,j)+lambdartps;
else
x(i,j)=x(i,j)+lambdartps/2;
end
d=1;
end
if
(s(i,1)==s(k,1)&s(i,2)==s(k,2)&(s(i,4)+1)==s(k,4)&e==0)
if
(s(k,1)*BUGS+s(k,2)*BRTPSMAX+s(k,4)*(BNRTPSMAX-cth(z))<=B-BU)
x(i,j)=x(i,j)+lambdanrtps;
else
x(i,j)=x(i,j)+lambdanrtps/2;
end
e=1;
end
if ((s(i,1)-1)==s(k,1)&s(i,2)==s(k,2)&
s(i,4)==s(k,4)&g==0)
x(i,j)=x(i,j)+s(i,1)*muugs;
g=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
(s(i,4)-1)==s(k,4)&h==0)
x(i,j)=x(i,j)+s(i,4)*munrtps;
1 0.1
h=1;
end
if (c==1&d==1&e==1&g==1&h==1)
break;
end
end
elseif s(i,4)==0
x(i,j)=0;
g=0;
h=0;
c=0;
d=0;
e=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)& s(i,2)==s(k,2)&
s(i,4)==s(k,4)&c==0)
if (s(k,1)*BUGS+s(k,2)*(BRTPSMAXcth(z))+s(k,4)*BNRTPSMIN<=B)
x(i,j)=x(i,j)+lambdaugs;
else
x(i,j)=x(i,j)+lambdaugs/2;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)&
s(i,4)==s(k,4)&d==0)
if (s(k,1)*BUGS+s(k,2)*(BRTPSMAXcth(z))+ s(k,4)*(BNRTPSMAX-cth(z))<=B-BU)
x(i,j)=x(i,j)+lambdartps;
else
x(i,j)=x(i,j)+lambdartps/2;
end
d=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
(s(i,4)+1)==s(k,4)&e==0)
if (s(k,1)*BUGS+s(k,2)*BRTPSMAX+
s(k,4)*(BNRTPSMAX-cth(z))<=B-BU)
x(i,j)=x(i,j)+lambdanrtps;
else
x(i,j)=x(i,j)+lambdanrtps/2;
end
e=1;
end
if (s(i,1)==s(k,1)&(s(i,2)-1)==s(k,2)&
s(i,4)==s(k,4)&h==0)
x(i,j)=x(i,j)+s(i,2)*murtps;
h=1;
end
if ((s(i,1)-1)==s(k,1)&s(i,2)==s(k,2)&
s(i,4)==s(k,4)&g==0)
x(i,j)=x(i,j)+s(i,1)*muugs;
g=1;
end
if (c==1&d==1&e==1&g==1&h==1)
break;
1 021
end
end
else
x(i,j)=0;
g=0;
h=0;
o=0;
c=0;
d=0;
e=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)&s(i,2)==s(k,2)&
s(i,4)==s(k,4)&c==0)
if (s(k,1)*BUGS+s(k,2)*(BRTPSMAXcth(z))+s(k,4)*BNRTPSMIN<=B)
x(i,j)=x(i,j)+lambdaugs;
else
x(i,j)=x(i,j)+lambdaugs/2;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)&
s(i,4)==s(k,4)&d==0)
if (s(k,1)*BUGS+s(k,2)*(BRTPSMAXcth(z))+s(k,4)*(BNRTPSMAX-cth(z))<=B-BU)
x(i,j)=x(i,j)+lambdartps;
else
x(i,j)=x(i,j)+lambdartps/2;
end
d=1;
end
if
(s(i,1)==s(k,1)&s(i,2)==s(k,2)&(s(i,4)+1)==s(k,4)&e==0)
if
(s(k,1)*BUGS+s(k,2)*BRTPSMAX+s(k,4)*(BNRTPSMAX-cth(z))<=B-BU)
x(i,j)=x(i,j)+lambdanrtps;
else
x(i,j)=x(i,j)+lambdanrtps/2;
end
e=1;
end
if ((s(i,1)-1)==s(k,1)&s(i,2)==s(k,2)&
s(i,4)==s(k,4)&g==0)
x(i,j)=x(i,j)+s(i,1)*muugs;
g=1;
end
if (s(i,1)==s(k,1)&(s(i,2)-1)==s(k,2)&
s(i,4)==s(k,4)&h==0)
x(i,j)=x(i,j)+s(i,2)*murtps;
h=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&(s(i,4)1)==s(k,4)&o==0)
x(i,j)=x(i,j)+s(i,4)*munrtps;
o=1;
end
if (c==1&d==1&e==1&g==1&h==1&o==1)
break;
end
1 031
end
end
else
if
s(i,1)==(s(j,1)+1)&(s(i,2)==s(j,2))&(s(i,4)==s(j,4))
if (s(i,1)*BUGS+s(i,2)*(BRTPSMAXcth(z))+s(i,4)*BNRTPSMIN<=B)
x(i,j)=-lambdaugs;
else
x(i,j)=-lambdaugs/2;
end
elseif
s(i,1)==s(j,1)&s(i,2)==(s(j,2)+1)&s(i,4)==s(j,4)
if (s(i,1)*BUGS+s(i,2)*(BRTPSMAXcth(z))+s(i,4)*(BNRTPSMAX-cth(z))<=B-BU)
x(i,j)=-lambdartps;
else
x(i,j)=-lambdartps/2;
end
elseif
s(i,1)==s(j,1)&s(i,2)==s(j,2)&(s(i,4)==s(j,4)+1)
if (s(i,1)*BUGS+s(i,2)*BRTPSMAX+s(i,4)*(BNRTPSMAXcth(z))<=B-BU)
x(i,j)=-lambdanrtps;
else
x(i,j)=-lambdanrtps/2;
end
elseif s(i,1)==(s(j,1)1)&s(i,2)==s(j,2)&s(i,4)==s(j,4)
x(i,j)=-s(j,1)*muugs;
elseif s(i,1)==s(j,1)&(s(i,2)==s(j,2)1)&s(i,4)==s(j,4)
x(i,j)=-s(j,2)*murtps;
elseif s(i,1)==s(j,1)&s(i,2)==s(j,2)&(s(i,4)==s(j,4)1)
x(i,j)=-s(j,4)*munrtps;
else
x(i,j)=0;
continue;
end
end
end
end
%End of calculation of State balance Equations
%------------------------------------------------------------------------%Calculation of steady state probabilities from steady state
equation
for i=1:noofstates
%As the ss equations are dependent, any one of the ss equation is
replaced
%by the normalized equation i.e sum of all ss probabilities is
equal to one
x(1,i)=1;
end
y=zeros(1,noofstates);
%y represents the rhs column vector of the ss equations
y(1)=1;
y=y';
1 041
ssprob=zeros(noofstates,1);
%calculation of steady state probabilities
ssprob(:,b)=x\y;
%b=b+1;
%end
%End of Calculation of SS probabilities of the allowable Markov
States for different arrival rates.
%----------------------------END OF PROGRAM----------------------j=1;% arrival rates
%for =1:6
BP_UGS(z)=0;%Blocking Probability of UGS calls
DP_UGS(z)=0;%Dropping Probability of UGS calls
BP_RTPS(z)=0;%Blocking Probability of rtPS calls
DP_RTPS(z)=0;%Dropping Probability of rtPS calls
BP_NRTPS(z)=0;%Blocking Probability of nrtPS calls
DP_NRTPS(z)=0;%Dropping Probability of nrtPS calls
BW_UTLN(z)=0;%Bandwidth Utilization of the system
%end
%end
%for j=1:10
for i=1:noofstates
if (s(i,1)+1)*BUGS+s(i,2)*(BRTPSMAX-cth(z))+s(i,4)*BNRTPSMIN > B
BP_UGS(z)=BP_UGS(z)+ssprob(i,j);
end
if (s(i,1)+1)*BUGS+s(i,2)*BRTPSMIN+s(i,4)*BNRTPSMIN > B
DP_UGS(z)=DP_UGS(z)+ssprob(i,j);
end
if s(i,1)*BUGS+(s(i,2)+1)*(BRTPSMAX-cth(z))+s(i,4)*(BNRTPSMAXcth(z)) > B-BU
BP_RTPS(z)=BP_RTPS(z)+ssprob(i,j);
end
if s(i,1)*BUGS+(s(i,2)+1)*BRTPSMIN+s(i,4)*BNRTPSMIN > B-BU
DP_RTPS(z)=DP_RTPS(z)+ssprob(i,j);
end
if s(i,1)*BUGS+s(i,2)*BRTPSMAX+(s(i,4)+1)*(BNRTPSMAXcth(z)) > B-BU
BP_NRTPS(z)=BP_NRTPS(z)+ssprob(i,j);
end
if s(i,1)*BUGS+s(i,2)*BRTPSMIN+(s(i,4)+1)*BNRTPSMIN > B-BU
DP_NRTPS(z)=DP_NRTPS(z)+ssprob(i,j);
end
BW_UTLN(z)=BW_UTLN(z)+(s(i,1)*BUGS+s(i,2)*s(i,3)+
s(i,4)*s(i,5))*ssprob(i,j);
end
BW_UTLN(z)=BW_UTLN(z)/B;
%end
% calculation of grade of service (GOS) for different services
beta=10;
w1=0.7;w2=0.2;w3=0.1;
gosu(z)=BP_UGS(z)+beta*DP_UGS(z);
gosr(z)=BP_RTPS(z)+beta*DP_RTPS(z);
gosn(z)=BP_NRTPS(z)+beta*BP_NRTPS(z);
%end of calculation of grade of service(GOS)
%Calculation of Cost function(CF)
1 051
cf(z)=w1*gosu(z)+w2*gosr(z)+w3*gosn(z);
% end of calculation of CF
end
minimum=min(cf)
location=find(cf==minimum)
BP_UGS1=BP_UGS(location)
DP_UGS1=DP_UGS(location)
BP_RTPS1=BP_RTPS(location)
DP_RTPS1=DP_RTPS(location)
BP_NRTPS1=BP_NRTPS(location)
DP_NRTPS1=DP_NRTPS(location)
BW_UTLN1=BW_UTLN(location)
cth1=cth(location)
toc
% End of PROGRAM 3%
1 061
A-III
MATLAB code for AGC_CAC scheme proposed in chapter-5
%----------------------PROGRAM 4 --------------------%
clear all;
clc
tic
% matlab code for CAC model of IEEE 802.16e using AMC system
% The model is setup using markov chain
% The state of the markov chain has two elements
% n1=no. of users using modulation type 1
% n2=no. of users using modulation type 2
B=32;% Channel capacity consisting of 64 blocks of time slots
brt1=2;% no. of blocks required for real time calls with
modulation type 1 QPSK
brt2=1;% no. of blocks required for real time calls with
modulation type 2 16-QAM
bnrt1=4;% no. of blocks required for non-real time calls with
modulation type 1 QPSK
bnrt2=2;% no. of blocks required for non real time calls with
modulation type 2 16-QAM
max_rt1=B/brt1;% maximum no. of calls that can be admitted for
real time calls with modulation type 1
max_rt2=B/brt2; % maximum no. of class that can be admitted for
real time calls with modulation type 2
max_nrt1=B/bnrt1;% maximum no. of calls that can be admitted for
non real time calls with modulation type 1
max_nrt2=B/bnrt2;% maximum no. of calls that can be admitted for
non real time calls with modulation type 2
%...........................................
% calculation of no of possible states
%............................................
noofstates=0;
for nnrt2=0:max_nrt2
for nnrt1=0:max_nrt1
for nrt2=0:max_rt2
for nrt1=0:max_rt1
if(brt1*nrt1+brt2*nrt2+bnrt1*nnrt1+
bnrt2*nnrt2 <= B)
noofstates=noofstates+1;
state(noofstates).a=nrt1;
state(noofstates).b=nrt2;
state(noofstates).c=nnrt1;
state(noofstates).d=nnrt2;
end
end
end
1 071
end
end
for p=1:noofstates
s(p,1)=state(p).a;
s(p,2)=state(p).b;
s(p,3)=state(p).c;
s(p,4)=state(p).d;
end
%.................................................................
........
%end of calculation of possible states
%.................................................................
........
% Parameters used for calculating the steady state probabilities
%...............................................................
b=1;
for GC=1:16
rho=10;%rho varies from 1 to 10
lamda_rt1=0.6*rho;
lamda_rth1=0.1*rho;
lamdatotal_rt1=lamda_rt1+lamda_rth1;
lamda_rt2=0.5*rho;
lamda_rth2=0;
lamdatotal_rt2=lamda_rt2+lamda_rth2;
mu_rt1=0.4;
mu_rt2=0.5;
mu_chmod_rt1=0.1;
mu_chmod_rt2=0.2;
lamdatotal_rt=lamdatotal_rt1+lamdatotal_rt2;
%.........................................................
lamda_nrt1=0.4*rho;
lamda_nrth1=0.1*rho;
lamdatotal_nrt1=lamda_nrt1+lamda_nrth1;
lamda_nrt2=0.3*rho;
lamda_nrth2=0;
lamdatotal_nrt2=lamda_nrt2+lamda_nrth2;
mu_nrt1=0.2;
mu_nrt2=0.1;
mu_chmod_nrt1=0.1;
mu_chmod_nrt2=0.2;
lamdatotal_nrt=lamdatotal_nrt1+lamdatotal_nrt2;
%.................................................................
........
lamdatotal=lamdatotal_rt+lamdatotal_nrt;
% Calculation of steady state probability
%.................................................................
.......
%------------------------------------------------------------------------%Calculation of state balance equations
for i=1:noofstates
for j=1:noofstates
if i == j
if s(i,1)==0 & s(i,2)==0 & s(i,3)==0 & s(i,4)
x(i,j)=lamdatotal;
elseif s(i,1)==0 & s(i,2)==0 & s(i,3)==0
x(i,j)=0;
c=0;
1 081
d=0;
e=0;
g=0;
c1=0;
d1=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1) & s(i,2)==s(k,2) &
s(i,3)==s(k,3) & s(i,3)==s(k,4) & c==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt1;
else
x(i,j)=x(i,j)+lamda_rth1;
end
c=1;
end
if (s(i,1)==s(k,1) & (s(i,2)+1)==s(k,2) &
s(i,3)==s(k,3) & s(i,4)==s(k,4) & d==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt2;
else
x(i,j)=x(i,j)+lamda_rth2;
end
d=1;
end
if (s(i,1)==s(k,1) & s(i,2)==s(k,2) &
(s(i,3)+1)==s(k,3)& s(i,4)==s(k,4) & e==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt1;
else
x(i,j)=x(i,j)+lamda_nrth1;
end
e=1;
end
if (s(i,1)==s(k,1) & s(i,2)==s(k,2) &
s(i,3)==s(k,3)& (s(i,4)+1)==s(k,4) & g==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt2;
else
x(i,j)=x(i,j)+lamda_nrth2;
end
g=1;
end
if (s(i,1)==s(k,1) & s(i,2)==s(k,2)&
s(i,3)==s(k,3)& (s(i,4)-1)==s(k,4) & c1==0)
x(i,j)=x(i,j)+s(i,4)*mu_nrt2;
c1=1;
end
if (s(i,1)==s(k,1) & s(i,2)==s(k,2)&
(s(i,3)+1)==s(k,3)& (s(i,4)-1)==s(k,4) & d1==0)
1 091
x(i,j)=x(i,j)+s(i,4)*mu_chmod_nrt2;
d1=1;
end
if (c==1 & d==1 & e==1 & g==1 & c1==1 &
d1==1)
break;
end
end
%......................................................
elseif s(i,1)==0 & s(i,2)==0 & s(i,4)==0
x(i,j)=0;
c=0;
d=0;
e=0;
g=0;
c1=0;
d1=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1) & s(i,2)==s(k,2) &
s(i,3)==s(k,3) & s(i,3)==s(k,4) & c==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt1;
else
x(i,j)=x(i,j)+lamda_rth1;
end
c=1;
end
if (s(i,1)==s(k,1) & (s(i,2)+1)==s(k,2) &
s(i,3)==s(k,3) & s(i,4)==s(k,4) & d==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt2;
else
x(i,j)=x(i,j)+lamda_rth2;
end
d=1;
end
if (s(i,1)==s(k,1) & s(i,2)==s(k,2) &
(s(i,3)+1)==s(k,3)& s(i,4)==s(k,4) & e==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt1;
else
x(i,j)=x(i,j)+lamda_nrth1;
end
e=1;
end
if (s(i,1)==s(k,1) & s(i,2)==s(k,2) &
s(i,3)==s(k,3)& (s(i,4)+1)==s(k,4) & g==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt2;
else
1 001
x(i,j)=x(i,j)+lamda_nrth2;
end
g=1;
end
if (s(i,1)==s(k,1) & s(i,2)==s(k,2)&
(s(i,3)-1)==s(k,3)& s(i,4)==s(k,4) & c1==0)
x(i,j)=x(i,j)+s(i,3)*mu_nrt1;
c1=1;
end
if (s(i,1)==s(k,1) & s(i,2)==s(k,2)&
(s(i,3)-1)==s(k,3)& (s(i,4)+1)==s(k,4) & d1==0)
x(i,j)=x(i,j)+s(i,3)*mu_chmod_nrt1;
d1=1;
end
if (c==1 & d==1 & e==1 & g==1 & c1==1 &
d1==1)
break;
end
end
%.....................................................
elseif s(i,1)==0 & s(i,3)==0 & s(i,4)==0
x(i,j)=0;
c=0;
d=0;
e=0;
g=0;
c1=0;
d1=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1) & s(i,2)==s(k,2) &
s(i,3)==s(k,3) & s(i,3)==s(k,4) & c==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt1;
else
x(i,j)=x(i,j)+lamda_rth1;
end
c=1;
end
if (s(i,1)==s(k,1) & (s(i,2)+1)==s(k,2) &
s(i,3)==s(k,3) & s(i,4)==s(k,4) & d==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt2;
else
x(i,j)=x(i,j)+lamda_rth2;
end
d=1;
end
if (s(i,1)==s(k,1) & s(i,2)==s(k,2) &
(s(i,3)+1)==s(k,3)& s(i,4)==s(k,4) & e==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
12..
x(i,j)=x(i,j)+lamda_nrt1;
else
x(i,j)=x(i,j)+lamda_nrth1;
end
e=1;
end
if (s(i,1)==s(k,1) & s(i,2)==s(k,2) &
s(i,3)==s(k,3)& (s(i,4)+1)==s(k,4) & g==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt2;
else
x(i,j)=x(i,j)+lamda_nrth2;
end
g=1;
end
if (s(i,1)==s(k,1) & (s(i,2)-1)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & c1==0)
x(i,j)=x(i,j)+s(i,2)*mu_rt2;
c1=1;
end
if ((s(i,1)+1)==s(k,1) & (s(i,2)1)==s(k,2)& s(i,3)==s(k,3)& s(i,4)==s(k,4) & d1==0)
x(i,j)=x(i,j)+s(i,2)*mu_chmod_rt2;
d1=1;
end
if (c==1 & d==1 & e==1 & g==1 & c1==1 &
d1==1)
break;
end
end
%.......................................................
elseif s(i,2)==0 & s(i,3)==0 & s(i,4)==0
x(i,j)=0;
c=0;
d=0;
e=0;
g=0;
c1=0;
d1=0;
e1=0;
g1=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1) & s(i,2)==s(k,2) &
s(i,3)==s(k,3) & s(i,3)==s(k,4) & c==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt1;
else
x(i,j)=x(i,j)+lamda_rth1;
end
c=1;
end
12.2
12.3
c1=0;
d1=0;
e1=0;
g1=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)& s(i,2)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & c==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt1;
else
x(i,j)=x(i,j)+lamda_rth1;
end
c=1;
end
if (s(i,1)==s(k,1)& (s(i,2)+1)==s(k,2)&
s(i,3)==s(k,3) & s(i,4)==s(k,4) & d==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt2;
else
x(i,j)=x(i,j)+lamda_rth2;
end
d=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2) &
(s(i,3)+1)==s(k,3)& s(i,4)==s(k,4) & e==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt1;
else
x(i,j)=x(i,j)+lamda_nrth1;
end
e=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2) &
s(i,3)==s(k,3)& (s(i,4)+1)==s(k,4) & g==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt2;
else
x(i,j)=x(i,j)+lamda_nrth2;
end
g=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2)&
(s(i,3)-1)==s(k,3)& s(i,4)==s(k,4)& c1==0)
x(i,j)=x(i,j)+s(i,3)*mu_nrt1;
c1=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2)&
s(i,3)==s(k,3)& (s(i,4)-1)==s(k,4)& d1==0)
x(i,j)=x(i,j)+s(i,4)*mu_nrt2;
d1=1;
end
12.4
if (s(i,1)==s(k,1)& s(i,2)==s(k,2)&
(s(i,3)-1)==s(k,3)& (s(i,4)+1)==s(k,4)& e1==0)
x(i,j)=x(i,j)+s(i,3)*mu_chmod_nrt1;
e1=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2)&
(s(i,3)+1)==s(k,3)& (s(i,4)-1)==s(k,4)& g1==0)
x(i,j)=x(i,j)+s(i,4)*mu_chmod_nrt2;
g1=1;
end
if (c==1 & d==1 & e==1 & g==1 & c1==1 &
d1==1 & e1==1 & g1==1)
break;
end
end
%......................................................
elseif s(i,1)==0 & s(i,3)==0
x(i,j)=0;
g=0;
c=0;
d=0;
e=0;
c1=0;
d1=0;
e1=0;
g1=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)& s(i,2)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & c==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt1;
else
x(i,j)=x(i,j)+lamda_rth1;
end
c=1;
end
if (s(i,1)==s(k,1)& (s(i,2)+1)==s(k,2)&
s(i,3)==s(k,3) & s(i,4)==s(k,4) & d==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt2;
else
x(i,j)=x(i,j)+lamda_rth2;
end
d=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2) &
(s(i,3)+1)==s(k,3)& s(i,4)==s(k,4) & e==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt1;
else
x(i,j)=x(i,j)+lamda_nrth1;
end
e=1;
12.5
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2) &
s(i,3)==s(k,3)& (s(i,4)+1)==s(k,4) & g==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt2;
else
x(i,j)=x(i,j)+lamda_nrth2;
end
g=1;
end
if (s(i,1)==s(k,1)& (s(i,2)-1)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4)& c1==0)
x(i,j)=x(i,j)+s(i,2)*mu_rt2;
c1=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2)&
s(i,3)==s(k,3)& (s(i,4)-1)==s(k,4)& d1==0)
x(i,j)=x(i,j)+s(i,4)*mu_nrt2;
d1=1;
end
if ((s(i,1)+1)==s(k,1)& (s(i,2)1)==s(k,2)& s(i,3)==s(k,3)& s(i,4)==s(k,4)& e1==0)
x(i,j)=x(i,j)+s(i,2)*mu_chmod_rt2;
e1=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2)&
(s(i,3)+1)==s(k,3)& (s(i,4)-1)==s(k,4)& g1==0)
x(i,j)=x(i,j)+s(i,4)*mu_chmod_nrt2;
g1=1;
end
if (c==1 & d==1 & e==1 & g==1 & c1==1 &
d1==1 & e1==1 & g1==1)
break;
end
end
%......................................................
elseif s(i,1)==0 & s(i,4)==0
x(i,j)=0;
g=0;
c=0;
d=0;
e=0;
c1=0;
d1=0;
e1=0;
g1=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)& s(i,2)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & c==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt1;
else
x(i,j)=x(i,j)+lamda_rth1;
end
12.6
c=1;
end
if (s(i,1)==s(k,1)& (s(i,2)+1)==s(k,2)&
s(i,3)==s(k,3) & s(i,4)==s(k,4) & d==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt2;
else
x(i,j)=x(i,j)+lamda_rth2;
end
d=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2) &
(s(i,3)+1)==s(k,3)& s(i,4)==s(k,4) & e==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt1;
else
x(i,j)=x(i,j)+lamda_nrth1;
end
e=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2) &
s(i,3)==s(k,3)& (s(i,4)+1)==s(k,4) & g==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt2;
else
x(i,j)=x(i,j)+lamda_nrth2;
end
g=1;
end
if (s(i,1)==s(k,1)& (s(i,2)-1)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4)& c1==0)
x(i,j)=x(i,j)+s(i,2)*mu_rt2;
c1=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2)&
(s(i,3)-1)==s(k,3)& s(i,4)==s(k,4)& d1==0)
x(i,j)=x(i,j)+s(i,3)*mu_nrt1;
d1=1;
end
if ((s(i,1)+1)==s(k,1)& (s(i,2)1)==s(k,2)& s(i,3)==s(k,3)& s(i,4)==s(k,4)& e1==0)
x(i,j)=x(i,j)+s(i,2)*mu_chmod_rt2;
e1=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2)&
(s(i,3)-1)==s(k,3)& (s(i,4)+1)==s(k,4)& g1==0)
x(i,j)=x(i,j)+s(i,3)*mu_chmod_nrt1;
g1=1;
end
if (c==1 & d==1 & e==1 & g==1 & c1==1 &
d1==1 & e1==1 & g1==1)
break;
end
12.7
end
%......................................................
elseif s(i,2)==0 & s(i,3)==0
x(i,j)=0;
g=0;
c=0;
d=0;
e=0;
c1=0;
d1=0;
e1=0;
g1=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)& s(i,2)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & c==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt1;
else
x(i,j)=x(i,j)+lamda_rth1;
end
c=1;
end
if (s(i,1)==s(k,1)& (s(i,2)+1)==s(k,2)&
s(i,3)==s(k,3) & s(i,4)==s(k,4) & d==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt2;
else
x(i,j)=x(i,j)+lamda_rth2;
end
d=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2) &
(s(i,3)+1)==s(k,3)& s(i,4)==s(k,4) & e==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt1;
else
x(i,j)=x(i,j)+lamda_nrth1;
end
e=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2) &
s(i,3)==s(k,3)& (s(i,4)+1)==s(k,4) & g==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt2;
else
x(i,j)=x(i,j)+lamda_nrt2;
end
g=1;
end
12.8
if ((s(i,1)-1)==s(k,1)& s(i,2)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4)& c1==0)
x(i,j)=x(i,j)+s(i,1)*mu_rt1;
c1=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2)&
s(i,3)==s(k,3)& (s(i,4)-1)==s(k,4)& d1==0)
x(i,j)=x(i,j)+s(i,4)*mu_nrt2;
d1=1;
end
if ((s(i,1)-1)==s(k,1)&
(s(i,2)+1)==s(k,2)& s(i,3)==s(k,3)& s(i,4)==s(k,4)& e1==0)
x(i,j)=x(i,j)+s(i,1)*mu_chmod_rt1;
e1=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2)&
(s(i,3)+1)==s(k,3)& (s(i,4)-1)==s(k,4)& g1==0)
x(i,j)=x(i,j)+s(i,4)*mu_chmod_nrt2;
g1=1;
end
if (c==1 & d==1 & e==1 & g==1 & c1==1 &
d1==1 & e1==1 & g1==1)
break;
end
end
%......................................................
elseif s(i,2)==0 & s(i,4)==0
x(i,j)=0;
g=0;
c=0;
d=0;
e=0;
c1=0;
d1=0;
e1=0;
g1=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)& s(i,2)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & c==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt1;
else
x(i,j)=x(i,j)+lamda_rth1;
end
c=1;
end
if (s(i,1)==s(k,1)& (s(i,2)+1)==s(k,2)&
s(i,3)==s(k,3) & s(i,4)==s(k,4) & d==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt2;
else
x(i,j)=x(i,j)+lamda_rth2;
end
d=1;
end
12.9
12.0
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)& s(i,2)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & c==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt1;
else
x(i,j)=x(i,j)+lamda_rth1;
end
c=1;
end
if (s(i,1)==s(k,1)& (s(i,2)+1)==s(k,2)&
s(i,3)==s(k,3) & s(i,4)==s(k,4) & d==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt2;
else
x(i,j)=x(i,j)+lamda_rth2;
end
d=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2) &
(s(i,3)+1)==s(k,3)& s(i,4)==s(k,4) & e==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt1;
else
x(i,j)=x(i,j)+lamda_nrth1;
end
e=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2) &
s(i,3)==s(k,3)& (s(i,4)+1)==s(k,4) & g==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt2;
else
x(i,j)=x(i,j)+lamda_nrth2;
end
g=1;
end
if ((s(i,1)-1)==s(k,1)& s(i,2)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4)& c1==0)
x(i,j)=x(i,j)+s(i,1)*mu_rt1;
c1=1;
end
if (s(i,1)==s(k,1)& (s(i,2)-1)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4)& d1==0)
x(i,j)=x(i,j)+s(i,2)*mu_rt2;
d1=1;
end
if ((s(i,1)-1)==s(k,1)&
(s(i,2)+1)==s(k,2)& s(i,3)==s(k,3)& s(i,4)==s(k,4)& e1==0)
x(i,j)=x(i,j)+s(i,1)*mu_chmod_rt1;
e1=1;
122.
end
if ((s(i,1)+1)==s(k,1)& (s(i,2)1)==s(k,2)& s(i,3)==s(k,3)& s(i,4)==s(k,4)& g1==0)
x(i,j)=x(i,j)+s(i,2)*mu_chmod_rt2;
g1=1;
end
if (c==1 & d==1 & e==1 & g==1 & c1==1 &
d1==1 & e1==1 & g1==1)
break;
end
end
%......................................................
elseif s(i,1)==0
x(i,j)=0;
g=0;
h=0;
c=0;
d=0;
e=0;
c1=0;
d1=0;
e1=0;
o=0;
p=0;
q=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)&s(i,2)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & c==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt1;
else
x(i,j)=x(i,j)+lamda_rth1;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & d==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt2;
else
x(i,j)=x(i,j)+lamda_rth2;
end
d=1;
end
if
(s(i,1)==s(k,1)&s(i,2)==s(k,2)&(s(i,3)+1)==s(k,3)& s(i,4)==s(k,4)&
e==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt1;
else
x(i,j)=x(i,j)+lamda_nrth1;
end
e=1;
1222
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
s(i,3)==s(k,3)& (s(i,4)+1)==s(k,4)& g==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt2;
else
x(i,j)=x(i,j)+lamda_nrth2;
end
g=1;
end
if (s(i,1)==s(k,1)&(s(i,2)-1)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & c1==0)
x(i,j)=x(i,j)+s(i,2)*mu_rt2;
c1=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
(s(i,3)-1)==s(k,3)& s(i,4)==s(k,4)& d1==0)
x(i,j)=x(i,j)+s(i,3)*mu_nrt1;
d1=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
s(i,3)==s(k,3)& (s(i,4)-1)==s(k,4)& e1==0)
x(i,j)=x(i,j)+s(i,4)*mu_nrt2;
e1=1;
end
if ((s(i,1)+1)==s(k,1)&(s(i,2)-1)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & o==0)
x(i,j)=x(i,j)+s(i,2)*mu_chmod_rt2;
o=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
(s(i,3)-1)==s(k,3)& (s(i,4)+1)==s(k,4)& p==0)
x(i,j)=x(i,j)+s(i,3)*mu_chmod_nrt1;
p=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
(s(i,3)+1)==s(k,3)& (s(i,4)-1)==s(k,4)& q==0)
x(i,j)=x(i,j)+s(i,4)*mu_chmod_nrt2;
q=1;
end
if (c==1 & d==1 & e==1 & g==1 & c1==1 &
d1==1 & e1==1 & o==1 & p==1 & q==1 )
break;
end
end
%......................................................
elseif s(i,2)==0
x(i,j)=0;
g=0;
h=0;
c=0;
d=0;
e=0;
c1=0;
d1=0;
e1=0;
o=0;
1223
p=0;
q=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)&s(i,2)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & c==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt1;
else
x(i,j)=x(i,j)+lamda_rth1;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & d==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt2;
else
x(i,j)=x(i,j)+lamda_rth2;
end
d=1;
end
if
(s(i,1)==s(k,1)&s(i,2)==s(k,2)&(s(i,3)+1)==s(k,3)& s(i,4)==s(k,4)&
e==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt1;
else
x(i,j)=x(i,j)+lamda_nrth1;
end
e=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
s(i,3)==s(k,3)& (s(i,4)+1)==s(k,4)& g==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt2;
else
x(i,j)=x(i,j)+lamda_nrth2;
end
g=1;
end
if ((s(i,1)-1)==s(k,1)& s(i,2)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & c1==0)
x(i,j)=x(i,j)+s(i,1)*mu_rt1;
c1=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
(s(i,3)-1)==s(k,3)& s(i,4)==s(k,4)& d1==0)
x(i,j)=x(i,j)+s(i,3)*mu_nrt1;
d1=1;
end
1224
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
s(i,3)==s(k,3)& (s(i,4)-1)==s(k,4)& e1==0)
x(i,j)=x(i,j)+s(i,4)*mu_nrt2;
e1=1;
end
if ((s(i,1)-1)==s(k,1)&
(s(i,2)+1)==s(k,2)& s(i,3)==s(k,3)& s(i,4)==s(k,4) & o==0)
x(i,j)=x(i,j)+s(i,1)*mu_chmod_rt1;
o=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
(s(i,3)-1)==s(k,3)& (s(i,4)+1)==s(k,4)& p==0)
x(i,j)=x(i,j)+s(i,3)*mu_chmod_nrt1;
p=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2)&
(s(i,3)+1)==s(k,3)& (s(i,4)-1)==s(k,4)& q==0)
x(i,j)=x(i,j)+s(i,4)*mu_chmod_nrt2;
q=1;
end
if (c==1 & d==1 & e==1 & g==1 & c1==1 &
d1==1 & e1==1 & 0==1 & p==1 & q==1)
break;
end
end
%......................................................
elseif s(i,3)==0
x(i,j)=0;
g=0;
h=0;
c=0;
d=0;
e=0;
c1=0;
d1=0;
e1=0;
o=0;
p=0;
q=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)&s(i,2)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & c==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt1;
else
x(i,j)=x(i,j)+lamda_rth1;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & d==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt2;
else
x(i,j)=x(i,j)+lamda_rth2;
end
1225
d=1;
end
if
(s(i,1)==s(k,1)&s(i,2)==s(k,2)&(s(i,3)+1)==s(k,3)& s(i,4)==s(k,4)&
e==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt1;
else
x(i,j)=x(i,j)+lamda_nrth1;
end
e=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
s(i,3)==s(k,3)& (s(i,4)+1)==s(k,4)& g==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt2;
else
x(i,j)=x(i,j)+lamda_nrth2;
end
g=1;
end
if ((s(i,1)-1)==s(k,1)& s(i,2)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & c1==0)
x(i,j)=x(i,j)+s(i,1)*mu_rt1;
c1=1;
end
if (s(i,1)==s(k,1)& (s(i,2)-1)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4)& d1==0)
x(i,j)=x(i,j)+s(i,2)*mu_rt2;
d1=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
s(i,3)==s(k,3)& (s(i,4)-1)==s(k,4)& e1==0)
x(i,j)=x(i,j)+s(i,4)*mu_nrt2;
e1=1;
end
if ((s(i,1)-1)==s(k,1)&
(s(i,2)+1)==s(k,2)& s(i,3)==s(k,3)& s(i,4)==s(k,4) & o==0)
x(i,j)=x(i,j)+s(i,1)*mu_chmod_rt1;
o=1;
end
if ((s(i,1)+1)==s(k,1)& (s(i,2)1)==s(k,2)& s(i,3)==s(k,3)& s(i,4)==s(k,4)& p==0)
x(i,j)=x(i,j)+s(i,2)*mu_chmod_rt2;
p=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2)&
(s(i,3)+1)==s(k,3)& (s(i,4)-1)==s(k,4)& q==0)
x(i,j)=x(i,j)+s(i,4)*mu_chmod_nrt2;
q=1;
end
if (c==1 & d==1 & e==1 & g==1 & c1==1 &
d1==1 & e1==1 & o==1 & p==1 & q==1)
break;
end
1226
end
%......................................................
elseif s(i,4)==0
x(i,j)=0;
g=0;
h=0;
c=0;
d=0;
e=0;
c1=0;
d1=0;
e1=0;
o=0;
p=0;
q=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)&s(i,2)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & c==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt1;
else
x(i,j)=x(i,j)+lamda_rth1;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & d==0)
if (s(k,1)*brt1+s(k,2)*brt2+
s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt2;
else
x(i,j)=x(i,j)+lamda_rth2;
end
d=1;
end
if
(s(i,1)==s(k,1)&s(i,2)==s(k,2)&(s(i,3)+1)==s(k,3)& s(i,4)==s(k,4)&
e==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt1;
else
x(i,j)=x(i,j)+lamda_nrth1;
end
e=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
s(i,3)==s(k,3)& (s(i,4)+1)==s(k,4)& g==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt2;
else
x(i,j)=x(i,j)+lamda_nrth2;
end
1227
g=1;
end
if ((s(i,1)-1)==s(k,1)& s(i,2)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & c1==0)
x(i,j)=x(i,j)+s(i,1)*mu_rt1;
c1=1;
end
if (s(i,1)==s(k,1)& (s(i,2)-1)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4)& d1==0)
x(i,j)=x(i,j)+s(i,2)*mu_rt2;
d1=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
(s(i,3)-1)==s(k,3)& s(i,4)==s(k,4)& e1==0)
x(i,j)=x(i,j)+s(i,3)*mu_nrt1;
e1=1;
end
if ((s(i,1)-1)==s(k,1)&
(s(i,2)+1)==s(k,2)& s(i,3)==s(k,3)& s(i,4)==s(k,4) & o==0)
x(i,j)=x(i,j)+s(i,1)*mu_chmod_rt1;
o=1;
end
if ((s(i,1)+1)==s(k,1)& (s(i,2)1)==s(k,2)& s(i,3)==s(k,3)& s(i,4)==s(k,4)& p==0)
x(i,j)=x(i,j)+s(i,2)*mu_chmod_rt2;
p=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
(s(i,3)-1)==s(k,3)& (s(i,4)+1)==s(k,4)& q==0)
x(i,j)=x(i,j)+s(i,3)*mu_chmod_nrt1;
q=1;
end
if (c==1 & d==1 & e==1 & g==1 & c1==1 &
d1==1 & e1==1 & o==1 & p==1 & q==1)
break;
end
end
%......................................................
else
x(i,j)=0;
g=0;
c=0;
d=0;
e=0;
c1=0;
d1=0;
e1=0;
g1=0;
o=0;
p=0;
q=0;
r=0;
for k=1:noofstates
if ((s(i,1)+1)==s(k,1)&s(i,2)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & c==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt1;
else
1228
x(i,j)=x(i,j)+lamda_rth1;
end
c=1;
end
if (s(i,1)==s(k,1)&(s(i,2)+1)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & d==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1 +s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_rt2;
else
x(i,j)=x(i,j)+lamda_rth2;
end
d=1;
end
if (s(i,1)==s(k,1)&
s(i,2)==s(k,2)&(s(i,3)+1)==s(k,3)& s(i,4)==s(k,4) & e==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt1;
else
x(i,j)=x(i,j)+lamda_nrth1;
end
e=1;
end
if (s(i,1)==s(k,1)& s(i,2)==s(k,2)&
s(i,3)==s(k,3)& (s(i,4)+1)==s(k,4) & g==0)
if
(s(k,1)*brt1+s(k,2)*brt2+s(k,3)*bnrt1+s(k,4)*bnrt2 <=B-GC)
x(i,j)=x(i,j)+lamda_nrt2;
else
x(i,j)=x(i,j)+lamda_nrth2;
end
g=1;
end
if ((s(i,1)-1)==s(k,1)&s(i,2)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & c1==0)
x(i,j)=x(i,j)+s(i,1)*mu_rt1;
c1=1;
end
if (s(i,1)==s(k,1)&(s(i,2)-1)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & d1==0)
x(i,j)=x(i,j)+s(i,2)*mu_rt2;
d1=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&(s(i,3)1)==s(k,3)& s(i,4)==s(k,4) & e1==0)
x(i,j)=x(i,j)+s(i,3)*mu_nrt1;
e1=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
s(i,3)==s(k,3)& (s(i,4)-1)==s(k,4) & g1==0)
x(i,j)=x(i,j)+s(i,4)*mu_nrt2;
g1=1;
end
if ((s(i,1)-1)==s(k,1)&
(s(i,2)+1)==s(k,2)& s(i,3)==s(k,3)& s(i,4)==s(k,4) & o==0)
x(i,j)=x(i,j)+s(i,1)*mu_chmod_rt1;
1229
o=1;
end
if ((s(i,1)+1)==s(k,1)&(s(i,2)-1)==s(k,2)&
s(i,3)==s(k,3)& s(i,4)==s(k,4) & p==0)
x(i,j)=x(i,j)+s(i,2)*mu_chmod_rt2;
p=1;
end
if (s(i,1)==s(k,1)&
s(i,2)==s(k,2)&(s(i,3)-1)==s(k,3)& (s(i,4)+1)==s(k,4) & q==0)
x(i,j)=x(i,j)+s(i,3)*mu_chmod_nrt1;
q=1;
end
if (s(i,1)==s(k,1)&s(i,2)==s(k,2)&
(s(i,3)+1)==s(k,3)& (s(i,4)-1)==s(k,4) & r==0)
x(i,j)=x(i,j)+s(i,4)*mu_chmod_nrt2;
r=1;
end
if (c==1 & d==1 & e==1 & g==1 & c1==1 &
d1==1 & e1==1 & g1==1 & o==1 & p==1 & q==1 & r==1)
break;
end
end
end
else
if s(i,1)==(s(j,1)+1)& s(i,2)==s(j,2)& s(i,3)==s(j,3)&
s(i,4)==s(j,4)
if (s(i,1)*brt1+s(i,2)*brt2+s(i,3)*bnrt1
+s(i,4)*bnrt2 <=B-GC)
x(i,j)=-lamda_rt1;
else
x(i,j)=-lamda_rth1;
end
elseif s(i,1)==s(j,1)& s(i,2)==(s(j,2)+1)&
s(i,3)==s(j,3)& s(i,4)==s(j,4)
if
(s(i,1)*brt1+s(i,2)*brt2+s(i,3)*bnrt1+s(i,4)*bnrt2 <=B-GC)
x(i,j)=-lamda_rt2;
else
x(i,j)=-lamda_rth2;
end
elseif s(i,1)==s(j,1)& s(i,2)==s(j,2)&
s(i,3)==(s(j,3)+1)& s(i,4)==s(j,4)
if
(s(i,1)*brt1+s(i,2)*brt2+s(i,3)*bnrt1+s(i,4)*bnrt2 <=B-GC)
x(i,j)=-lamda_nrt1;
else
x(i,j)=-lamda_nrth1;
end
elseif s(i,1)==s(j,1)& s(i,2)==s(j,2)& s(i,3)==s(j,3)&
s(i,4)==(s(j,4)+1)
if
(s(i,1)*brt1+s(i,2)*brt2+s(i,3)*bnrt1+s(i,4)*bnrt2 <=B-GC)
x(i,j)=-lamda_nrt2;
else
x(i,j)=-lamda_nrth2;
end
elseif s(i,1)==(s(j,1)-1)& s(i,2)==s(j,2)&
s(i,3)==s(j,3)& s(i,4)==s(j,4)
x(i,j)=-s(j,1)*mu_rt1;
elseif s(i,1)==s(j,1)& s(i,2)==(s(j,2)-1)&
s(i,3)==s(j,3)& s(i,4)==s(j,4)
1220
x(i,j)=-s(j,2)*mu_rt2;
elseif s(i,1)==s(j,1)& s(i,2)==s(j,2)&
s(i,3)==(s(j,3)-1)& s(i,4)==s(j,4)
x(i,j)=-s(j,3)*mu_nrt1;
elseif s(i,1)==s(j,1)& s(i,2)==s(j,2)& s(i,3)==s(j,3)&
s(i,4)== (s(j,4)-1)
x(i,j)=-s(j,4)*mu_nrt2;
elseif s(i,1)==(s(j,1)-1)& s(i,2)==(s(j,2)+1)&
s(i,3)==s(j,3)& s(i,4)==s(j,4)
x(i,j)=-s(j,1)*mu_chmod_rt1;
elseif s(i,1)==(s(j,1)+1)& s(i,2)==(s(j,2)-1)&
s(i,3)==s(j,3)& s(i,4)==s(j,4)
x(i,j)=-s(j,2)*mu_chmod_rt2;
elseif s(i,1)==s(j,1)& s(i,2)==s(j,2)&
s(i,3)==(s(j,3)-1)& s(i,4)==(s(j,4)+1)
x(i,j)=-s(j,3)*mu_chmod_nrt1;
elseif s(i,1)==s(j,1)& s(i,2)==s(j,2)&
(s(i,3)+1)==s(j,3)& s(i,4)==(s(j,4)-1)
x(i,j)=-s(j,4)*mu_chmod_nrt2;
else
x(i,j)=0;
continue;
end
end
end
end
%End of calculation of State balance Equations
%------------------------------------------------------------------------%Calculation of steady state probabilities from steady state
equation
for i=1:noofstates
%As the ss equations are dependent, any one of the ss equation is
replaced
%by the normalized equation i.e sum of all ss probabilities is
equal to one
x(1,i)=1;
end
y=zeros(1,noofstates);
%y represents the rhs column vector of the ss equations
y(1)=1;
y=y';
%calculation of steady state probabilities
ssprob(:,b)=x\y;
%b=b+1;
%.................................................................
.
BP_rt(GC)=0;
BP_nrt(GC)=0;
BP_chmod_rt(GC)=0;
DP_rt(GC)=0;
DP_nrt(GC)=0;
BP_chmod_nrt(GC)=0;
CU(GC)=0;
for i=1:noofstates
if (s(i,1)+1)*brt1+s(i,2)*brt2+s(i,3)*bnrt1 +s(i,4)*bnrt2 > B-GC
||s(i,1)*brt1+(s(i,2)+1)*brt2+s(i,3)* bnrt1 +s(i,4)* bnrt2> B-GC
123.
BP_rt(GC)=BP_rt(GC)+ssprob(i,b);
end
if (s(i,1)+1)*brt1+s(i,2)*brt2+s(i,3)*bnrt1+s(i,4)*bnrt2 > B
DP_rt(GC)=DP_rt(GC)+ssprob(i,b);
end
if s(i,1)*brt1+s(i,2)*brt2+(s(i,3)+1)*bnrt1+s(i,4)*bnrt2 >
B-GC ||s(i,1)*brt1+s(i,2)*brt2+s(i,3)* bnrt1 +(s(i,4)+1)* bnrt2>
B-GC
BP_nrt(GC)=BP_nrt(GC)+ssprob(i,b);
end
if s(i,1)*brt1+s(i,2)*brt2+(s(i,3)+1)*bnrt1+s(i,4)*bnrt2 > B
DP_nrt(GC)=DP_nrt(GC)+ssprob(i,b);
end
if (s(i,1)+1)*brt1+(s(i,2)1)*brt2+s(i,3)*bnrt1+s(i,4)*bnrt2 > B ||(s(i,1)1)*brt1+(s(i,2)+1)*brt2+s(i,3)*bnrt1+s(i,4)*bnrt2 > B
BP_chmod_rt(GC)=BP_chmod_rt(GC)+ssprob(i,b);
end
if s(i,1)*brt1+s(i,2)*brt2+(s(i,3)+1)*bnrt1+(s(i,4)1)*bnrt2 > B ||s(i,1)*brt1+s(i,2)*brt2+(s(i,3)1)*bnrt1+(s(i,4)+1)*bnrt2 > B
BP_chmod_nrt(GC)=BP_chmod_nrt(GC)+ssprob(i,b);
end
CU(GC)=CU(GC)+(s(i,1)*brt1+s(i,2)*brt2+(s(i,3)+1)*bnrt1+s(i,4)*bnr
t2)*ssprob(i,b);
end
CU(GC)=CU(GC)/B;
gos(GC)=DP_rt(GC)+DP_nrt(GC)+BP_nrt(GC)+BP_rt(GC);
minimum=min(gos);
location=find(gos==minimum);
%end
BP_rt1=BP_rt(location);
BP_nrt1=BP_nrt(location);
BP_chmod_rt1=BP_chmod_rt(location);
DP_rt1=DP_rt(location);
DP_nrt1=DP_nrt(location);
BP_chmod_nrt1=BP_chmod_nrt(location);
toc
% End of Program 4 %
1232