**3. Petri nets with variable arc weights**

470 Petri Nets – Manufacturing and Computer Science

systems.

such systems.

tracking technology, most of the studies related to PBS systems in the literature have focused on their history, development and some practical advises [9]-[31]-[39]. There are, however, relatively few studies addressing strategic and operational issues that arise in such

About strategic issues, Lin and Yang (2011) [22] and Lin et al., (2011) [23] address the strategic problem of finding optimal stations using mathematical programming techniques. The problem is formulated as a hub location inventory model. The key design decisions considered are: the number and locations of bicycle stations in the system, the creation of bicycle lanes between bicycle stations, the selection of paths of users between origins and destinations, and the inventory levels of sharing bicycles to be held at the bicycle stations. The design decisions are made with consideration for both total cost and service levels. Dell'Olio et al. (2011) [7] present a complete methodology for the design and implementing of bicycle sharing systems based on demand estimates considering the stations and the fares. Vogel et al. (2011) [38] develop a methodology for strategic and operational planning using data mining. A case study shows how Data Mining applied to operational data offers insight into typical usage patterns of bike-sharing systems and is used to forecast bike demand with the aim of supporting and improving strategic and operational planning.

Regarding operational issues, besides the work presented in [38], the static balancing problem studying the repositioning of bicycles among bicycle stations where the customer demand is assumed to be negligible is addressed in [5]-[30]. Several mathematical formulations of the problem can be found in [30] and an exact algorithm based on column generation and a suitable pricing algorithm based on dynamic programming are given by Chemla et al.; (2011) [5]. From an OR perspective, the bicycle repositioning problem bears great similarities to some other routing problems which have been largely studied in the literature. As an example from this point of view, Forma et al. (2010) [12] consider the bicycle repositioning problem as a variation of the Pickup and Delivery problem (PDP). Naturally, some similarities between bicycle-sharing and car-sharing systems can be explored in order to adapt some existing results in this field (see, for example [26]-[36]).

Besides OR approaches developed, particularly by using mathematical programming techniques [5]-[12]-[22]-[23]-[30] to support decision making in the design and management of PBS systems, Data Mining techniques receives attention in academia as well as in practice. Data Mining is particularly suitable to analyze and to predict the dynamics of a PBS system. By exploring and analyzing the temporal and geographic human mobility data in an urban area using the amount of available bicycles in the stations of a PBS system [3], statistical and prediction models can be developed [13]-[16] for tactical and operational management of

As noted in [37], although extensive analysis of bicycle data or customer surveys can be applied to predict future bicycle demand at stations, the demand still has to be considered stochastic and not deterministic. Moreover various points in time have to be incorporated in a suitable mathematical optimization models. Such a stochastic and dynamic model can be computational intractable. In addition, customer behavior cannot be modelled in these

In its basic form, a Petri net may be defined as a particular bipartite directed graph consisting of places, transitions, and arcs. Input arcs are ones connecting a place to a transition, whereas output arcs are ones connecting a transition to a place. A positive weight may be assigned to each arc. A place may contain tokens and the current state (the marking)

#### 472 Petri Nets – Manufacturing and Computer Science

of the modelled system is specified by the number of tokens in each place. Each transition usually models an activity whose occurrence is represented by its firing. A transition can be fired only if it is enabled, which means that all preconditions for the corresponding activity are fulfilled (there are enough tokens available in the input places of the transition). When the transition is fired, tokens will be removed from its input places and added to its output places. The number of tokens removed/added is determined by the weight of the arc connecting the transition with the corresponding place. Graphically, places are represented by circles, transitions by bars or thin rectangles (filled or not filled), tokens by dots. For a comprehensive introduction of Petri nets, see for example [27].

Petri Nets Models for Analysis and Control of Public Bicycle-Sharing Systems 473

. The weight *w(i, j)* is assumed to take a positive

(4)

t1

*Customers* 

The firing of transitions in a Petri net model corresponds to the occurrence of events that changes the state of the modelled system. This change of state can be due to (*i*) the completion of some activity or/and (*ii*) the verification of some logical condition in the system. Since transitions are often used to model activities (production, delivery, order…), transition enabling durations correspond to activity executions and transition firings correspond to activity completions. Hence, deterministic or stochastic temporal

In addition of the concept of time and the introduction of inhibitor arcs, which are not given in the original definition of Petri nets, the modelling of the complex dynamic of a PBS system requires the use of Petri nets models with "*variable arc weights depending on its marking"* and possibly on some decision parameters of the system. The same modelling concept is introduced for modelling inventory control systems and supply chains in [17]-[6]. Precisely, the Petri net model of an inventory control system whose inventory replenishment decision is based on the inventory position of the stock and the reorder and order-up-to-level parameters. Similarly, in the case of a PBS system, the redistribution operation of the bicycles between stations depends on the number of the available bicycles

By allowing the weights of some arcs of a Petri net to depend on its marking, control policies of the stations can be easily described in the PBS model. Therefore, we consider in this chapter that for any arc (*i, j*), its weight *w(i, j)* is now defined as a linear function of the

> (,) *<sup>i</sup> <sup>i</sup> ij ij <sup>i</sup> <sup>P</sup> p P*

To understand the mathematical and intuitive meaning of this concept, consider the Petri

 *M p*

*Stock* 

p1

*Replenishment Delivery* 

*Order outstanding orders* 

*On-hand inventory plus* 

 and 

**10-M(p2)**

t3

**10-M(p2)**

p p2 <sup>3</sup>

**4**

**Figure 5.** Illustration of a Petri net with variable arc weights depending on its marking

*wij*

t2

specifications can be naturally associated with transitions [24].

in each station when controlled.

marking *M* with integer coefficients

net shown in Figure 5.

*Outstanding orders* 

value.

*Suppliers* 

Formally, a Petri net can be defined as *PN* = (*P, T, Pré, Post, Inhib, M0*), where: *P = {p1, p2, …, pn}* is a finite and non-empty set of places; *T = {t1, t2, …, tm}* is a finite and non-empty set of transitions; *Pre*: (*PT*) *N* is an input function that defines directed weighted arcs from places to transitions, where *N* is a set of nonnegative integers; *Post*: *(PT) N* is an output function which defines directed weighted arcs from transitions to places*; Inhib: (PT) N* is an inhibitor function which defines inhibitor weighted arcs (circle-headed weighted arcs) from places to transitions*;* and *M0* is called initial marking (initial distribution of the tokens in the places). A place connected with a transition by an arc is referred to as input, output, and inhibitor place, depending on the type of the arc. The set of input places, the set of output places, and the set of inhibitor places of a transition *t* are denoted by *t*, *t* , and *t*, respectively. The weights of the input arc from a place *p* to a transition *t*, of the output arc from *t* to *p*, and of the inhibitor arc from *p* to *t* are denoted by *Pre(p, t)*, *Post(p, t)*, and *Inhib(p, t)*, respectively.

The behavior of many systems can be described in terms of system states and their changes. In order to simulate the dynamic behavior of a system, a state or marking in a Petri net is changed according to the following transition rules:

 A transition *t* is said to be enabled if each of its input places contains at least a number of tokens equal to the weight of the corresponding input arc, and each of its inhibitor places contains tokens less than the weight of its corresponding inhibitor arcs.

Formally:

$$\forall p \in \textsuperscript{\bullet}{}^{\bullet}t,\ M(p) \ge \textit{Pre}(p,t) \tag{1}$$

$$\forall p \in \textsuperscript{\circ}{}^{\circ}t,\ M(p) < \textit{Inhib}(p,t) \tag{2}$$

 An enabled transition *t* fires by removing from each of its input places a number of tokens corresponding to the weight of the corresponding input arc, and adding a number of tokens in each of its output places corresponding to the weight of the corresponding output arc.

Formally:

$$\forall p \in P, M'(p) = M(p) - \text{Pre}(p, t) + \text{Post}(p, t) \tag{3}$$

The firing of transitions in a Petri net model corresponds to the occurrence of events that changes the state of the modelled system. This change of state can be due to (*i*) the completion of some activity or/and (*ii*) the verification of some logical condition in the system. Since transitions are often used to model activities (production, delivery, order…), transition enabling durations correspond to activity executions and transition firings correspond to activity completions. Hence, deterministic or stochastic temporal specifications can be naturally associated with transitions [24].

472 Petri Nets – Manufacturing and Computer Science

*t)*, respectively.

Formally:

Formally:

comprehensive introduction of Petri nets, see for example [27].

changed according to the following transition rules:

corresponding output arc.

places to transitions, where *N* is a set of nonnegative integers; *Post*: *(P*

function which defines directed weighted arcs from transitions to places*; Inhib: (P*

output places, and the set of inhibitor places of a transition *t* are denoted by

of the modelled system is specified by the number of tokens in each place. Each transition usually models an activity whose occurrence is represented by its firing. A transition can be fired only if it is enabled, which means that all preconditions for the corresponding activity are fulfilled (there are enough tokens available in the input places of the transition). When the transition is fired, tokens will be removed from its input places and added to its output places. The number of tokens removed/added is determined by the weight of the arc connecting the transition with the corresponding place. Graphically, places are represented by circles, transitions by bars or thin rectangles (filled or not filled), tokens by dots. For a

Formally, a Petri net can be defined as *PN* = (*P, T, Pré, Post, Inhib, M0*), where: *P = {p1, p2, …, pn}* is a finite and non-empty set of places; *T = {t1, t2, …, tm}* is a finite and non-empty set of transitions; *Pre*: (*PT*) *N* is an input function that defines directed weighted arcs from

an inhibitor function which defines inhibitor weighted arcs (circle-headed weighted arcs) from places to transitions*;* and *M0* is called initial marking (initial distribution of the tokens in the places). A place connected with a transition by an arc is referred to as input, output, and inhibitor place, depending on the type of the arc. The set of input places, the set of

respectively. The weights of the input arc from a place *p* to a transition *t*, of the output arc from *t* to *p*, and of the inhibitor arc from *p* to *t* are denoted by *Pre(p, t)*, *Post(p, t)*, and *Inhib(p,* 

The behavior of many systems can be described in terms of system states and their changes. In order to simulate the dynamic behavior of a system, a state or marking in a Petri net is

 A transition *t* is said to be enabled if each of its input places contains at least a number of tokens equal to the weight of the corresponding input arc, and each of its inhibitor

 An enabled transition *t* fires by removing from each of its input places a number of tokens corresponding to the weight of the corresponding input arc, and adding a number of tokens in each of its output places corresponding to the weight of the

places contains tokens less than the weight of its corresponding inhibitor arcs.

*T)*

*p t Mp pt* , ( ) Pre( , ) (1)

*p t M p Inhib p t* , ( ) ( , ) (2)

*p P M p M p p t Post p t* , '( ) ( ) Pre( , ) ( , ) (3)

 *N* is an output

*T) N* is

*t*, *t* , and *t*, In addition of the concept of time and the introduction of inhibitor arcs, which are not given in the original definition of Petri nets, the modelling of the complex dynamic of a PBS system requires the use of Petri nets models with "*variable arc weights depending on its marking"* and possibly on some decision parameters of the system. The same modelling concept is introduced for modelling inventory control systems and supply chains in [17]-[6]. Precisely, the Petri net model of an inventory control system whose inventory replenishment decision is based on the inventory position of the stock and the reorder and order-up-to-level parameters. Similarly, in the case of a PBS system, the redistribution operation of the bicycles between stations depends on the number of the available bicycles in each station when controlled.

By allowing the weights of some arcs of a Petri net to depend on its marking, control policies of the stations can be easily described in the PBS model. Therefore, we consider in this chapter that for any arc (*i, j*), its weight *w(i, j)* is now defined as a linear function of the marking *M* with integer coefficients and . The weight *w(i, j)* is assumed to take a positive value.

$$\text{cov}(i, j) = \alpha\_{ij} + \sum\_{p\_i \in P} \left(\beta\_{ij}\right)\_{P\_i} \cdot M\left(p\_i\right) \tag{4}$$

To understand the mathematical and intuitive meaning of this concept, consider the Petri net shown in Figure 5.

**Figure 5.** Illustration of a Petri net with variable arc weights depending on its marking

#### 474 Petri Nets – Manufacturing and Computer Science

The model represents an inventory control system with continue review (*s, S*) policy (here *s* = *4* and *S* = *10*) [17]. The different operations of the system are modelled by using a set of transitions: generation of replenishment orders (*t3*); inventory replenishment (*t2*); and order delivery (*t1*). In the model, the weights of the arcs (*t3, p2*), (*t3, p3*) are variable and depend on the parameters s and *S* of the system and on the marking of the model (*S - M(p2); s*).

Petri Nets Models for Analysis and Control of Public Bicycle-Sharing Systems 475

model of the system. A closer look at the Petri net model shows three subnets (modules) representing three different functions named as follows: (*1*) the "station control" subnet; (*2*) the "bicycle flows" subnet; and (*3*) the "redistribution circuit" subnet. The main function of

 The "bicycle flows" subnet represents the bicycle traffic flows between the different stations of the network. A customer uses a bicycle to travel from one station to another. In other words, a bicycle can be taken out from any station and returned to the same or

 The "station control" subnet represents the control function of the stations to ensure bicycles are available for pick up and vacant berths available for bicycle drop off at every station *Si*. The purpose of this function is two-fold: First, the control of the state of the station in terms of the number of bicycles available for new users; and second, according to the state of the controlled station, take one decision among three alternatives: (*i*) Add bicycles in the station, or (*ii*) Remove bicycles from the station, or

 The "redistribution circuit" subnet represents the path (circuit) to be followed by the redistribution vehicle in order to visit the different stations of the network. Its objective is to rebalance bicycles between stations that are emptying out and those that are filling up.

*PSi* Represents a station *Si*. Its marking *M(PSi)* correspond to the number of

vehicle when the station *Si* is visited in order to be controlled. *POi* Specify whether the number of bicycles in a station *Si* is greater than the

*PCi* Specify the end of the control of a station *Si* by the redistribution vehicle.

that the redistribution vehicle is liberated to go to the next station.

*TOi* Test if the number of bicycles available in a station *Si* is greater than the

*TSi* Remove bicycles from a station *Si* if the number of bicycles available in this

*TEi* Test if the number of bicycles available in a station *Si* is equal to the reorder

reorder point *Ri*. It is indicated when *M(POi) = 1*.

*PRi* Represents a redistribution vehicle used to regulate the stations. Its marking

*M(PRi)* correspond to the number of bicycles available in this redistribution

*M(PCi) = 1* means that the control of the station *Si* is completed and indicates

any other station, provided that there is an available locking berth.

*Place Interpretation* 

bicycles available in the station *Si*.

*Transition Interpretation* 

*TRi* Test and add (if necessary) bicycles into a station *Si*.

station is judged less than the reorder point *Ri*

**Table 3.** Interpretation of places of the PN model

reorder point *Ri*.

**Table 4.** Interpretation of transitions of the PN model

point *Ri*

each subnet is described in the following:

(*iii*) Take no action.

 According to the current marking *Mi* = (*2, 2, 0*) of the net, the transition *t3* is enabled, since the following condition is satisfied:

$$M(p\_2) = 2 < Inhib(p\_2, t\_3) = 4$$

 After the firing of *t3*, 10 - *M(p2) =* 10–2 = 8 tokens are added into the places *p2* and *p3*. In other words, the firing of the transition *t3* from the initial marking *Mi* leads to a new marking *Mf* = (*2, 10, 8*) as the following:

$$\begin{aligned} M\_f(p\_2) &= M\_i(p\_2) + \left[ 10 - M\_i(p\_2) \right] = 2 + \left[ 10 - 2 \right] = 10. \\\\ M\_f(p\_3) &= M\_i(p\_3) + \left[ 10 - M\_i(p\_3) \right] = 0 + \left[ 10 - 2 \right] = 8. \end{aligned}$$
