*4.2.1. The "control stations" subnet*

The subnet representing the control function of each station *Si* is indicated in Figure 6. As shown in the model, the considered subnet is duplicated for each station *Si*. We recall that, the main objective of the control function is to rebalance bicycles between stations that are emptying out and those that are filling. The control function of the system is realized by using three places denoted by *PSi, PCi, PRi ;* for transitions denoted by *TEi TRi, TSi, TOi*. As indicated in the tables 3 and 4, the place *PSi* represents a station *Si*; the place *PRi* represents the redistribution vehicle when visiting the station *Si*; and the place *PCi* means to indicate the end of the control operation of the station *Si*. When the redistribution vehicle arrives at a station *Si*, the state of this station is controlled. According to the number of bicycles available in the station, the decision to be made is either (*a*) to put bicycles in the station, or (*b*) to take bicycles from the station, or (*c*) take no action. The different operations are described and illustrated as follows.

a. **"Addition of bicycles to a station" operation**: The decision to add bicycles in a station *Si* is performed by the transition *TRi* connected by the corresponding arcs to the places *PRi* and *PSi*. Indeed, the transition *TRi* means to verify the current number of bicycles in the station and to add (if necessary!) a given number (*Ri – M(PSi)*) of bicycles to the station *Si*. When the transition *TRi* is fired, *Ri - M(PSi)* tokens (bicycles) will be removed from the place *PRi* (the regulation vehicle) and at the same time, *Ri - M(PSi)* tokens (bicycles) will be added to the place *PSi* (the station *Si*). At the same time, one token will be deposited in the place *PCi* to indicate the end of the control of the station *Si*, and then the redistribution vehicle can travel to the next section *Si+1*.

476 Petri Nets – Manufacturing and Computer Science

stations)

**Table 5.** Decision parameters of the PN model

PBS system with *N* stations should contain:

**4.2. Description of the Petri net model** 

<sup>2</sup> 7 \* *Ai N N* inhibitors arcs.

*4.2.1. The "control stations" subnet* 

*Parameter Interpretation* 

number of bicycle stands in a station *Si*.

action. The different operations are described and illustrated as follows.

the redistribution vehicle can travel to the next section *Si+1*.

*Ri* Reorder point fixed for each station *Si*. It is the minimum level of available bicycles in the station *Si* when a decision should be made to adding or removing bicycles into (from) the station (redistribution of bicycles between

*Ci* Capacity of each station *Si*. More precisely, *Ci* corresponds to the maximal

Thanks to the modularity of the developed model, its generalization for a system with *N*  stations is simple to make according to the different functions cited previously. For example, to model *N* stations *Si (*i = 1, 2, …, *N*), we need to *N* places denoted by *PSi* and the control subnet is duplicated for each station similarly to the model represented for three stations (see Figure 6). Finally, by considering all the modules, the Petri net model representing a

<sup>2</sup> *TN N* 5 \* transitions; *P N* <sup>4</sup> places; <sup>2</sup> 2 \* 21 \* *Ad N N* directed arcs, and

The subnet representing the control function of each station *Si* is indicated in Figure 6. As shown in the model, the considered subnet is duplicated for each station *Si*. We recall that, the main objective of the control function is to rebalance bicycles between stations that are emptying out and those that are filling. The control function of the system is realized by using three places denoted by *PSi, PCi, PRi ;* for transitions denoted by *TEi TRi, TSi, TOi*. As indicated in the tables 3 and 4, the place *PSi* represents a station *Si*; the place *PRi* represents the redistribution vehicle when visiting the station *Si*; and the place *PCi* means to indicate the end of the control operation of the station *Si*. When the redistribution vehicle arrives at a station *Si*, the state of this station is controlled. According to the number of bicycles available in the station, the decision to be made is either (*a*) to put bicycles in the station, or (*b*) to take bicycles from the station, or (*c*) take no

a. **"Addition of bicycles to a station" operation**: The decision to add bicycles in a station *Si* is performed by the transition *TRi* connected by the corresponding arcs to the places *PRi* and *PSi*. Indeed, the transition *TRi* means to verify the current number of bicycles in the station and to add (if necessary!) a given number (*Ri – M(PSi)*) of bicycles to the station *Si*. When the transition *TRi* is fired, *Ri - M(PSi)* tokens (bicycles) will be removed from the place *PRi* (the regulation vehicle) and at the same time, *Ri - M(PSi)* tokens (bicycles) will be added to the place *PSi* (the station *Si*). At the same time, one token will be deposited in the place *PCi* to indicate the end of the control of the station *Si*, and then

**Figure 6.** The Petri net model of a self-service public bicycles system (with three stations)

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

*Si* is greater than the reorder point *Ri* and the transition *TSi* allows us to remove bicycles (if necessary!) from the station *Si* and put them in the regulation vehicle. When the transition *TOi* is enabled, its firing will add a token into the place *POi* to indicate that the current number of bicycles in the station *Si* is greater than the reorder point *Ri* fixed for the station *Si*. This indication (i.e. *M(POi) =1*) is one of the enabling conditions of the transition *TSi*. When the transition *TSi* is enabled, its firing leads to remove *M(PSi)-Ri* bicycles (superfluous) will be removed from the station *Si* and, at the same time, they

 **Illustrative example 2.**— Now, as illustrated in Figure 8, consider that initially there are *15* available bicycles in the station *S3* (*i.e. M(PS3) = 15*); *22* available bicycles in the redistribution vehicle (i.e. *M(PR3) = 15*); *M(PC3) = 0*; and the reorder point *R3* is fixed to *10*. For the current marking of the subnet, the transition *TO3* is

<sup>3</sup> *M PS* ( ) 15 11 ; 3 *M PO* ( )01 ; 3 *M PC* ( )01 .

<sup>3</sup> *M PS* ( ) 15 15 ; <sup>3</sup> *M PO* ( )11 <sup>3</sup> *M PC* ( )01 ; <sup>3</sup> *M PR* ( ) 22 10 .

33 3 *M PS M PS M PS* ( ) ( ) 10 ( ) 10 ;

33 3 *M PR M PR M PS* ( ) ( ) 10 ( ) 22 10 15 27 ;

3 3 *M PC M PC* ( ) ( )11 ; 3 3 *M PO M PO* ( ) ( ) 1 0.

**c. "No action" operation:** Contrarily to the two previous actions corresponding "to remove" or "to add" bicycles from (resp. into) the station *Si*, the "not action" function will be performed when the current number of bicycles in the controlled station *Si* is equal to the reorder point *Ri*. Testing that *M(PSi) = Ri* is made by the transition *TEi* with its corresponding arcs connecting the places *PSi* and *PCi* with the transition. The firing of *TEi* will not change the marking of the place *PSi* which represents the number of bicycles in the controlled station *Si*. Similarly to the two previous functions, after the firing of *TEi* one token will be deposited in the place *PCi*. This is to indicate the end of the control of the station *Si* and then the redistribution vehicle can travel at the next section by the firing a transition *TRij* in the Petri net model. This case is illustrated in

After the firing of the immediate transition *TO3*, a token will be placed in *PO3* indicating that the current number of bicycles in the station *S3* is greater than *R3 = 10* (*M(PS3)>10*). That is: 3 3 *M PO M PO* ( ) ( )11 . With this indication, the transition *TS3* is systematically enabled, according to the following satisfied

Then, after the firing of the transition *TR3*, the state of the subnet will change as

are deposited in the place *PRi* which represents the redistribution vehicle.

enabled, since:

enabling equations:

Figure 9 where we consider *M(PS3) = 10*.

follows:

**Figure 7.** "Control station" subnet illustration: The number of available bicycles in the station *Si* is less than *Ri (i.e., M(Si) < Ri = 10)*

 **Illustrative example 1**.— As shown in Figure 7, consider that initially there are 7 available bicycles in the station *S3* (i.e. *M(PS3) = 7*); 15 available bicycles in the redistribution vehicle (i.e. *M(PR3) = 15*); *M(PC3) = 0*; and the reorder point *R3* is fixed to 10. For this marking, only the transition *TR3* is enabled since the following enabling equations are satisfied:

$$M(PS\_3) = 7 < 10 \; \text{ } ; M(PR\_3) = 15 \ge 10 - M(PS\_i) = 3 \; \text{ } ; \; M(PC\_3) = 0 < 1 \; \text{ } .$$

After the firing of the transition TR3, the marking of the corresponding places changes in this way:

$$M'(PS\_3) = M(PS\_3) + \left[10 - M(PS\_3)\right] = 7 + \left(10 - 7\right) = 10. \; ;$$

$$M'(PR\_3) = M(PR\_3) - \left[10 - M(PS\_3)\right] = 15 - \left(10 - 7\right) = 12. \; ;$$

$$M'(PC\_3) = M(PC\_3) + 1 = 0 + 1 = 1.$$

b. **"Remove bicycles from a station" operation:** The decision to remove bicycles (superfluous) from a station *Si* is made by the two transitions *TOi* and *TSi*. More precisely, the transition *TOi* means to test if the current number of bicycles in the station *Si* is greater than the reorder point *Ri* and the transition *TSi* allows us to remove bicycles (if necessary!) from the station *Si* and put them in the regulation vehicle. When the transition *TOi* is enabled, its firing will add a token into the place *POi* to indicate that the current number of bicycles in the station *Si* is greater than the reorder point *Ri* fixed for the station *Si*. This indication (i.e. *M(POi) =1*) is one of the enabling conditions of the transition *TSi*. When the transition *TSi* is enabled, its firing leads to remove *M(PSi)-Ri* bicycles (superfluous) will be removed from the station *Si* and, at the same time, they are deposited in the place *PRi* which represents the redistribution vehicle.

478 Petri Nets – Manufacturing and Computer Science

than *Ri (i.e., M(Si) < Ri = 10)*

enabling equations are satisfied:

changes in this way:

**Figure 7.** "Control station" subnet illustration: The number of available bicycles in the station *Si* is less

 **Illustrative example 1**.— As shown in Figure 7, consider that initially there are 7 available bicycles in the station *S3* (i.e. *M(PS3) = 7*); 15 available bicycles in the redistribution vehicle (i.e. *M(PR3) = 15*); *M(PC3) = 0*; and the reorder point *R3* is fixed to 10. For this marking, only the transition *TR3* is enabled since the following

<sup>3</sup> *M PS* ( ) 7 10 ; <sup>3</sup> ( ) 15 10 ( ) 3 *M PR M PSi* ; 3 *M PC* ( )01 .

33 3 *M PS M PS M PS* ( ) ( ) 10 ( ) 7 10 7 10.

33 3 *M PR M PR M PS* ( ) ( ) 10 ( ) 15 10 7 12.

3 3 *M PC M PC* ( ) ( ) 1 0 1 1.

b. **"Remove bicycles from a station" operation:** The decision to remove bicycles (superfluous) from a station *Si* is made by the two transitions *TOi* and *TSi*. More precisely, the transition *TOi* means to test if the current number of bicycles in the station

After the firing of the transition TR3, the marking of the corresponding places

;

;

 **Illustrative example 2.**— Now, as illustrated in Figure 8, consider that initially there are *15* available bicycles in the station *S3* (*i.e. M(PS3) = 15*); *22* available bicycles in the redistribution vehicle (i.e. *M(PR3) = 15*); *M(PC3) = 0*; and the reorder point *R3* is fixed to *10*. For the current marking of the subnet, the transition *TO3* is enabled, since:

$$M(PS\_3) = 15 \ge 11 \quad \text{; } \\ M(PO\_3) = 0 < 1 \; \text{; } \\ M(PC\_3) = 0 < 1 \; \text{; } $$

After the firing of the immediate transition *TO3*, a token will be placed in *PO3* indicating that the current number of bicycles in the station *S3* is greater than *R3 = 10* (*M(PS3)>10*). That is: 3 3 *M PO M PO* ( ) ( )11 . With this indication, the transition *TS3* is systematically enabled, according to the following satisfied enabling equations:

$$M(PS\_3) = 15 \ge 15 \; \; \text{;} \\ M(PO\_3) = 1 \ge 1 \; \text{;} \\ M(PC\_3) = 0 < 1 \; \text{;} \\ M(PR\_3) = 22 \ge 10 \; \text{.} $$

Then, after the firing of the transition *TR3*, the state of the subnet will change as follows:

$$M'(PS\_3) = M(PS\_3) + \left[10 - M(PS\_3)\right] = 10 \quad \text{;}$$

$$M'(PR\_3) = M(PR\_3) - 10 + M(PS\_3) = 22 - 10 + 15 = 27 \quad \text{;}$$

$$M'(PC\_3) = M(PC\_3) + 1 = 1 \; ; \\ M'(PO\_3) = M(PO\_3) - 1 = 0.$$

**c. "No action" operation:** Contrarily to the two previous actions corresponding "to remove" or "to add" bicycles from (resp. into) the station *Si*, the "not action" function will be performed when the current number of bicycles in the controlled station *Si* is equal to the reorder point *Ri*. Testing that *M(PSi) = Ri* is made by the transition *TEi* with its corresponding arcs connecting the places *PSi* and *PCi* with the transition. The firing of *TEi* will not change the marking of the place *PSi* which represents the number of bicycles in the controlled station *Si*. Similarly to the two previous functions, after the firing of *TEi* one token will be deposited in the place *PCi*. This is to indicate the end of the control of the station *Si* and then the redistribution vehicle can travel at the next section by the firing a transition *TRij* in the Petri net model. This case is illustrated in Figure 9 where we consider *M(PS3) = 10*.

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

bicycles soon. In our model, we consider that the vehicle(s) used to rebalance bicycles

**Figure 9.** "Control station" subnet illustration: The number of available bicycles in the station *Si* is equal

As can be seen in the Figure 6, the places denoted by *PRi* (*i = 1, 2, …, N*), the transitions

path. The resulting subnet represents a circuit which the redistribution vehicle follows in order to visit and to control successively the different stations of the network. When the redistribution vehicle arrives at a given station *Si*, the marking of the place *PRi* (i.e., *M*(*PRi*)) indicates the current available bicycles in the vehicle. The displacement of the vehicle from a station *Si* to another station *Sj* is modelled by the transition *TRij*. Obviously, the circuit is connected to the control subnet of the system. Indeed, each place *PRi* is connected to the three transitions *TSi*, *TEi*, and *TRi* in order to execute the control function of the station *Si*.

Now, suppose that the control of a given station *Si* is finished. Then, the redistribution vehicle leaves the station *Si* and goes to the next section *Sj*. The firing of the enabled transition *TRij* leads to a new marking the place *PCi*, *M'(PCi) = 0,* indicating that the redistribution vehicle is arrived at the next station *Sj* with *M(PRi)* bicycles in its trailer. *M(PRi)* corresponds to the rest of bicycles just after the control of the previous station *Si*.

 *j* and *i, j = 1, 2, …, N*) and all of the corresponding arcs form a closed

between stations visits successively stations *S1, S2,…, SN*.

to *Ri (i.e., M(Si) = Ri = 10)*

denoted by *TRij* (*i* 

The connection is made by the corresponding arcs.

**Figure 8.** "Control station" subnet illustration: The number of available bicycles in the station *Si* is greater than *Ri (i.e., M(Si) > Ri = 10)*

### *4.2.2. The "bicycle flows" subnet*

A public bicycle system is a bank of bicycles which are continuously used by users to travel from one station to another. Thus, each bicycle of the system can be taken out from any station and returned to the same or any other station, provided that there is an available locking berth. The subnet representing the displacements of the bicycles between the different stations of the system is represented in Figure 10 and indicated in Figure 2. Each station *Si* of the system is modelled by using a place denoted by *PSi*. The bicycle flows is represented by the multiple token displacements from any place to the same or any other place by firing transitions denoted by *TSij* (possibly *TSii*) connecting the different places of the subnet. Each station *Si* is equipped with *Ci* bicycle stands. It is the capacity of each place *PSi* in the subnet. The parameter *Ci* represents the weight of the inhibitor arcs connecting the places *PSi* with the transition *TSij*. The inhibitor arcs are used in order to respect the capacity *Ci* of each station. According to the stochastic behavior of the bicycle flows between the different stations, the transitions of the subnet must be stochastic transitions.

## *4.2.3. The "redistribution circuit" subnet*

As noted previously, the PBS system requires constant control which consists in transporting bicycles from stations having excess of bicycles to stations that may run out of bicycles soon. In our model, we consider that the vehicle(s) used to rebalance bicycles between stations visits successively stations *S1, S2,…, SN*.

480 Petri Nets – Manufacturing and Computer Science

greater than *Ri (i.e., M(Si) > Ri = 10)*

*4.2.2. The "bicycle flows" subnet* 

*4.2.3. The "redistribution circuit" subnet* 

**Figure 8.** "Control station" subnet illustration: The number of available bicycles in the station *Si* is

A public bicycle system is a bank of bicycles which are continuously used by users to travel from one station to another. Thus, each bicycle of the system can be taken out from any station and returned to the same or any other station, provided that there is an available locking berth. The subnet representing the displacements of the bicycles between the different stations of the system is represented in Figure 10 and indicated in Figure 2. Each station *Si* of the system is modelled by using a place denoted by *PSi*. The bicycle flows is represented by the multiple token displacements from any place to the same or any other place by firing transitions denoted by *TSij* (possibly *TSii*) connecting the different places of the subnet. Each station *Si* is equipped with *Ci* bicycle stands. It is the capacity of each place *PSi* in the subnet. The parameter *Ci* represents the weight of the inhibitor arcs connecting the places *PSi* with the transition *TSij*. The inhibitor arcs are used in order to respect the capacity *Ci* of each station. According to the stochastic behavior of the bicycle flows between the

As noted previously, the PBS system requires constant control which consists in transporting bicycles from stations having excess of bicycles to stations that may run out of

different stations, the transitions of the subnet must be stochastic transitions.

**Figure 9.** "Control station" subnet illustration: The number of available bicycles in the station *Si* is equal to *Ri (i.e., M(Si) = Ri = 10)*

As can be seen in the Figure 6, the places denoted by *PRi* (*i = 1, 2, …, N*), the transitions denoted by *TRij* (*i j* and *i, j = 1, 2, …, N*) and all of the corresponding arcs form a closed path. The resulting subnet represents a circuit which the redistribution vehicle follows in order to visit and to control successively the different stations of the network. When the redistribution vehicle arrives at a given station *Si*, the marking of the place *PRi* (i.e., *M*(*PRi*)) indicates the current available bicycles in the vehicle. The displacement of the vehicle from a station *Si* to another station *Sj* is modelled by the transition *TRij*. Obviously, the circuit is connected to the control subnet of the system. Indeed, each place *PRi* is connected to the three transitions *TSi*, *TEi*, and *TRi* in order to execute the control function of the station *Si*. The connection is made by the corresponding arcs.

Now, suppose that the control of a given station *Si* is finished. Then, the redistribution vehicle leaves the station *Si* and goes to the next section *Sj*. The firing of the enabled transition *TRij* leads to a new marking the place *PCi*, *M'(PCi) = 0,* indicating that the redistribution vehicle is arrived at the next station *Sj* with *M(PRi)* bicycles in its trailer. *M(PRi)* corresponds to the rest of bicycles just after the control of the previous station *Si*.

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

In the presented Petri net model (for three stations), we used a single redistribution vehicle for the control of the stations. Obviously, in practice, for a system with *N* stations implemented in a given city, the regulation can be performed by several redistribution vehicles which can be affected to different districts of the city. Thus, in the Petri net model, several redistribution vehicles and their circuits can be represented similarly to the example presented with one redistribution vehicle.

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

(5)

(6)

*<sup>T</sup>* (7)

1 ( )0

1 ( )

(8)

(9)

of the simulation, some performance indices for places and transitions can be obtained. Some of them are formulated and interpreted for the performance evaluation of PBS systems

( ) ( ) *avr*

( ) ( ) *avr*

*M P*

*S P*

between the different stations of the transport network.

c. Effective firing rate of a transition T (Favr(T)):

d. Rates of empty and full places (REmpty(P); RFull(P)):

%

*empty*

*R P*

(%)

*R P*

*full*

*s M P*

*t M P* is the duration of the cycle. By calculating the mean sejourn times of the

*N*

where *Nt* is the number of different tokens that have passed through the place until the current cycle. The value of *Nt* can be obtained by incrementing a counter each time an input transition fires and put tokens in the place. *M(P)* is the number of tokens in the

places *PSi*, we get important informations about the the turnover (rotation) of bicycles

( ) ( ) *avr*

*NF T F T*

quantify the dynamics of the system or some rates of specific activities.

*s*

where *Ts* is the total simulation time; *NF(T)* is the number of firings of the transition. The firing rates of some transitions of the Petri net model, such as the transitions *TRi*, *TSi*, and *TRij*, measure some operations rates of the regulation function in order to

( ) ( ) 100 *s kk M P*

( ) ( ) 100 *s kk <sup>M</sup> P Cp*

where *Ts* is the simulation time (*Ts* ); (k - k+1) represente the the duration of the cycle where the place *P* is empty (resp. full) (i.e., *M(P)* = 0 resp. *M(P)* = *Cp* where *Cp* is the

*T*

*T*

*s*

*s*

*T* 

*T* 

is the duration of the cycle. This performance indice can be used

*T*

where *M(P)* is the number of tokens at the beginning of the cycle; *Ts* is the total

particulary to get the mean number of bicycles in each station *Si* and in the regulation vehicle(s) by computing the average marking of the corresponding places *PSi* and *PRi*.

as follows:

simulation time and

place *P* and

a. Average number of tokens in a place P (Mavr(P)):

b. Mean sojourn time of tokens in a place (Savr(P)):

**Figure 10.** The "bicycle flows" subnet.
