# Driver's Behavior Modeling Using Fuzzy Logic

Authors: Sehraneh Ghaemi; Sohrab Khanmohammadi; Mohammadali Tinati
Journal: Mathematical Problems in Engineering
 (2010)

---

## Abstract

In this study, we propose a hierarchical fuzzy system for human in a driver-vehicle-environment system to model takeover by different drivers. The driver's behavior is affected by the environment. The climate, road and car conditions are included in fuzzy modeling. For obtaining fuzzy rules, experts' opinions are benefited by means of questionnaires on effects of parameters such as climate, road and car conditions on driving capabilities. Also the precision, age and driving individuality are used to model the driver's behavior. Three different positions are considered for driving and decision making. A fuzzy model calledModel I  is presented for modeling the change of steering angle and speed control by considering time distances with existing cars in these three positions, the information about the speed and direction of car, and the steering angle of car. Also we obtained two other models based on fuzzy rules called Model II and Model III by using Sugeno fuzzy inference. Model II and Model III have less linguistic terms than Model I for the steering angle and direction of car. The results of three models are compared for a driver who drives based on driving laws.


---

## Body

## 1. Introduction

In recent years, by using new control ideas, safety in driving has been improved. MacAdam developed an optimal preview control algorithm; however, this algorithm could only be applied to single-input single-output systems. Fenton applied Linear Quadratic algorithm to design a controller for steering. Ackermann and Sienel used parameter space robust control to design the automatic steering controller. These models did not take the driver's preview behavior into consideration. Lee developed a discrete time preview control algorithm for four-wheel steering passenger vehicles and found that the control accuracy was improved substantially by taking the preview behavior into account. In [1] Yoshida and Kamada proposed a fuzzy logic lateral controller. Hessburg and Tomizuka [2] developed a fuzzy logic controller for vehicle lateral guidance which consisted of three sub-controllers: preview, feedback, and gain scheduling. Cai et al. investigated the influence of driver emotion on performance through platoon driving simulated with multiple simulators [3]. They induced two kinds of emotion states (anger and excitation) through realistic driver-driver interaction by using networked driving simulators. Drivers’ psychophysiological parameters changes were the indicators of emotions. In the anger and excitation states, drivers showed poorer lane control capability. In [3] the author investigated emotional behavior (anger, neutral, and excitation) of drivers by collecting driving performance data. The results demonstrated the feasibility and efficiency of using multiple networked driving simulators to study driver emotional behavior, for example, road rage.Data describing characteristics of driving environments are not generally available to drivers in precise numerical format. Instead drivers perceive and describe the environment in imprecise terms such as “high speed” or “enough space to change lanes”. An important outcome of imprecision is the possibility of assigning more than one symbolic value at the same time to the same variable with different degrees of truth in each of these values. Because of fuzzy logic’s ability to handle these cases, it has been successfully used in modeling human behavior in general and driver behavior in particular (Seif El-Nasr and Skubic, 1998). The fuzzy logic has proven to be a very effective tool for handling imprecision and uncertainty, which are both very important characteristics of driving environments. This makes fuzzy logic a powerful candidate tool in most traffic engineering studies [4].In many fields of science, including biology, psychology, and so on, human observers have provided linguistic descriptions and explanations of various systems. However, to study these phenomena in a systematic manner, there is a need to construct a suitable mathematical model, a process that usually requires subtle mathematical understanding. Fuzzy modeling is a simple, direct, and natural approach for transforming the linguistic description to a mathematical model [5].In this study, we use new parameters to identify uniqueness of driving maneuver of each driver, the precision, age, and driving individuality. In modeling, the decision making process is based on three positions, one position in driving lane and two positions in opposite lane. By considering three positions, the speed, direction of car, and the steering angle, a fuzzy model (Model I) is presented for steering angle and speed control. Two models (Model II, Model III) are obtained based on fuzzy rules by using Sugeno fuzzy inference. The driver behavior is included in the model by changing the membership function of input and output variables of fuzzy rules. These membership functions are varied by applying the coefficients which are obtained by the hierarchical fuzzy system. We used two levels control for modeling. The low-level control system is responsible for modeling the steering angle and the speed variations enforced by the driver. The high-level control system is used for the decision-making process of the driver. For this purpose, first the fuzzified low level control is illustrated in Section 2. The high level control is presented in Section 3. The proposed models are illustrated in Section 4 and the simulation results are presented in Section 5. Finally Section 6 describes conclusions.


## 2. Low Level Control

In order to implement the low-level control model, a simple car’s model is required. The schematic of a four-wheel-drive (4WD) vehicle is shown in Figure1 [6].Figure 1
Schematic of a 4WD vehicle [6].The car states include the Cartesian position(x,y) centered mid-way between the rear wheels and the car's orientation denoted by (2.1), where φ is the steering angle, V is the car’s speed, and θ is the angle of the car with respect to the Xaxis and Lcar is the distance between center of rear and front wheels.(2.1)xn+1=xn+Vn×cos(θn)×Δt,yn+1=yn+Vn×sin(θn)×Δt,θn+1=θn+Vn×tan(φn)×ΔtLcar.
The driver controls V and φ. In order to model the complete low-level control procedure, we have assumed that apart from the information from the environment that the driver perceives, other information such as age and driver's individuality are influential in the driver’s control procedure. This can be formulated as(2.2)ΔV=f(xn,yn,φn,θn,Environmentn,Drivern),Δφ=f(xn,yn,φn,θn,Environmentn,Drivern),
where (xn,yn,θn,φn) determine car’s state, Environment is the information of the condition of Climate, Road, and Car, and Driveris the individual driver influence.


### 2.1. Environmental Condition

TheClimate condition is the information of luminosity, range of view, rain, temperature, and humidity. The Roadcondition is about the traffic surrounding the driver, road safety, quality of road materials, moving obstacle, and having enough signs, and finally the Car condition is the information of car's ergonomic, safety equipments performance, and agent of distraction in car. The information is considered as the input variables of fuzzy system (Figure 2).Figure 2
The fuzzy system of environmental conditions.


#### 2.1.1. Fuzzy Rule Base and Membership Functions

Questionnaires have been provided to obtain the fuzzy rules, where the effects of climate, road, and car condition in driving have been questioned separately. We chose different expert drivers (200 persons) in age, graduating diploma, precision, personality, and different vision abilities. These drivers drive with different types of cars. Each expert driver answered each question in three manners, percent value, graphic representation, and linguistic term (Table1).Table 1
A sample of driver’s answer representation.
ParameterPercent value (valper)Graphic representation (valgr)Linguistic termLuminosity60%highIn Table1, the linguistic terms very high, high, medium, low, andvery low are used and they are corresponding to 100, 80, 60, 40, and 20 (valling), respectively. The membership functions of linguistic terms for each parameter are supposed to be bell shaped as follows:(2.3)μ(x)=11+((x-c)2/d),
where x is the member of universe, cis the median, and d represents the shape factor. The median, c, is obtained based on the number of linguistic terms which are optimized by PSO algorithm (Section 2.1.2). By using collected data, the shape factor for each expert driver i (representing his/her precision) is calculated as follows: (2.4)dij=|valper,j-valgr,j|+|valper,j-valling,j|+|valgr,j-valling,j|3,
where dij is the shape factor of ith driver for the jth parameter that is used for calculating d. For example, in Table 1 we havevalper=60,valgr=61.8, and valling=80. By using (2.4), the shape factor for the represented answer is 13.33.Forn expert drivers, we have
(2.5)drefj=∑i=1ndijn.
So d is defined as
(2.6)d=drefj×(2Wunivj(Nling_termj-1)×Wref_univj)2,
where Wunivj is the range of universes for jth parameter, Nling_termj is the number of linguistic terms for jth parameter (obtained from PSO algorithm), and Wref_univj is the range of reference universe for jth parameter. The average of n values of the shape factors (obtained from (2.4)) is considered as drefj. For all of parameters, Wref_univj is fixed to [010]. The obtained information of questionnaires is considered as reference.The importance of the parameters of climate, road, and car condition varies for different people. So we use a pairwise comparison table for determining the weights of different parameters. Table2 shows a part of pair wise comparison table.Table 2
A part of compared table.
ParameterABCDA√√—Table2 shows that parameter A is more important than parameters B and C. But parameter D is more important than parameter A. The proposed method for determining weights of parameters in fuzzy rules is as follows.First arrange the parameters. First parameter is the least important. Thenai is assigned to ith parameter such that ai=i×w, where i is the priority index of parameter and w is the priority weight which is set to 2 in this study. When k parameters have equal importance, a=w×∑i/k for all of k parameters. After that, we form the priority table (T=[tij]) as follows.(i)
If ith parameter (in row i) is more important than the jth parameter (in column j), then tij=ai-aj.(ii)
If the jth parameter (in column j) is more important than the ith one (in row i), then tij=1/(aj-ai).(iii)
For diagonal elements, tii=1.Finally the weight of each parameter,Wi, is obtained as follow:
(2.7)Wi=Mi∑j=1mMj,Mi=∏j=1mtijm,
where m represents the number of parameters. The average of the obtained weights of n drivers for each parameter is considered as weight of the parameter in fuzzy rules. 										(2.8)Wparameter=∑i=1nWin.
Table 3 shows pair wise comparison of climate parameters for one of questionnaires.Table 3
An example of pair wise comparison for climate parameters.
ParameterRange of viewLuminosityRainTemperatureHumidityRange of view√√√√Luminosity—√√√Rain————Temperature——√√Humidity——√√The obtained results of Table3 show that the priority list of climate parameters is rain, temperature, and humidity, luminosity, and range of view, respectively.The elements of priority table are then calculated as represented by Table4.Table 4
The priority table of climate parameters.
ParameterRange of viewLuminosityRainTemperatureHumidityMi=∏j=15tij5Range of view128553.3145Luminosity1/216331.9332Rain1/81/611/31/30.2971Temperature1/51/33110.7248Humidity1/51/33110.7248So∑i=15Mi= 6.9944 and weight of each parameter is obtained by using (2.7) as shown in Table 5.Table 5ParametersRange of viewLuminosityRainTemperatureHumidityWeights0.47390.27640.04250.10360.1036The average of obtained weights for each parameter is used to generate fuzzy rules in Section2.1.2. The similar tables have been used for road condition and car condition in questionnaires.The general form of fuzzy rules for climate condition is as follows.If   Range of View is … and   Luminosity is … and  Rain is …and   Temperature is … and   Humidity is …, then climate condition is …For road condition:if   Traffic is … and   Road quality is … and Sign is … and   Moving obstacle is … and Safety is …,         then   Road condition is …;Finally for car condition, we have that:if   Safety equipment operation is … and Ergonomic is … and   Distract agent is …, then   Car condition is …


#### 2.1.2. Particle Swarm Optimization

Particle Swarm Optimization (PSO) is an optimization algorithm which uses properties of a swarm to find an optimal solution [7]. In this work, the swarm is represented by 100 individuals (or particles) whose values change at each iteration. The performance of each particle is measured at each position using a “fitness” function. This function increases as the optimality of the solution increases; in this way, a particle with a higher fitness is considered to fit better than the one with a lower fitness. Also, a record of the best position (pbest) for each particle, as well as the best overall position (gbest) for all particles, is kept in memory. The entire swarm then searches around the gbest solution and each of the pbest solutions, all the while trying to find even better solutions.(a) Particle Representation
In order to optimize number of fuzzy rules, the number of linguistic terms of each parameter of climate, road, and car condition is optimized using PSO. The number of linguistic terms for each input parameter is randomly selected 3, 5, or 7, so maximum number of fuzzy rules will be7m(m is the number of input variables). The number of linguistic terms of output fuzzy variable is set to 5.To optimize the number of fuzzy rules and linguistic terms, the following particle is considered for PSO:(2.9)Particle=[par_setpar_rules].
In the presented particle, the first part par_set is related to number of linguistic terms and is defined as follows:(2.10)par_set=(Nin1,Nin2,…,Ninj,…,Ninm),wherem is the number of input variables and Ninj shows the number of linguistic terms of jth input variable. The number of linguistic terms of output variable is always equal to 5. So the par_sethas m elements.The second part of particlepar_rules is (2.11)par_rules=(OR1,OR2,…,ORi,…,OR7m).
Since the number of linguistic terms of output variable is set to 5, thenORi∈{0, 1, 2, 3, 4, 5}. Suppose linguistic terms of output variable are {verybad,bad,medium,good,andverygood}, then the allele value is 0 when the corresponding rule has not been selected as fuzzy rules, 1 when output variable is very bad, 2 when it is bad, and finally 5 when output variable is very good. By considering the maximum number of fuzzy rules (7m), in each par_rule, when the number of fuzzy rules is less than 7m, other elements are considered to be zero.A simple example is considered which has 2 input variables. Both of variables have 3 linguistic terms (named Lt1, Lt2, Lt3). So the maximum of fuzzy rules is nine.All fuzzy rules are as follows.Rule1: If   input1 is Lt1and input2 is Lt1, then  output is OR1.Rule2: If   input1 is Lt1and input2 is Lt2, then  output is OR2.Rule3: If   input1 is Lt1and input2 is Lt3, then  output is OR3.Rule4: If   input1 is Lt2and input2 is Lt1, then  output is OR4.Rule5: If   input1 is Lt2and input2 is Lt2, then  output is OR5.Rule6: If   input1 is Lt2and input2 is Lt3, then  output is OR6.Rule7: If   input1 is Lt3and input2 is Lt1, then  output is OR7.Rule8: If   input1 is Lt3and input2 is Lt2, then  output is OR8.Rule9: If   input1 is Lt3and input2 is Lt3, then  output is OR9.The optimizedpar_rules are obtained by PSO algorithm as follows:(2.12)par_rules=(0,1,2,0,3,0,0,3,5,0,…,0),
where first nine values are related to fuzzy rules. By considering the optimized par_rules, we have five rules: Rule2, Rule3, Rule5, Rule8, and Rule9.(b) The Fitness Function
In the fitness function, we need to use some valid fuzzy rules. In order to generate valid fuzzy rules, we select the worse(value=0) and the best (value=1) state (verbal value) of each input variable. The linguistic terms of them are very bad and very good, respectively. For the middle state (medium), value of 0.5 is assigned. If the input variable is defined by 5 linguistic terms, the state between the worse and middle state (bad) is set to 0.25 and the state between the best and middle (good) is set to 0.75. Also the center of gravity defuzzifier is applied as follows:
(2.13)z*=∑i=1mzi×wi∑i=1mwi,
where zi and wi are the value and weight (Section 2.1.1, (2.8)) of ith input variable, respectively. All of the rules where z* gets one of values 0, 0.25, 0.5, 0.75, and 1, corresponding to linguistic terms of input variables, are considered as valid rules.For example if linguistic terms of traffic, road quality, sign, moving obstacle, and safety are considered to be medium, then values of all of them is 0.5. Then by considering appropriate weight for each input variable (Section2.1.1, (2.8), the obtained results of 200 drivers), z* will be obtained as follows:(2.14)z*=0.5×0.21+0.5×0.13+0.5×0.11+0.5×0.21+0.5×0.340.21+0.13+0.11+0.21+0.34=0.5.
The obtained value is corresponding to medium linguistic term for z*. By this way, the following valid rule is obtained.Rule: If Traffic is medium and Road quality is medium and Sign is medium and Moving obstacle is medium and Safety is medium, then Road condition is medium.Finally the fitness function used for the optimization of the membership functions is defined by(2.15)Fitness=Wb×nc+WrnR,
where nR is the number of rules, Wr is its weighting factor (Wr is set to 0.01), nc is the number of input data set which have same output for reference fuzzy rules and the rules generated by PSO, and Wb is its weighting factor (Wb is set to 1) [8].


### 2.2. Driver’s Behavior

The personality (individuality) of each person is very important in the task performance, because it affects on driver’s decisions and acts. We consider drivers personality into three groups, risky person, normal person, and attentive person. Also, people have different reactions in different ages. So we include age of driver in modeling of driver’s behavior. In addition, the precision of each person affects the calculation of distance. So we include it by considering graduating diploma and the measure of necessary precision in his work (Fuzzy systemI). Figure 3 shows the hierarchical fuzzy system which models driver behavior in decision making. For obtaining fuzzy rules in the hierarchical fuzzy system, we use the applied method to generating valid rules for calculating fitness function in PSO algorithm.Figure 3
The driver’s behavior hierarchy fuzzy system.The general form of fuzzy rule for Fuzzy systemI is as follows:if   Graduating diploma  is … and   Precision in work is …, then Precision is …For Fuzzy systemII, if   Environmental condition is … and   Precision is … and Age is … and   Personality is …,   then   Steering coefficient (Kst) is …and   Speed coefficient (Kv) is …and   Time distance coefficient (Ktd) is …By applying the obtained coefficients from proposed hierarchical fuzzy system in the membership function universes of the speed change and steering angle change also the ideal low and high speed for each person and calculating time distance with other cars (Section4), we can easily model the different behavior under take over conditions.


## 2.1. Environmental Condition

TheClimate condition is the information of luminosity, range of view, rain, temperature, and humidity. The Roadcondition is about the traffic surrounding the driver, road safety, quality of road materials, moving obstacle, and having enough signs, and finally the Car condition is the information of car's ergonomic, safety equipments performance, and agent of distraction in car. The information is considered as the input variables of fuzzy system (Figure 2).Figure 2
The fuzzy system of environmental conditions.


### 2.1.1. Fuzzy Rule Base and Membership Functions

Questionnaires have been provided to obtain the fuzzy rules, where the effects of climate, road, and car condition in driving have been questioned separately. We chose different expert drivers (200 persons) in age, graduating diploma, precision, personality, and different vision abilities. These drivers drive with different types of cars. Each expert driver answered each question in three manners, percent value, graphic representation, and linguistic term (Table1).Table 1
A sample of driver’s answer representation.
ParameterPercent value (valper)Graphic representation (valgr)Linguistic termLuminosity60%highIn Table1, the linguistic terms very high, high, medium, low, andvery low are used and they are corresponding to 100, 80, 60, 40, and 20 (valling), respectively. The membership functions of linguistic terms for each parameter are supposed to be bell shaped as follows:(2.3)μ(x)=11+((x-c)2/d),
where x is the member of universe, cis the median, and d represents the shape factor. The median, c, is obtained based on the number of linguistic terms which are optimized by PSO algorithm (Section 2.1.2). By using collected data, the shape factor for each expert driver i (representing his/her precision) is calculated as follows: (2.4)dij=|valper,j-valgr,j|+|valper,j-valling,j|+|valgr,j-valling,j|3,
where dij is the shape factor of ith driver for the jth parameter that is used for calculating d. For example, in Table 1 we havevalper=60,valgr=61.8, and valling=80. By using (2.4), the shape factor for the represented answer is 13.33.Forn expert drivers, we have
(2.5)drefj=∑i=1ndijn.
So d is defined as
(2.6)d=drefj×(2Wunivj(Nling_termj-1)×Wref_univj)2,
where Wunivj is the range of universes for jth parameter, Nling_termj is the number of linguistic terms for jth parameter (obtained from PSO algorithm), and Wref_univj is the range of reference universe for jth parameter. The average of n values of the shape factors (obtained from (2.4)) is considered as drefj. For all of parameters, Wref_univj is fixed to [010]. The obtained information of questionnaires is considered as reference.The importance of the parameters of climate, road, and car condition varies for different people. So we use a pairwise comparison table for determining the weights of different parameters. Table2 shows a part of pair wise comparison table.Table 2
A part of compared table.
ParameterABCDA√√—Table2 shows that parameter A is more important than parameters B and C. But parameter D is more important than parameter A. The proposed method for determining weights of parameters in fuzzy rules is as follows.First arrange the parameters. First parameter is the least important. Thenai is assigned to ith parameter such that ai=i×w, where i is the priority index of parameter and w is the priority weight which is set to 2 in this study. When k parameters have equal importance, a=w×∑i/k for all of k parameters. After that, we form the priority table (T=[tij]) as follows.(i)
If ith parameter (in row i) is more important than the jth parameter (in column j), then tij=ai-aj.(ii)
If the jth parameter (in column j) is more important than the ith one (in row i), then tij=1/(aj-ai).(iii)
For diagonal elements, tii=1.Finally the weight of each parameter,Wi, is obtained as follow:
(2.7)Wi=Mi∑j=1mMj,Mi=∏j=1mtijm,
where m represents the number of parameters. The average of the obtained weights of n drivers for each parameter is considered as weight of the parameter in fuzzy rules. 										(2.8)Wparameter=∑i=1nWin.
Table 3 shows pair wise comparison of climate parameters for one of questionnaires.Table 3
An example of pair wise comparison for climate parameters.
ParameterRange of viewLuminosityRainTemperatureHumidityRange of view√√√√Luminosity—√√√Rain————Temperature——√√Humidity——√√The obtained results of Table3 show that the priority list of climate parameters is rain, temperature, and humidity, luminosity, and range of view, respectively.The elements of priority table are then calculated as represented by Table4.Table 4
The priority table of climate parameters.
ParameterRange of viewLuminosityRainTemperatureHumidityMi=∏j=15tij5Range of view128553.3145Luminosity1/216331.9332Rain1/81/611/31/30.2971Temperature1/51/33110.7248Humidity1/51/33110.7248So∑i=15Mi= 6.9944 and weight of each parameter is obtained by using (2.7) as shown in Table 5.Table 5ParametersRange of viewLuminosityRainTemperatureHumidityWeights0.47390.27640.04250.10360.1036The average of obtained weights for each parameter is used to generate fuzzy rules in Section2.1.2. The similar tables have been used for road condition and car condition in questionnaires.The general form of fuzzy rules for climate condition is as follows.If   Range of View is … and   Luminosity is … and  Rain is …and   Temperature is … and   Humidity is …, then climate condition is …For road condition:if   Traffic is … and   Road quality is … and Sign is … and   Moving obstacle is … and Safety is …,         then   Road condition is …;Finally for car condition, we have that:if   Safety equipment operation is … and Ergonomic is … and   Distract agent is …, then   Car condition is …


### 2.1.2. Particle Swarm Optimization

Particle Swarm Optimization (PSO) is an optimization algorithm which uses properties of a swarm to find an optimal solution [7]. In this work, the swarm is represented by 100 individuals (or particles) whose values change at each iteration. The performance of each particle is measured at each position using a “fitness” function. This function increases as the optimality of the solution increases; in this way, a particle with a higher fitness is considered to fit better than the one with a lower fitness. Also, a record of the best position (pbest) for each particle, as well as the best overall position (gbest) for all particles, is kept in memory. The entire swarm then searches around the gbest solution and each of the pbest solutions, all the while trying to find even better solutions.(a) Particle Representation
In order to optimize number of fuzzy rules, the number of linguistic terms of each parameter of climate, road, and car condition is optimized using PSO. The number of linguistic terms for each input parameter is randomly selected 3, 5, or 7, so maximum number of fuzzy rules will be7m(m is the number of input variables). The number of linguistic terms of output fuzzy variable is set to 5.To optimize the number of fuzzy rules and linguistic terms, the following particle is considered for PSO:(2.9)Particle=[par_setpar_rules].
In the presented particle, the first part par_set is related to number of linguistic terms and is defined as follows:(2.10)par_set=(Nin1,Nin2,…,Ninj,…,Ninm),wherem is the number of input variables and Ninj shows the number of linguistic terms of jth input variable. The number of linguistic terms of output variable is always equal to 5. So the par_sethas m elements.The second part of particlepar_rules is (2.11)par_rules=(OR1,OR2,…,ORi,…,OR7m).
Since the number of linguistic terms of output variable is set to 5, thenORi∈{0, 1, 2, 3, 4, 5}. Suppose linguistic terms of output variable are {verybad,bad,medium,good,andverygood}, then the allele value is 0 when the corresponding rule has not been selected as fuzzy rules, 1 when output variable is very bad, 2 when it is bad, and finally 5 when output variable is very good. By considering the maximum number of fuzzy rules (7m), in each par_rule, when the number of fuzzy rules is less than 7m, other elements are considered to be zero.A simple example is considered which has 2 input variables. Both of variables have 3 linguistic terms (named Lt1, Lt2, Lt3). So the maximum of fuzzy rules is nine.All fuzzy rules are as follows.Rule1: If   input1 is Lt1and input2 is Lt1, then  output is OR1.Rule2: If   input1 is Lt1and input2 is Lt2, then  output is OR2.Rule3: If   input1 is Lt1and input2 is Lt3, then  output is OR3.Rule4: If   input1 is Lt2and input2 is Lt1, then  output is OR4.Rule5: If   input1 is Lt2and input2 is Lt2, then  output is OR5.Rule6: If   input1 is Lt2and input2 is Lt3, then  output is OR6.Rule7: If   input1 is Lt3and input2 is Lt1, then  output is OR7.Rule8: If   input1 is Lt3and input2 is Lt2, then  output is OR8.Rule9: If   input1 is Lt3and input2 is Lt3, then  output is OR9.The optimizedpar_rules are obtained by PSO algorithm as follows:(2.12)par_rules=(0,1,2,0,3,0,0,3,5,0,…,0),
where first nine values are related to fuzzy rules. By considering the optimized par_rules, we have five rules: Rule2, Rule3, Rule5, Rule8, and Rule9.(b) The Fitness Function
In the fitness function, we need to use some valid fuzzy rules. In order to generate valid fuzzy rules, we select the worse(value=0) and the best (value=1) state (verbal value) of each input variable. The linguistic terms of them are very bad and very good, respectively. For the middle state (medium), value of 0.5 is assigned. If the input variable is defined by 5 linguistic terms, the state between the worse and middle state (bad) is set to 0.25 and the state between the best and middle (good) is set to 0.75. Also the center of gravity defuzzifier is applied as follows:
(2.13)z*=∑i=1mzi×wi∑i=1mwi,
where zi and wi are the value and weight (Section 2.1.1, (2.8)) of ith input variable, respectively. All of the rules where z* gets one of values 0, 0.25, 0.5, 0.75, and 1, corresponding to linguistic terms of input variables, are considered as valid rules.For example if linguistic terms of traffic, road quality, sign, moving obstacle, and safety are considered to be medium, then values of all of them is 0.5. Then by considering appropriate weight for each input variable (Section2.1.1, (2.8), the obtained results of 200 drivers), z* will be obtained as follows:(2.14)z*=0.5×0.21+0.5×0.13+0.5×0.11+0.5×0.21+0.5×0.340.21+0.13+0.11+0.21+0.34=0.5.
The obtained value is corresponding to medium linguistic term for z*. By this way, the following valid rule is obtained.Rule: If Traffic is medium and Road quality is medium and Sign is medium and Moving obstacle is medium and Safety is medium, then Road condition is medium.Finally the fitness function used for the optimization of the membership functions is defined by(2.15)Fitness=Wb×nc+WrnR,
where nR is the number of rules, Wr is its weighting factor (Wr is set to 0.01), nc is the number of input data set which have same output for reference fuzzy rules and the rules generated by PSO, and Wb is its weighting factor (Wb is set to 1) [8].


## 2.1.1. Fuzzy Rule Base and Membership Functions

Questionnaires have been provided to obtain the fuzzy rules, where the effects of climate, road, and car condition in driving have been questioned separately. We chose different expert drivers (200 persons) in age, graduating diploma, precision, personality, and different vision abilities. These drivers drive with different types of cars. Each expert driver answered each question in three manners, percent value, graphic representation, and linguistic term (Table1).Table 1
A sample of driver’s answer representation.
ParameterPercent value (valper)Graphic representation (valgr)Linguistic termLuminosity60%highIn Table1, the linguistic terms very high, high, medium, low, andvery low are used and they are corresponding to 100, 80, 60, 40, and 20 (valling), respectively. The membership functions of linguistic terms for each parameter are supposed to be bell shaped as follows:(2.3)μ(x)=11+((x-c)2/d),
where x is the member of universe, cis the median, and d represents the shape factor. The median, c, is obtained based on the number of linguistic terms which are optimized by PSO algorithm (Section 2.1.2). By using collected data, the shape factor for each expert driver i (representing his/her precision) is calculated as follows: (2.4)dij=|valper,j-valgr,j|+|valper,j-valling,j|+|valgr,j-valling,j|3,
where dij is the shape factor of ith driver for the jth parameter that is used for calculating d. For example, in Table 1 we havevalper=60,valgr=61.8, and valling=80. By using (2.4), the shape factor for the represented answer is 13.33.Forn expert drivers, we have
(2.5)drefj=∑i=1ndijn.
So d is defined as
(2.6)d=drefj×(2Wunivj(Nling_termj-1)×Wref_univj)2,
where Wunivj is the range of universes for jth parameter, Nling_termj is the number of linguistic terms for jth parameter (obtained from PSO algorithm), and Wref_univj is the range of reference universe for jth parameter. The average of n values of the shape factors (obtained from (2.4)) is considered as drefj. For all of parameters, Wref_univj is fixed to [010]. The obtained information of questionnaires is considered as reference.The importance of the parameters of climate, road, and car condition varies for different people. So we use a pairwise comparison table for determining the weights of different parameters. Table2 shows a part of pair wise comparison table.Table 2
A part of compared table.
ParameterABCDA√√—Table2 shows that parameter A is more important than parameters B and C. But parameter D is more important than parameter A. The proposed method for determining weights of parameters in fuzzy rules is as follows.First arrange the parameters. First parameter is the least important. Thenai is assigned to ith parameter such that ai=i×w, where i is the priority index of parameter and w is the priority weight which is set to 2 in this study. When k parameters have equal importance, a=w×∑i/k for all of k parameters. After that, we form the priority table (T=[tij]) as follows.(i)
If ith parameter (in row i) is more important than the jth parameter (in column j), then tij=ai-aj.(ii)
If the jth parameter (in column j) is more important than the ith one (in row i), then tij=1/(aj-ai).(iii)
For diagonal elements, tii=1.Finally the weight of each parameter,Wi, is obtained as follow:
(2.7)Wi=Mi∑j=1mMj,Mi=∏j=1mtijm,
where m represents the number of parameters. The average of the obtained weights of n drivers for each parameter is considered as weight of the parameter in fuzzy rules. 										(2.8)Wparameter=∑i=1nWin.
Table 3 shows pair wise comparison of climate parameters for one of questionnaires.Table 3
An example of pair wise comparison for climate parameters.
ParameterRange of viewLuminosityRainTemperatureHumidityRange of view√√√√Luminosity—√√√Rain————Temperature——√√Humidity——√√The obtained results of Table3 show that the priority list of climate parameters is rain, temperature, and humidity, luminosity, and range of view, respectively.The elements of priority table are then calculated as represented by Table4.Table 4
The priority table of climate parameters.
ParameterRange of viewLuminosityRainTemperatureHumidityMi=∏j=15tij5Range of view128553.3145Luminosity1/216331.9332Rain1/81/611/31/30.2971Temperature1/51/33110.7248Humidity1/51/33110.7248So∑i=15Mi= 6.9944 and weight of each parameter is obtained by using (2.7) as shown in Table 5.Table 5ParametersRange of viewLuminosityRainTemperatureHumidityWeights0.47390.27640.04250.10360.1036The average of obtained weights for each parameter is used to generate fuzzy rules in Section2.1.2. The similar tables have been used for road condition and car condition in questionnaires.The general form of fuzzy rules for climate condition is as follows.If   Range of View is … and   Luminosity is … and  Rain is …and   Temperature is … and   Humidity is …, then climate condition is …For road condition:if   Traffic is … and   Road quality is … and Sign is … and   Moving obstacle is … and Safety is …,         then   Road condition is …;Finally for car condition, we have that:if   Safety equipment operation is … and Ergonomic is … and   Distract agent is …, then   Car condition is …


## 2.1.2. Particle Swarm Optimization

Particle Swarm Optimization (PSO) is an optimization algorithm which uses properties of a swarm to find an optimal solution [7]. In this work, the swarm is represented by 100 individuals (or particles) whose values change at each iteration. The performance of each particle is measured at each position using a “fitness” function. This function increases as the optimality of the solution increases; in this way, a particle with a higher fitness is considered to fit better than the one with a lower fitness. Also, a record of the best position (pbest) for each particle, as well as the best overall position (gbest) for all particles, is kept in memory. The entire swarm then searches around the gbest solution and each of the pbest solutions, all the while trying to find even better solutions.(a) Particle Representation
In order to optimize number of fuzzy rules, the number of linguistic terms of each parameter of climate, road, and car condition is optimized using PSO. The number of linguistic terms for each input parameter is randomly selected 3, 5, or 7, so maximum number of fuzzy rules will be7m(m is the number of input variables). The number of linguistic terms of output fuzzy variable is set to 5.To optimize the number of fuzzy rules and linguistic terms, the following particle is considered for PSO:(2.9)Particle=[par_setpar_rules].
In the presented particle, the first part par_set is related to number of linguistic terms and is defined as follows:(2.10)par_set=(Nin1,Nin2,…,Ninj,…,Ninm),wherem is the number of input variables and Ninj shows the number of linguistic terms of jth input variable. The number of linguistic terms of output variable is always equal to 5. So the par_sethas m elements.The second part of particlepar_rules is (2.11)par_rules=(OR1,OR2,…,ORi,…,OR7m).
Since the number of linguistic terms of output variable is set to 5, thenORi∈{0, 1, 2, 3, 4, 5}. Suppose linguistic terms of output variable are {verybad,bad,medium,good,andverygood}, then the allele value is 0 when the corresponding rule has not been selected as fuzzy rules, 1 when output variable is very bad, 2 when it is bad, and finally 5 when output variable is very good. By considering the maximum number of fuzzy rules (7m), in each par_rule, when the number of fuzzy rules is less than 7m, other elements are considered to be zero.A simple example is considered which has 2 input variables. Both of variables have 3 linguistic terms (named Lt1, Lt2, Lt3). So the maximum of fuzzy rules is nine.All fuzzy rules are as follows.Rule1: If   input1 is Lt1and input2 is Lt1, then  output is OR1.Rule2: If   input1 is Lt1and input2 is Lt2, then  output is OR2.Rule3: If   input1 is Lt1and input2 is Lt3, then  output is OR3.Rule4: If   input1 is Lt2and input2 is Lt1, then  output is OR4.Rule5: If   input1 is Lt2and input2 is Lt2, then  output is OR5.Rule6: If   input1 is Lt2and input2 is Lt3, then  output is OR6.Rule7: If   input1 is Lt3and input2 is Lt1, then  output is OR7.Rule8: If   input1 is Lt3and input2 is Lt2, then  output is OR8.Rule9: If   input1 is Lt3and input2 is Lt3, then  output is OR9.The optimizedpar_rules are obtained by PSO algorithm as follows:(2.12)par_rules=(0,1,2,0,3,0,0,3,5,0,…,0),
where first nine values are related to fuzzy rules. By considering the optimized par_rules, we have five rules: Rule2, Rule3, Rule5, Rule8, and Rule9.(b) The Fitness Function
In the fitness function, we need to use some valid fuzzy rules. In order to generate valid fuzzy rules, we select the worse(value=0) and the best (value=1) state (verbal value) of each input variable. The linguistic terms of them are very bad and very good, respectively. For the middle state (medium), value of 0.5 is assigned. If the input variable is defined by 5 linguistic terms, the state between the worse and middle state (bad) is set to 0.25 and the state between the best and middle (good) is set to 0.75. Also the center of gravity defuzzifier is applied as follows:
(2.13)z*=∑i=1mzi×wi∑i=1mwi,
where zi and wi are the value and weight (Section 2.1.1, (2.8)) of ith input variable, respectively. All of the rules where z* gets one of values 0, 0.25, 0.5, 0.75, and 1, corresponding to linguistic terms of input variables, are considered as valid rules.For example if linguistic terms of traffic, road quality, sign, moving obstacle, and safety are considered to be medium, then values of all of them is 0.5. Then by considering appropriate weight for each input variable (Section2.1.1, (2.8), the obtained results of 200 drivers), z* will be obtained as follows:(2.14)z*=0.5×0.21+0.5×0.13+0.5×0.11+0.5×0.21+0.5×0.340.21+0.13+0.11+0.21+0.34=0.5.
The obtained value is corresponding to medium linguistic term for z*. By this way, the following valid rule is obtained.Rule: If Traffic is medium and Road quality is medium and Sign is medium and Moving obstacle is medium and Safety is medium, then Road condition is medium.Finally the fitness function used for the optimization of the membership functions is defined by(2.15)Fitness=Wb×nc+WrnR,
where nR is the number of rules, Wr is its weighting factor (Wr is set to 0.01), nc is the number of input data set which have same output for reference fuzzy rules and the rules generated by PSO, and Wb is its weighting factor (Wb is set to 1) [8].


## 2.2. Driver’s Behavior

The personality (individuality) of each person is very important in the task performance, because it affects on driver’s decisions and acts. We consider drivers personality into three groups, risky person, normal person, and attentive person. Also, people have different reactions in different ages. So we include age of driver in modeling of driver’s behavior. In addition, the precision of each person affects the calculation of distance. So we include it by considering graduating diploma and the measure of necessary precision in his work (Fuzzy systemI). Figure 3 shows the hierarchical fuzzy system which models driver behavior in decision making. For obtaining fuzzy rules in the hierarchical fuzzy system, we use the applied method to generating valid rules for calculating fitness function in PSO algorithm.Figure 3
The driver’s behavior hierarchy fuzzy system.The general form of fuzzy rule for Fuzzy systemI is as follows:if   Graduating diploma  is … and   Precision in work is …, then Precision is …For Fuzzy systemII, if   Environmental condition is … and   Precision is … and Age is … and   Personality is …,   then   Steering coefficient (Kst) is …and   Speed coefficient (Kv) is …and   Time distance coefficient (Ktd) is …By applying the obtained coefficients from proposed hierarchical fuzzy system in the membership function universes of the speed change and steering angle change also the ideal low and high speed for each person and calculating time distance with other cars (Section4), we can easily model the different behavior under take over conditions.


## 3. High Level Control

### 3.1. Structure of Road and Existence Cars

Two-lane road is considered as the movement trajectory of cars. In the simulation, four cars are considered (Figure4). The A car is the car which we intend to control it by fuzzy rules; it is called Controlled car. The B car is the back car which intends to pass Controlled car and it is called BSDOL. The C car is the front car which moves in opposite lane. If C car moves in the same direction as Controlled car, then it is called FSDOL and if the direction of movement is in opposite direction, then it is called FODOL. The D car is the front car which moves in the same lane of Controlled car. If D car moves in the same direction as controlled car, then it is called FSDSL and if it is in opposite direction then it is called FODSL.Figure 4
The movement trajectory of cars.


### 3.2. Effective Cars in the Decision Making of Driver

When a person drives a car on the road, movements of other cars affect his/her decision making. For example, FODOL is more important than FSDOL car. When driver decides to pass FSDSL car, location of BSDOL and FODOL is very important. The three important cars in decision making of driver are shown in Figure5.The situations of important cars.
(a)
Controlled car is on the right lane(b)
Controlled car is on the left lane.


### 3.3. Decision-Making Process

#### 3.3.1. Road Partitions in Decision Making of Driver

Drivers drive in different positions of road. When a driver intends to pass the leading car, he/she moves toward the middle of road while in low speed and dangerous conditions, the car moves toward the shoulder of road. So in decision making, we divide the road to four divisions:Left lane, Middle lane, Right lane, and Shoulder of road laneas shown in Figure 6 and summarized in Table 6. Among four decision lanes, Middle lane and Shoulder of lane are the transient lanes. A driver is driving in the right lane and only when he/she is passing the leading car, he/she drives in the left lane.Table 6
Road division for decision making.
Left laney6≤yc<y7y6=y5+(W_car/2),y7=y8-(W_car/2)Right laney3≤yc<y4y3=y2+(W_car/2),y4=y5-(W_car/2),y6=y5+(W_car/2)Middle laney4<yc<y6Shoulder  of roady1<yc<y3y1=y2-(W_car/2),y3=y2+(W_car/2)Figure 6
Road divisions in decision making of driver.In Table6, y2 is start position of road, y8 is end position of road, y5 is middle of road (Figure 6), W_car is the width of car, and yc is position of Controlled car.


#### 3.3.2. Fuzzy Rule Base for Decision Making of Driver

The decision-making process is categorized into four scenarios.(1) Right lane
(i)Staying in the same lane and continuing the path(a)
No car is in front. The car continues its path.(b)
A car is in front and the time distance with it is low, the driver starts to make a decision based on his/her desired speed, safety priorities but FODOL car is near or there is BSDOL car, then the driver decreases the car’s speed and continues the path.
(ii)Going to the shoulder of road
A car is in front and the time distance with it is very low; but FODOL car is near and BSDOL car is near. So the takeover from theleft lane is impossible. In order to avoid collision, the driver must move the car to the shoulder of road.
(iii)Going to Middle lane to passing
When the driver decides to change lane and overtake, he/she moves the car to themiddle lane.(2) Middle lane
As mentioned before, this lane is a transient lane. If the takeover conditions are satisfied, the driver increases the speed and continues with the same direction to enter theleft lane. Otherwise he/she decides to stay in Middle lane or to return to right lane.
After taking over, driver with the same speed from this lane enters toright lane.(3) Left lane
(i)
Before takingover, if the takeover conditions are satisfied, the driver continues the path with high speed. Otherwise he/she goes toMiddle lane and decides to stay there until the takeover conditions are provided or he/she returns to rightlane.
(ii)
After takingover, the driver with the same speed from this lane goes toMiddle lane in order to go to the rightlane.(4) Shoulder of road lane
As mentioned before, a driver in order to avoid collision goes to this lane. So he/she must stay in this lane until he/she could return.


## 3.1. Structure of Road and Existence Cars

Two-lane road is considered as the movement trajectory of cars. In the simulation, four cars are considered (Figure4). The A car is the car which we intend to control it by fuzzy rules; it is called Controlled car. The B car is the back car which intends to pass Controlled car and it is called BSDOL. The C car is the front car which moves in opposite lane. If C car moves in the same direction as Controlled car, then it is called FSDOL and if the direction of movement is in opposite direction, then it is called FODOL. The D car is the front car which moves in the same lane of Controlled car. If D car moves in the same direction as controlled car, then it is called FSDSL and if it is in opposite direction then it is called FODSL.Figure 4
The movement trajectory of cars.


## 3.2. Effective Cars in the Decision Making of Driver

When a person drives a car on the road, movements of other cars affect his/her decision making. For example, FODOL is more important than FSDOL car. When driver decides to pass FSDSL car, location of BSDOL and FODOL is very important. The three important cars in decision making of driver are shown in Figure5.The situations of important cars.
(a)
Controlled car is on the right lane(b)
Controlled car is on the left lane.


## 3.3. Decision-Making Process

### 3.3.1. Road Partitions in Decision Making of Driver

Drivers drive in different positions of road. When a driver intends to pass the leading car, he/she moves toward the middle of road while in low speed and dangerous conditions, the car moves toward the shoulder of road. So in decision making, we divide the road to four divisions:Left lane, Middle lane, Right lane, and Shoulder of road laneas shown in Figure 6 and summarized in Table 6. Among four decision lanes, Middle lane and Shoulder of lane are the transient lanes. A driver is driving in the right lane and only when he/she is passing the leading car, he/she drives in the left lane.Table 6
Road division for decision making.
Left laney6≤yc<y7y6=y5+(W_car/2),y7=y8-(W_car/2)Right laney3≤yc<y4y3=y2+(W_car/2),y4=y5-(W_car/2),y6=y5+(W_car/2)Middle laney4<yc<y6Shoulder  of roady1<yc<y3y1=y2-(W_car/2),y3=y2+(W_car/2)Figure 6
Road divisions in decision making of driver.In Table6, y2 is start position of road, y8 is end position of road, y5 is middle of road (Figure 6), W_car is the width of car, and yc is position of Controlled car.


### 3.3.2. Fuzzy Rule Base for Decision Making of Driver

The decision-making process is categorized into four scenarios.(1) Right lane
(i)Staying in the same lane and continuing the path(a)
No car is in front. The car continues its path.(b)
A car is in front and the time distance with it is low, the driver starts to make a decision based on his/her desired speed, safety priorities but FODOL car is near or there is BSDOL car, then the driver decreases the car’s speed and continues the path.
(ii)Going to the shoulder of road
A car is in front and the time distance with it is very low; but FODOL car is near and BSDOL car is near. So the takeover from theleft lane is impossible. In order to avoid collision, the driver must move the car to the shoulder of road.
(iii)Going to Middle lane to passing
When the driver decides to change lane and overtake, he/she moves the car to themiddle lane.(2) Middle lane
As mentioned before, this lane is a transient lane. If the takeover conditions are satisfied, the driver increases the speed and continues with the same direction to enter theleft lane. Otherwise he/she decides to stay in Middle lane or to return to right lane.
After taking over, driver with the same speed from this lane enters toright lane.(3) Left lane
(i)
Before takingover, if the takeover conditions are satisfied, the driver continues the path with high speed. Otherwise he/she goes toMiddle lane and decides to stay there until the takeover conditions are provided or he/she returns to rightlane.
(ii)
After takingover, the driver with the same speed from this lane goes toMiddle lane in order to go to the rightlane.(4) Shoulder of road lane
As mentioned before, a driver in order to avoid collision goes to this lane. So he/she must stay in this lane until he/she could return.


## 3.3.1. Road Partitions in Decision Making of Driver

Drivers drive in different positions of road. When a driver intends to pass the leading car, he/she moves toward the middle of road while in low speed and dangerous conditions, the car moves toward the shoulder of road. So in decision making, we divide the road to four divisions:Left lane, Middle lane, Right lane, and Shoulder of road laneas shown in Figure 6 and summarized in Table 6. Among four decision lanes, Middle lane and Shoulder of lane are the transient lanes. A driver is driving in the right lane and only when he/she is passing the leading car, he/she drives in the left lane.Table 6
Road division for decision making.
Left laney6≤yc<y7y6=y5+(W_car/2),y7=y8-(W_car/2)Right laney3≤yc<y4y3=y2+(W_car/2),y4=y5-(W_car/2),y6=y5+(W_car/2)Middle laney4<yc<y6Shoulder  of roady1<yc<y3y1=y2-(W_car/2),y3=y2+(W_car/2)Figure 6
Road divisions in decision making of driver.In Table6, y2 is start position of road, y8 is end position of road, y5 is middle of road (Figure 6), W_car is the width of car, and yc is position of Controlled car.


## 3.3.2. Fuzzy Rule Base for Decision Making of Driver

The decision-making process is categorized into four scenarios.(1) Right lane
(i)Staying in the same lane and continuing the path(a)
No car is in front. The car continues its path.(b)
A car is in front and the time distance with it is low, the driver starts to make a decision based on his/her desired speed, safety priorities but FODOL car is near or there is BSDOL car, then the driver decreases the car’s speed and continues the path.
(ii)Going to the shoulder of road
A car is in front and the time distance with it is very low; but FODOL car is near and BSDOL car is near. So the takeover from theleft lane is impossible. In order to avoid collision, the driver must move the car to the shoulder of road.
(iii)Going to Middle lane to passing
When the driver decides to change lane and overtake, he/she moves the car to themiddle lane.(2) Middle lane
As mentioned before, this lane is a transient lane. If the takeover conditions are satisfied, the driver increases the speed and continues with the same direction to enter theleft lane. Otherwise he/she decides to stay in Middle lane or to return to right lane.
After taking over, driver with the same speed from this lane enters toright lane.(3) Left lane
(i)
Before takingover, if the takeover conditions are satisfied, the driver continues the path with high speed. Otherwise he/she goes toMiddle lane and decides to stay there until the takeover conditions are provided or he/she returns to rightlane.
(ii)
After takingover, the driver with the same speed from this lane goes toMiddle lane in order to go to the rightlane.(4) Shoulder of road lane
As mentioned before, a driver in order to avoid collision goes to this lane. So he/she must stay in this lane until he/she could return.


## 4. Proposed Models

### 4.1. The Fuzzy Modeling

#### 4.1.1. Model I

By considering estimated time distances with cars in three mentioned positions (Figure5), and information about the speed, movement direction, and the steering angle of car, the following fuzzy model for controlling steering angle and speed is obtained.In this model, the general form of fuzzy rules is as follows.Rule i: ifTdBSDOLis … andTdFSLis … andTdFOLis … and V is … andDiris … andφis … thenΔvis … andΔφis …,whereTdBSDOL is the time distance of Controlledcar with BSDOL car, TdFSL is the time distance with the front car moving in the same lane (FSDSL or FODSL car), TdFOL is the time distance with the car which is moving in the opposite lane (FSDOL or FODOL car), Vis the speed of Controlledcar, Dir is the moving direction of Controlledcar, and φ is its steering angle. These are input variables of fuzzy rules. The output variables are the change of speed and changing on direction of steering.Each of the input variablesTdBSDOL, TdFSL, and TdFOL has four linguistic terms: very low, low, medium, and high. In fuzzy rules, we have
(4.1)TdFSL={TdFSDSLifFSDSLexist,TdFODSLifFODSLexist,TdFOL={TdFSDOLifFSDOLexist,TdFODOLifFODOLexist.
The speed has three linguistic terms: low, medium, and high. The car direction and the steering angle direction have five linguistic terms (very right, right, zero, left, and very left). The changes of steering angle direction and speed have five linguistic terms. All of membership function is defined for a normaldriver who drives according to driving laws. For including driver behavior, the membership function is changed by obtaining coefficients of the hierarchical fuzzy system which is represented in following.


#### 4.1.2. The Membership Function of Time Distance with Other Cars

As mentioned, the membership function of time distance with other cars is defined for anormaldriver who drives according to driving laws. For example, membership functions of time distance with FSDSL car for three persons with different Ktd are shown in Figure 7.The membership function of time distance betweenControlled car and FSDSL car.
(a)
normaldriver (Ktd=1)(b)
Person withKtd=0.5(c)
Person withKtd=2In all of membership functions of time distance with other cars, three points of membership functions are important.(i)
The point where the membership of second linguistic term (low) begins to increase from zero. It is called P1.(ii)
The point of second linguistic term (low) at which the membership returns to zero. It is called P2.(iii)
The point of third linguistic term (medium) at which the membership returns to zero. It is called P3.We formed the time distance vector asVectd.=[P1P2P3].For example, in Figure7(a), Vectd.=[4812]. For modeling different behaviors of driver, we apply the coefficient for time distance vector, Ktd, obtained by hierarchical fuzzy system.By consideringKtd, the purposed time distance vectors (Vectd) for different drivers are shown in Table 7. In Table 7, we have(4.2)q={(Ktd)-1,Ktd≥1,Ktd,Ktd<1.
After obtaining Vectd with other cars, we have
(4.3)μveryloworhigh(x)=max[min(x-ab-a,1,d-xd-c),0],μlowormedium(x)=max[min(x-ab-a,c-xc-b),0].
The coefficients (a,b,c,d) of membership functions for time distance with other cars which are obtained by (4.3) are represented in Table 8,Table 7
Time distance vectors for different drivers.
Left laneRight laneVectd(FSDSL)Ktd*[135]Ktd*[4/q8/q12]Vectd(FSDOL)Ktd*[358]Ktd*[137]Vectd(FODSL)Ktd*[246]Ktd*[258]Vectd(FODOL)Ktd*[3720]Ktd*[3715]Vectd(BSDOL)Ktd*[0.5/q2/q7]Ktd*[31015]Table 8
Coefficients of fuzzy membership functions for time distance with other cars.
Linguistic termsabcdvery low00P1Center1LowP1Center1P2—MediumCenter1Center2P3—HighCenter2P3P2 + P3P2 + P3in which(4.4)Center1=P1+P22,Center2=P3+Center12.


#### 4.1.3. The Membership Function of Speed of Car

The coefficients(a,b,c,d) of membership functions for speed are obtained by (4.3) and are represented in Table 9,Table 9
Coefficients of fuzzy membership functions for speed of car.
Linguistic termsabcdLow00LvCenterMediumLvCenterHv—HighCenterHvLv + HvLv + Hvin which(4.5)Center=Lv+Hv2,Hv=1+Kv×Hvn3,Lv=Kv×Lvn.Lvn is the lowest speed and Hvn is the highest speed for normaldriver. Lv is the lowest speed and Hv is the highest speed for different driver.


#### 4.1.4. The Membership Function of Change of Speed

The change of speed has five linguistic terms (very decrease, decrease, not change, increase, and very increase). The coefficients (a,b,c,d) of membership functions for change of speed which are obtained by (4.3) are represented in Table 10,Table 10
Coefficients of fuzzy membership functions for change of speed of car.
Linguistic termsabcdvery decreaseCenter(1)Center(1)Center(1)+DvCenter(2)+0.8DvdecreaseCenter(1)Center(2)Center(3)—not changeCenter(3)-(DspF/10)Center(3)Center(3)+(DspF/10)—increaseCenter(3)Center(4)Center(5)—very increaseCenter(4)-0.8DvCenter(5)-DvCenter(5)Center(5)in which:(4.6)Center(i)=(DspF-DspI)×(i-1)Nling-1+DspI,Nling=5,Dv=0.15.
DspI and DspF are the initial and end point of universes of the speed change, respectively.(4.7)DspI=Kv×DspIn,DspF=Kv×DspFn,
DspIn and DspFn are defined for normaldriver (DspIn=-5km⁄h, DspFn=5km⁄h) and Kv is the coefficient speed which is obtained from the hierarchical fuzzy system.


#### 4.1.5. The Membership Function of Change of Steering Angle

The change of steering angle has five linguistic terms (very right, right, not change, left, and very left). The coefficients (a,b,c,d) of membership functions for change of steering angle which are obtained by (4.3) are represented in Table 11,Table 11
Coefficients of fuzzy membership functions for change of steering angle.
Linguistic termsabcdvery rightCenter(1)Center(1)Center(1)+DCenter(2)+0.8DrightCenter(1)+2.5DCenter(2)+2DCenter(3)not changeCenter(3)-0.25DCenter(3)Center(3)+0.25D—leftCenter(3)Center(4)-2DCenter(5)-2.5D—very leftCenter(4)-0.8DCenter(5)-DCenter(5)Center(5)in which(4.8)Center(i)=(DstF-DstI)×(i-1)Nling-1+DstI,D=0.4,Nling=5,
DstI and DstF are the initial and end point of universes of steering angle change, respectively.(4.9)DstI=Kst×DstIn,DstF=Kst×DstFn,
DspIn and DspFn are defined for normaldriver (DstIn=-3deg,DstFn=3deg) and Kst is the coefficient steering angle which is obtained from the hierarchical fuzzy system.


### 4.2. From Fuzzy Model to Mathematical Model

After transforming the linguistic descriptions into fuzzy rules, Sugeno fuzzy inference has been applied to obtain the mathematical model during passing. We have applied fuzzy rule base of decision making which is used bynormal driver during passing, to obtain Model II and Model III. Both models have been obtained based on fuzzy rules. Both models have three linguistic terms for steering angle and direction of car. But Model II has two linguistic terms and Model III has four linguistic terms for estimating the time distances with other cars. The models are obtained as follows.


#### 4.2.1. Model II

(1) Right Lane
When time distance with FSDSL car is low, then the driver intends to take over. So the decision of passing is interpreted by fuzzy rules as follow:
(i) if TdFSDSL is low, then D•pass=Y;
(ii) if  TdFSDSL is high, then  D•pass=N,
whereTdFSDSL is time distance with FSDSL car and Dpass is decision for passing. Also Y and N are positive values and Y>N(Y=0.95,N=0.05), where dot symbol over each term indicates its differentiation. Here D•pass means deviation in decision for passing in time unit.
The possibility of passing is interpreted by fuzzy rules as follows:
(i) if TdBSDOL is low or TdFODOL is low, then P•pass=N;
(ii) if TdBSDOL is high and TdFODOL is high, then  P•pass=Y,
wherePpass is possibility of passing, TdBSDOL is time distance with BSDOL car and TdFODOL is time distance with FODOL car. P•pass represents the deviation in possibility of passing in time unit.
By considering decision and possibility of passing, the pass is interpreted by the following rules:
(i) if Ppass is low, then P•ass=N;
(ii) if Ppass is high and Dpass is low, then P•ass=N;
(iii) if Ppass is high and Dpass  is high, then P•ass=Y.
The time distance with BSDOL, FSDSL, and FODOL car has two linguistic terms,low and high. The membership functions of them for low have been obtained by
(4.10)low(x)=11+|(x-c)/a|2b,
where a,b, and c coefficients are shown in Table 12. Also (4.11) has been used for memberships of high:
(4.11)high(x)=1-low(x).
The same membership functions are applied for Ppass,Dpass, and Pass.Table 12
Coefficients of fuzzy membership functions for time distance with other cars, passing, and return.
Right laneLeft laneabcabcTime distance with BSDOL640230Time distance with FSDSL330230Time distance with FODOL750670Ppass, Dpass, Pass790———Dret, Ret———790By applying Sugeno fuzzy inference, the model ofDpass,Ppass, and Pass will be obtained as [9](4.12)D•pass=N+(Y-N)×low(TdFSDSL),P•pass=Y+(N-Y)×low(TdBSDOL)+low(TdFODOL)1+low(TdBSDOL)×low(TdFODOL),P•ass=N+(Y-N)×high(Ppass)×high(Dpass).
Finally, the driver continues the path or goes to Middle lane for passing. If he/she continues the path, the angle of car’s direction is hold unchanged and in the case of passing the leading car, it is moved toward the left side. The applied fuzzy rules for passing are summarized as follows:(i) if car goes to the left, then Δφ•=-Δφ;(ii) if car goes straight ahead or goes to the right, then Δφ•=L-Δφ,whereΔφ is change of steering angle, R and L are negative and positive values of steering angle, respectively (R=-0.7,L=0.7(in degree)).When the driver must continue the path, fuzzy rules are summarized as follows:(i) if car goes to the left, then Δφ•=R-Δφ;(ii) if car goes straight ahead, then Δφ•=-Δφ;(iii) if car goes to the right, then Δφ•=L-Δφ.The steering angle and direction of car are defined by three linguistic terms (“left”, “zero”, “right”). The membership functions of them are shown in Figure 8.Figure 8
The membership function of direction and steering angle of car in Model II and Model III.For speed change of car, fuzzy rules are(i) if speed of car is decreased, then ΔV•=Lv-ΔV;(ii) if speed of car is fixed, then ΔV•=-ΔV;(iii) if speed of car is increased, then ΔV•=Hv-ΔV,whereΔV is speed change of car, and Lv, and Hv are the lowest and the highest values of car’s speed, respectively, (Lv = 20 Km/h, Hv = 80 Km/h for normaldriver).InModel II, the changes of steering angle and car’s speed are obtained from fuzzy rules as follows:(4.13)Δφ•=left(Dir)×[-Δφ×summf(φ)+R×(left(φ)+zero(φ))]+zero(Dir)×[-Δφ×summf(φ)+R×left(φ)+L×right(φ)]+right(Dir)×[-Δφ×summf(φ)+L×(zero(φ)+right(φ))]+high(pass)×{left(Dir)×(-R×zero(φ)+L×right(φ))+zero(Dir)×(-R×left(φ)+L×zero(φ))+L×right(Dir)×left(φ)},ΔV•=-ΔV×summf(V)+Hv×low(V)+Hv×med(V)×low(Dpass)+low(Ppass)×[Lv×(high(V)+med(V))-Hv×low(V)]+low(Dpass)×low(Ppass)×[Hv×low(V)-Lv×(med(V)+high(V))],in which(4.14)summf(φ)=left(φ)+zero(φ)+right(φ),summf(V)=low(V)+med(V)+high(V),
where Dir is direction of Controlled car and left(x), zero(x), right(x), low(x), med(x), and high(x) show the member of x in left, zero, right, low, med, and high membership functions, respectively.(2) Left lane
We categorize this lane into two stages: before passing and after passing the leading car. In both of them, we check the return conditions. If FODSL car is near, the driver must return to the right lane. For returning to right lane, fuzzy rules are
(i) If TdFODSL is low, then D•ret=Y;
(ii) If TdFODSL is high, then D•ret=N,
whereTdFODSL is time distance with FODSL car and Dret is the decision for returning to right lane.As we know, if before passing, FSDOL car increases speed and becomes far, then driver must return to right lane. So before passing, we have the fuzzy rules as follows:(i)
if TdFSDOL is low and Dret is low, then R•etb=N;(ii)
if TdFSDOL is high and Dret is low, then R•etb=Y;(iii)
if Dret is high, then R•etb=Y,whereRetb denotes the return to right lane before passing and TdFSDOL is the time distance with FSDOL car. After passing, when distance with BSDOL is sufficient then the driver returns to right lane. So after passing, the fuzzy rules are as follows: (i)
if TdBSDOL is low and Dret is high, then R•eta=Y;(ii)
if TdBSDOL is low and Dret is low, then R•eta=N;(iii)
if TdBSDOL is high, then R•eta=Y,whereReta denotes return to right lane after passing. The membership functions for time distance with FODSL, FSDOL, and BSDOL cars, Ret and Dret are obtained by (4.10) and (4.11) with coefficients represented in Table 12.By applying Sugeno fuzzy inference, the models of Dret and Ret are obtained as(4.15)D•ret=N+(Y-N)×low(TdFODSL),R•etb=Y+(N-Y)×low(Dret)×low(TdFSDOL),R•eta=Y+(N-Y)×low(Dret)×low(TdBSDOL).Finally, the driver continues the path or goes toMiddle lane to return. If he/she continues the path, the fuzzy rules for continuing the path (as mentioned for Right lane) is applied and in the case of returning to the right lane, the following fuzzy rules are applied:(i)
if car goes to the left or goes straight ahead, thenΔφ•=R-Δφ;(ii)
if car goes to the right, thenΔφ•=-Δφ.Fuzzy rules of car’s speed inLeft lane are similar to that of Right lane. Finally the models of changes of steering angle and speed are obtained as follows: (4.16)Δφ•=left(Dir)×[-Δφ×summf(φ)+R×(left(φ)+zero(φ))]+zero(Dir)×[-Δφ×summf(φ)+R×left(φ)+L×right(φ)]+right(Dir)×[-Δφ×summf(φ)+L×(zero(φ)+right(φ))]+high(Ret)×{R×left(Dir)×right(φ)+zero(Dir)×[R×zero(φ)-L×right(φ)]+right(Dir)×[R×left(φ)-L×zero(φ)]},ΔV•=-ΔV×summf(V)+Hv×(med(V)+low(V))+high(Ret)×[Lv×high(V)-Hv×(med(V)+low(V))].(3) Middle Lane
As mentioned before, this lane is a transient lane. If conditions for overtaking are satisfied, the driver increases the speed and continues in the same direction to enter the left lane. In this case, the fuzzy rules ofRight lane are applied and the models of changing steering angle and speed of car are
(4.17)Δφ•=left(Dir)×[-Δφ×summf(φ)+R×left(φ)+L×right(φ)]+zero(Dir)×[-Δφ×summf(φ)+L×(zero(φ)+right(φ))]+right(Dir)×(L-Δφ)×summf(φ),ΔV•=-ΔV×summf(V)+Hv×[low(V)+med(V)].
After overtaking, if the return conditions are satisfying, driver enters with the same speed from this lane to right lane. In this case when the return conditions are satisfied, the fuzzy rules of Left lane are applied. Therefore, changes of steering angle and speed of car are obtained as
(4.18)Δφ•=left(Dir)×(R-Δφ)×summf(φ)+zero(Dir)×[-Δφ×summf(φ)+R×(zero(φ)+left(φ))]+right(Dir)×[-Δφ×summf(φ)+R×left(φ)+L×right(φ)],ΔV•=-ΔV×summf(V)+Lv×high(V).


#### 4.2.2. Model III

As mentioned before, we apply the membership functions of the time distances with BSDOL, FSDSL, and FODOL which are used inModel I.(1) Right lane
In this model, when a person drives in right lane, passing is based on time distance with BSDOL, FSDSL, and FODOL cars which are represented, respectively, asTdB, TdFS, and TdFO. So we have
(4.19)summf(TdB)=vlow(TdB)+low(TdB)+med(TdB)+high(TdB),summf(TdFO)=vlow(TdFO)+low(TdFO)+med(TdFO)+high(TdFO),summf(TdFS)=vlow(TdFS)+low(TdFS)+med(TdFS)+high(TdFS),p=high(TdB)×high(TdFO)×(low(TdFS)+vlow(TdFS)),r=high(TdB)×[(high(TdFS)+med(TdFS))×summf(TdFO)+(low(TdFS)+vlow(TdFS))×(vlow(TdFO)+low(TdFO)+med(TdFO))]+(med(TdB)+low(TdB)+vlow(TdB))×summf(TdFS)×summf(TdFO).
Then,
(4.20)Pass•=Y×p+N×rp+r.
Because of applying the membership functions and fuzzy rules of the change of steering angle in Model II, the change of steering angle model is the obtained model in Model II. By applying Sugeno fuzzy inference, the change of speed model is obtained as follows. 											(4.21)ΔV•=high(TdB)×h+med(TdB)×m+low(TdB)×l+vlow(TdB)×vlsummf(TdB)×summf(TdFS)×summf(TdFO)×summf(V),
where
(4.22)h=high(TdFS)×summf(TdFO)×(-ΔV×high(V)+(med(V)+low(V))×(Hv-ΔV))+med(TdFS)×high(TdFO)×(-ΔV×high(V)+(med(V)+low(V))×(Hv-ΔV))+med(TdFS)×(low(TdFO)+med(TdFO))×(high(V)+med(V))×(Lv-ΔV)-ΔV×low(V))-ΔV×(med(TdFS)×vlow(TdFO)+low(TdFS)×high(TdFO))×summf(V)+(Lv-ΔV)×summf(V)×(summf(TdFO)×(low(TdFS)+vlow(TdFS))-low(TdFS)×high(TdFS)),m=(high(TdFS)×summf(TdFO)+med(TdFS)×(high(TdFO)+med(TdFO)))×(-ΔV×high(V)+(med(V)+low(V))×(Hv-ΔV))+med(TdFS)×low(TdFO)×((high(V)+med(V))×(Lv-ΔV)-ΔV×low(V))-med(TdFS)×vlow(TdFO)×summf(V)×ΔV+summf(TdFO)×summf(V)×(vlow(TdFS)×(Lv-ΔV)-low(TdFS)×ΔV),l=summf(TdFO)×summf(V)×[(low(TdFS)+vlow(TdFS))×(Lv-ΔV)-high(TdFS)×ΔV]+med(TdFS)×high(TdFO)×((high(V)+med(V))×(Lv-ΔV)-low(V)×ΔV)+med(TdFS)×(summf(TdFO)-high(TdFO))×(high(V)×(Lv-ΔV)-(med(V)+low(V))×ΔV),vl=-(high(TdFS)+med(TdFS))×(high(TdFO)+med(TdFO))×(high(V)+med(V)+low(V))×ΔV+(high(TdFS)×low(TdFO)+low(TdFS)×(summf(TdFO)-vlow(TdFO)))×summf(V)×(Lv-ΔV)+(high(TdFS)×vlow(TdFO)+vlow(TdFS)×summf(TdFO)+(med(TdFS)+low(TdFS))×vlow(TdFO))×summf(V)×(Lv-ΔV).(2) Middle lane
When from the diving lane the car enters toMiddle lane, the models are
(4.23)ΔV•=-high(V)×ΔV+(med(V)+low(V))×(Hv-ΔV)summf(V),Δφ•=0.
After overtaking, because of applying the fuzzy rules and the membership functions of the change of steering angle in Model II, the change of steering angle model is the obtained model in Model II. The change of speed is
(4.24)ΔV•=0.(3) Left lane
The return to the driving lane is as follows:(4.25)Ret•=Y×p+N×rp+r,
where
(4.26)p=(high(TdB)+med(TdB))×(summf(TdFO)×(vlow(TdFS)+low(TdFS))+(high(TdFO)+med(TdFO))×(high(TdFS)+med(TdFS))+low(TdFO)×med(TdFS))+low(TdB)×(summf(TdFO)×vlow(TdFS)+low(TdFO)×med(TdFS))+vlow(TdB)×(summf(TdFO)×(low(TdFS)+vlow(TdFS))+med(TdFO)×(low(TdFS)+vlow(TdFS))+low(TdFO)×(summf(TdFS)-high(TdFS))+vlow(TdFO)×(low(TdFS)+vlow(TdFS))),r=(high(TdB)+med(TdB))×(low(TdFO)×high(TdFS)+vlow(TdFO)×(high(TdFS)+med(TdFS)))+low(TdB)×(summf(TdFO)×(summf(TdFS)-vlow(TdFS))-low(TdFO)×med(TdFS))+vlow(TdB)×(summf(TdFO)×high(TdFS)+(summf(TdFO)-low(TdFO))×med(TdFS)).The change of steering angle model is the obtained model inModel II. The change of speed model is(4.27)ΔV•=-ΔV+Hv×(med(V)+low(V))summf(V).


## 4.1. The Fuzzy Modeling

### 4.1.1. Model I

By considering estimated time distances with cars in three mentioned positions (Figure5), and information about the speed, movement direction, and the steering angle of car, the following fuzzy model for controlling steering angle and speed is obtained.In this model, the general form of fuzzy rules is as follows.Rule i: ifTdBSDOLis … andTdFSLis … andTdFOLis … and V is … andDiris … andφis … thenΔvis … andΔφis …,whereTdBSDOL is the time distance of Controlledcar with BSDOL car, TdFSL is the time distance with the front car moving in the same lane (FSDSL or FODSL car), TdFOL is the time distance with the car which is moving in the opposite lane (FSDOL or FODOL car), Vis the speed of Controlledcar, Dir is the moving direction of Controlledcar, and φ is its steering angle. These are input variables of fuzzy rules. The output variables are the change of speed and changing on direction of steering.Each of the input variablesTdBSDOL, TdFSL, and TdFOL has four linguistic terms: very low, low, medium, and high. In fuzzy rules, we have
(4.1)TdFSL={TdFSDSLifFSDSLexist,TdFODSLifFODSLexist,TdFOL={TdFSDOLifFSDOLexist,TdFODOLifFODOLexist.
The speed has three linguistic terms: low, medium, and high. The car direction and the steering angle direction have five linguistic terms (very right, right, zero, left, and very left). The changes of steering angle direction and speed have five linguistic terms. All of membership function is defined for a normaldriver who drives according to driving laws. For including driver behavior, the membership function is changed by obtaining coefficients of the hierarchical fuzzy system which is represented in following.


### 4.1.2. The Membership Function of Time Distance with Other Cars

As mentioned, the membership function of time distance with other cars is defined for anormaldriver who drives according to driving laws. For example, membership functions of time distance with FSDSL car for three persons with different Ktd are shown in Figure 7.The membership function of time distance betweenControlled car and FSDSL car.
(a)
normaldriver (Ktd=1)(b)
Person withKtd=0.5(c)
Person withKtd=2In all of membership functions of time distance with other cars, three points of membership functions are important.(i)
The point where the membership of second linguistic term (low) begins to increase from zero. It is called P1.(ii)
The point of second linguistic term (low) at which the membership returns to zero. It is called P2.(iii)
The point of third linguistic term (medium) at which the membership returns to zero. It is called P3.We formed the time distance vector asVectd.=[P1P2P3].For example, in Figure7(a), Vectd.=[4812]. For modeling different behaviors of driver, we apply the coefficient for time distance vector, Ktd, obtained by hierarchical fuzzy system.By consideringKtd, the purposed time distance vectors (Vectd) for different drivers are shown in Table 7. In Table 7, we have(4.2)q={(Ktd)-1,Ktd≥1,Ktd,Ktd<1.
After obtaining Vectd with other cars, we have
(4.3)μveryloworhigh(x)=max[min(x-ab-a,1,d-xd-c),0],μlowormedium(x)=max[min(x-ab-a,c-xc-b),0].
The coefficients (a,b,c,d) of membership functions for time distance with other cars which are obtained by (4.3) are represented in Table 8,Table 7
Time distance vectors for different drivers.
Left laneRight laneVectd(FSDSL)Ktd*[135]Ktd*[4/q8/q12]Vectd(FSDOL)Ktd*[358]Ktd*[137]Vectd(FODSL)Ktd*[246]Ktd*[258]Vectd(FODOL)Ktd*[3720]Ktd*[3715]Vectd(BSDOL)Ktd*[0.5/q2/q7]Ktd*[31015]Table 8
Coefficients of fuzzy membership functions for time distance with other cars.
Linguistic termsabcdvery low00P1Center1LowP1Center1P2—MediumCenter1Center2P3—HighCenter2P3P2 + P3P2 + P3in which(4.4)Center1=P1+P22,Center2=P3+Center12.


### 4.1.3. The Membership Function of Speed of Car

The coefficients(a,b,c,d) of membership functions for speed are obtained by (4.3) and are represented in Table 9,Table 9
Coefficients of fuzzy membership functions for speed of car.
Linguistic termsabcdLow00LvCenterMediumLvCenterHv—HighCenterHvLv + HvLv + Hvin which(4.5)Center=Lv+Hv2,Hv=1+Kv×Hvn3,Lv=Kv×Lvn.Lvn is the lowest speed and Hvn is the highest speed for normaldriver. Lv is the lowest speed and Hv is the highest speed for different driver.


### 4.1.4. The Membership Function of Change of Speed

The change of speed has five linguistic terms (very decrease, decrease, not change, increase, and very increase). The coefficients (a,b,c,d) of membership functions for change of speed which are obtained by (4.3) are represented in Table 10,Table 10
Coefficients of fuzzy membership functions for change of speed of car.
Linguistic termsabcdvery decreaseCenter(1)Center(1)Center(1)+DvCenter(2)+0.8DvdecreaseCenter(1)Center(2)Center(3)—not changeCenter(3)-(DspF/10)Center(3)Center(3)+(DspF/10)—increaseCenter(3)Center(4)Center(5)—very increaseCenter(4)-0.8DvCenter(5)-DvCenter(5)Center(5)in which:(4.6)Center(i)=(DspF-DspI)×(i-1)Nling-1+DspI,Nling=5,Dv=0.15.
DspI and DspF are the initial and end point of universes of the speed change, respectively.(4.7)DspI=Kv×DspIn,DspF=Kv×DspFn,
DspIn and DspFn are defined for normaldriver (DspIn=-5km⁄h, DspFn=5km⁄h) and Kv is the coefficient speed which is obtained from the hierarchical fuzzy system.


### 4.1.5. The Membership Function of Change of Steering Angle

The change of steering angle has five linguistic terms (very right, right, not change, left, and very left). The coefficients (a,b,c,d) of membership functions for change of steering angle which are obtained by (4.3) are represented in Table 11,Table 11
Coefficients of fuzzy membership functions for change of steering angle.
Linguistic termsabcdvery rightCenter(1)Center(1)Center(1)+DCenter(2)+0.8DrightCenter(1)+2.5DCenter(2)+2DCenter(3)not changeCenter(3)-0.25DCenter(3)Center(3)+0.25D—leftCenter(3)Center(4)-2DCenter(5)-2.5D—very leftCenter(4)-0.8DCenter(5)-DCenter(5)Center(5)in which(4.8)Center(i)=(DstF-DstI)×(i-1)Nling-1+DstI,D=0.4,Nling=5,
DstI and DstF are the initial and end point of universes of steering angle change, respectively.(4.9)DstI=Kst×DstIn,DstF=Kst×DstFn,
DspIn and DspFn are defined for normaldriver (DstIn=-3deg,DstFn=3deg) and Kst is the coefficient steering angle which is obtained from the hierarchical fuzzy system.


## 4.1.1. Model I

By considering estimated time distances with cars in three mentioned positions (Figure5), and information about the speed, movement direction, and the steering angle of car, the following fuzzy model for controlling steering angle and speed is obtained.In this model, the general form of fuzzy rules is as follows.Rule i: ifTdBSDOLis … andTdFSLis … andTdFOLis … and V is … andDiris … andφis … thenΔvis … andΔφis …,whereTdBSDOL is the time distance of Controlledcar with BSDOL car, TdFSL is the time distance with the front car moving in the same lane (FSDSL or FODSL car), TdFOL is the time distance with the car which is moving in the opposite lane (FSDOL or FODOL car), Vis the speed of Controlledcar, Dir is the moving direction of Controlledcar, and φ is its steering angle. These are input variables of fuzzy rules. The output variables are the change of speed and changing on direction of steering.Each of the input variablesTdBSDOL, TdFSL, and TdFOL has four linguistic terms: very low, low, medium, and high. In fuzzy rules, we have
(4.1)TdFSL={TdFSDSLifFSDSLexist,TdFODSLifFODSLexist,TdFOL={TdFSDOLifFSDOLexist,TdFODOLifFODOLexist.
The speed has three linguistic terms: low, medium, and high. The car direction and the steering angle direction have five linguistic terms (very right, right, zero, left, and very left). The changes of steering angle direction and speed have five linguistic terms. All of membership function is defined for a normaldriver who drives according to driving laws. For including driver behavior, the membership function is changed by obtaining coefficients of the hierarchical fuzzy system which is represented in following.


## 4.1.2. The Membership Function of Time Distance with Other Cars

As mentioned, the membership function of time distance with other cars is defined for anormaldriver who drives according to driving laws. For example, membership functions of time distance with FSDSL car for three persons with different Ktd are shown in Figure 7.The membership function of time distance betweenControlled car and FSDSL car.
(a)
normaldriver (Ktd=1)(b)
Person withKtd=0.5(c)
Person withKtd=2In all of membership functions of time distance with other cars, three points of membership functions are important.(i)
The point where the membership of second linguistic term (low) begins to increase from zero. It is called P1.(ii)
The point of second linguistic term (low) at which the membership returns to zero. It is called P2.(iii)
The point of third linguistic term (medium) at which the membership returns to zero. It is called P3.We formed the time distance vector asVectd.=[P1P2P3].For example, in Figure7(a), Vectd.=[4812]. For modeling different behaviors of driver, we apply the coefficient for time distance vector, Ktd, obtained by hierarchical fuzzy system.By consideringKtd, the purposed time distance vectors (Vectd) for different drivers are shown in Table 7. In Table 7, we have(4.2)q={(Ktd)-1,Ktd≥1,Ktd,Ktd<1.
After obtaining Vectd with other cars, we have
(4.3)μveryloworhigh(x)=max[min(x-ab-a,1,d-xd-c),0],μlowormedium(x)=max[min(x-ab-a,c-xc-b),0].
The coefficients (a,b,c,d) of membership functions for time distance with other cars which are obtained by (4.3) are represented in Table 8,Table 7
Time distance vectors for different drivers.
Left laneRight laneVectd(FSDSL)Ktd*[135]Ktd*[4/q8/q12]Vectd(FSDOL)Ktd*[358]Ktd*[137]Vectd(FODSL)Ktd*[246]Ktd*[258]Vectd(FODOL)Ktd*[3720]Ktd*[3715]Vectd(BSDOL)Ktd*[0.5/q2/q7]Ktd*[31015]Table 8
Coefficients of fuzzy membership functions for time distance with other cars.
Linguistic termsabcdvery low00P1Center1LowP1Center1P2—MediumCenter1Center2P3—HighCenter2P3P2 + P3P2 + P3in which(4.4)Center1=P1+P22,Center2=P3+Center12.


## 4.1.3. The Membership Function of Speed of Car

The coefficients(a,b,c,d) of membership functions for speed are obtained by (4.3) and are represented in Table 9,Table 9
Coefficients of fuzzy membership functions for speed of car.
Linguistic termsabcdLow00LvCenterMediumLvCenterHv—HighCenterHvLv + HvLv + Hvin which(4.5)Center=Lv+Hv2,Hv=1+Kv×Hvn3,Lv=Kv×Lvn.Lvn is the lowest speed and Hvn is the highest speed for normaldriver. Lv is the lowest speed and Hv is the highest speed for different driver.


## 4.1.4. The Membership Function of Change of Speed

The change of speed has five linguistic terms (very decrease, decrease, not change, increase, and very increase). The coefficients (a,b,c,d) of membership functions for change of speed which are obtained by (4.3) are represented in Table 10,Table 10
Coefficients of fuzzy membership functions for change of speed of car.
Linguistic termsabcdvery decreaseCenter(1)Center(1)Center(1)+DvCenter(2)+0.8DvdecreaseCenter(1)Center(2)Center(3)—not changeCenter(3)-(DspF/10)Center(3)Center(3)+(DspF/10)—increaseCenter(3)Center(4)Center(5)—very increaseCenter(4)-0.8DvCenter(5)-DvCenter(5)Center(5)in which:(4.6)Center(i)=(DspF-DspI)×(i-1)Nling-1+DspI,Nling=5,Dv=0.15.
DspI and DspF are the initial and end point of universes of the speed change, respectively.(4.7)DspI=Kv×DspIn,DspF=Kv×DspFn,
DspIn and DspFn are defined for normaldriver (DspIn=-5km⁄h, DspFn=5km⁄h) and Kv is the coefficient speed which is obtained from the hierarchical fuzzy system.


## 4.1.5. The Membership Function of Change of Steering Angle

The change of steering angle has five linguistic terms (very right, right, not change, left, and very left). The coefficients (a,b,c,d) of membership functions for change of steering angle which are obtained by (4.3) are represented in Table 11,Table 11
Coefficients of fuzzy membership functions for change of steering angle.
Linguistic termsabcdvery rightCenter(1)Center(1)Center(1)+DCenter(2)+0.8DrightCenter(1)+2.5DCenter(2)+2DCenter(3)not changeCenter(3)-0.25DCenter(3)Center(3)+0.25D—leftCenter(3)Center(4)-2DCenter(5)-2.5D—very leftCenter(4)-0.8DCenter(5)-DCenter(5)Center(5)in which(4.8)Center(i)=(DstF-DstI)×(i-1)Nling-1+DstI,D=0.4,Nling=5,
DstI and DstF are the initial and end point of universes of steering angle change, respectively.(4.9)DstI=Kst×DstIn,DstF=Kst×DstFn,
DspIn and DspFn are defined for normaldriver (DstIn=-3deg,DstFn=3deg) and Kst is the coefficient steering angle which is obtained from the hierarchical fuzzy system.


## 4.2. From Fuzzy Model to Mathematical Model

After transforming the linguistic descriptions into fuzzy rules, Sugeno fuzzy inference has been applied to obtain the mathematical model during passing. We have applied fuzzy rule base of decision making which is used bynormal driver during passing, to obtain Model II and Model III. Both models have been obtained based on fuzzy rules. Both models have three linguistic terms for steering angle and direction of car. But Model II has two linguistic terms and Model III has four linguistic terms for estimating the time distances with other cars. The models are obtained as follows.


### 4.2.1. Model II

(1) Right Lane
When time distance with FSDSL car is low, then the driver intends to take over. So the decision of passing is interpreted by fuzzy rules as follow:
(i) if TdFSDSL is low, then D•pass=Y;
(ii) if  TdFSDSL is high, then  D•pass=N,
whereTdFSDSL is time distance with FSDSL car and Dpass is decision for passing. Also Y and N are positive values and Y>N(Y=0.95,N=0.05), where dot symbol over each term indicates its differentiation. Here D•pass means deviation in decision for passing in time unit.
The possibility of passing is interpreted by fuzzy rules as follows:
(i) if TdBSDOL is low or TdFODOL is low, then P•pass=N;
(ii) if TdBSDOL is high and TdFODOL is high, then  P•pass=Y,
wherePpass is possibility of passing, TdBSDOL is time distance with BSDOL car and TdFODOL is time distance with FODOL car. P•pass represents the deviation in possibility of passing in time unit.
By considering decision and possibility of passing, the pass is interpreted by the following rules:
(i) if Ppass is low, then P•ass=N;
(ii) if Ppass is high and Dpass is low, then P•ass=N;
(iii) if Ppass is high and Dpass  is high, then P•ass=Y.
The time distance with BSDOL, FSDSL, and FODOL car has two linguistic terms,low and high. The membership functions of them for low have been obtained by
(4.10)low(x)=11+|(x-c)/a|2b,
where a,b, and c coefficients are shown in Table 12. Also (4.11) has been used for memberships of high:
(4.11)high(x)=1-low(x).
The same membership functions are applied for Ppass,Dpass, and Pass.Table 12
Coefficients of fuzzy membership functions for time distance with other cars, passing, and return.
Right laneLeft laneabcabcTime distance with BSDOL640230Time distance with FSDSL330230Time distance with FODOL750670Ppass, Dpass, Pass790———Dret, Ret———790By applying Sugeno fuzzy inference, the model ofDpass,Ppass, and Pass will be obtained as [9](4.12)D•pass=N+(Y-N)×low(TdFSDSL),P•pass=Y+(N-Y)×low(TdBSDOL)+low(TdFODOL)1+low(TdBSDOL)×low(TdFODOL),P•ass=N+(Y-N)×high(Ppass)×high(Dpass).
Finally, the driver continues the path or goes to Middle lane for passing. If he/she continues the path, the angle of car’s direction is hold unchanged and in the case of passing the leading car, it is moved toward the left side. The applied fuzzy rules for passing are summarized as follows:(i) if car goes to the left, then Δφ•=-Δφ;(ii) if car goes straight ahead or goes to the right, then Δφ•=L-Δφ,whereΔφ is change of steering angle, R and L are negative and positive values of steering angle, respectively (R=-0.7,L=0.7(in degree)).When the driver must continue the path, fuzzy rules are summarized as follows:(i) if car goes to the left, then Δφ•=R-Δφ;(ii) if car goes straight ahead, then Δφ•=-Δφ;(iii) if car goes to the right, then Δφ•=L-Δφ.The steering angle and direction of car are defined by three linguistic terms (“left”, “zero”, “right”). The membership functions of them are shown in Figure 8.Figure 8
The membership function of direction and steering angle of car in Model II and Model III.For speed change of car, fuzzy rules are(i) if speed of car is decreased, then ΔV•=Lv-ΔV;(ii) if speed of car is fixed, then ΔV•=-ΔV;(iii) if speed of car is increased, then ΔV•=Hv-ΔV,whereΔV is speed change of car, and Lv, and Hv are the lowest and the highest values of car’s speed, respectively, (Lv = 20 Km/h, Hv = 80 Km/h for normaldriver).InModel II, the changes of steering angle and car’s speed are obtained from fuzzy rules as follows:(4.13)Δφ•=left(Dir)×[-Δφ×summf(φ)+R×(left(φ)+zero(φ))]+zero(Dir)×[-Δφ×summf(φ)+R×left(φ)+L×right(φ)]+right(Dir)×[-Δφ×summf(φ)+L×(zero(φ)+right(φ))]+high(pass)×{left(Dir)×(-R×zero(φ)+L×right(φ))+zero(Dir)×(-R×left(φ)+L×zero(φ))+L×right(Dir)×left(φ)},ΔV•=-ΔV×summf(V)+Hv×low(V)+Hv×med(V)×low(Dpass)+low(Ppass)×[Lv×(high(V)+med(V))-Hv×low(V)]+low(Dpass)×low(Ppass)×[Hv×low(V)-Lv×(med(V)+high(V))],in which(4.14)summf(φ)=left(φ)+zero(φ)+right(φ),summf(V)=low(V)+med(V)+high(V),
where Dir is direction of Controlled car and left(x), zero(x), right(x), low(x), med(x), and high(x) show the member of x in left, zero, right, low, med, and high membership functions, respectively.(2) Left lane
We categorize this lane into two stages: before passing and after passing the leading car. In both of them, we check the return conditions. If FODSL car is near, the driver must return to the right lane. For returning to right lane, fuzzy rules are
(i) If TdFODSL is low, then D•ret=Y;
(ii) If TdFODSL is high, then D•ret=N,
whereTdFODSL is time distance with FODSL car and Dret is the decision for returning to right lane.As we know, if before passing, FSDOL car increases speed and becomes far, then driver must return to right lane. So before passing, we have the fuzzy rules as follows:(i)
if TdFSDOL is low and Dret is low, then R•etb=N;(ii)
if TdFSDOL is high and Dret is low, then R•etb=Y;(iii)
if Dret is high, then R•etb=Y,whereRetb denotes the return to right lane before passing and TdFSDOL is the time distance with FSDOL car. After passing, when distance with BSDOL is sufficient then the driver returns to right lane. So after passing, the fuzzy rules are as follows: (i)
if TdBSDOL is low and Dret is high, then R•eta=Y;(ii)
if TdBSDOL is low and Dret is low, then R•eta=N;(iii)
if TdBSDOL is high, then R•eta=Y,whereReta denotes return to right lane after passing. The membership functions for time distance with FODSL, FSDOL, and BSDOL cars, Ret and Dret are obtained by (4.10) and (4.11) with coefficients represented in Table 12.By applying Sugeno fuzzy inference, the models of Dret and Ret are obtained as(4.15)D•ret=N+(Y-N)×low(TdFODSL),R•etb=Y+(N-Y)×low(Dret)×low(TdFSDOL),R•eta=Y+(N-Y)×low(Dret)×low(TdBSDOL).Finally, the driver continues the path or goes toMiddle lane to return. If he/she continues the path, the fuzzy rules for continuing the path (as mentioned for Right lane) is applied and in the case of returning to the right lane, the following fuzzy rules are applied:(i)
if car goes to the left or goes straight ahead, thenΔφ•=R-Δφ;(ii)
if car goes to the right, thenΔφ•=-Δφ.Fuzzy rules of car’s speed inLeft lane are similar to that of Right lane. Finally the models of changes of steering angle and speed are obtained as follows: (4.16)Δφ•=left(Dir)×[-Δφ×summf(φ)+R×(left(φ)+zero(φ))]+zero(Dir)×[-Δφ×summf(φ)+R×left(φ)+L×right(φ)]+right(Dir)×[-Δφ×summf(φ)+L×(zero(φ)+right(φ))]+high(Ret)×{R×left(Dir)×right(φ)+zero(Dir)×[R×zero(φ)-L×right(φ)]+right(Dir)×[R×left(φ)-L×zero(φ)]},ΔV•=-ΔV×summf(V)+Hv×(med(V)+low(V))+high(Ret)×[Lv×high(V)-Hv×(med(V)+low(V))].(3) Middle Lane
As mentioned before, this lane is a transient lane. If conditions for overtaking are satisfied, the driver increases the speed and continues in the same direction to enter the left lane. In this case, the fuzzy rules ofRight lane are applied and the models of changing steering angle and speed of car are
(4.17)Δφ•=left(Dir)×[-Δφ×summf(φ)+R×left(φ)+L×right(φ)]+zero(Dir)×[-Δφ×summf(φ)+L×(zero(φ)+right(φ))]+right(Dir)×(L-Δφ)×summf(φ),ΔV•=-ΔV×summf(V)+Hv×[low(V)+med(V)].
After overtaking, if the return conditions are satisfying, driver enters with the same speed from this lane to right lane. In this case when the return conditions are satisfied, the fuzzy rules of Left lane are applied. Therefore, changes of steering angle and speed of car are obtained as
(4.18)Δφ•=left(Dir)×(R-Δφ)×summf(φ)+zero(Dir)×[-Δφ×summf(φ)+R×(zero(φ)+left(φ))]+right(Dir)×[-Δφ×summf(φ)+R×left(φ)+L×right(φ)],ΔV•=-ΔV×summf(V)+Lv×high(V).


### 4.2.2. Model III

As mentioned before, we apply the membership functions of the time distances with BSDOL, FSDSL, and FODOL which are used inModel I.(1) Right lane
In this model, when a person drives in right lane, passing is based on time distance with BSDOL, FSDSL, and FODOL cars which are represented, respectively, asTdB, TdFS, and TdFO. So we have
(4.19)summf(TdB)=vlow(TdB)+low(TdB)+med(TdB)+high(TdB),summf(TdFO)=vlow(TdFO)+low(TdFO)+med(TdFO)+high(TdFO),summf(TdFS)=vlow(TdFS)+low(TdFS)+med(TdFS)+high(TdFS),p=high(TdB)×high(TdFO)×(low(TdFS)+vlow(TdFS)),r=high(TdB)×[(high(TdFS)+med(TdFS))×summf(TdFO)+(low(TdFS)+vlow(TdFS))×(vlow(TdFO)+low(TdFO)+med(TdFO))]+(med(TdB)+low(TdB)+vlow(TdB))×summf(TdFS)×summf(TdFO).
Then,
(4.20)Pass•=Y×p+N×rp+r.
Because of applying the membership functions and fuzzy rules of the change of steering angle in Model II, the change of steering angle model is the obtained model in Model II. By applying Sugeno fuzzy inference, the change of speed model is obtained as follows. 											(4.21)ΔV•=high(TdB)×h+med(TdB)×m+low(TdB)×l+vlow(TdB)×vlsummf(TdB)×summf(TdFS)×summf(TdFO)×summf(V),
where
(4.22)h=high(TdFS)×summf(TdFO)×(-ΔV×high(V)+(med(V)+low(V))×(Hv-ΔV))+med(TdFS)×high(TdFO)×(-ΔV×high(V)+(med(V)+low(V))×(Hv-ΔV))+med(TdFS)×(low(TdFO)+med(TdFO))×(high(V)+med(V))×(Lv-ΔV)-ΔV×low(V))-ΔV×(med(TdFS)×vlow(TdFO)+low(TdFS)×high(TdFO))×summf(V)+(Lv-ΔV)×summf(V)×(summf(TdFO)×(low(TdFS)+vlow(TdFS))-low(TdFS)×high(TdFS)),m=(high(TdFS)×summf(TdFO)+med(TdFS)×(high(TdFO)+med(TdFO)))×(-ΔV×high(V)+(med(V)+low(V))×(Hv-ΔV))+med(TdFS)×low(TdFO)×((high(V)+med(V))×(Lv-ΔV)-ΔV×low(V))-med(TdFS)×vlow(TdFO)×summf(V)×ΔV+summf(TdFO)×summf(V)×(vlow(TdFS)×(Lv-ΔV)-low(TdFS)×ΔV),l=summf(TdFO)×summf(V)×[(low(TdFS)+vlow(TdFS))×(Lv-ΔV)-high(TdFS)×ΔV]+med(TdFS)×high(TdFO)×((high(V)+med(V))×(Lv-ΔV)-low(V)×ΔV)+med(TdFS)×(summf(TdFO)-high(TdFO))×(high(V)×(Lv-ΔV)-(med(V)+low(V))×ΔV),vl=-(high(TdFS)+med(TdFS))×(high(TdFO)+med(TdFO))×(high(V)+med(V)+low(V))×ΔV+(high(TdFS)×low(TdFO)+low(TdFS)×(summf(TdFO)-vlow(TdFO)))×summf(V)×(Lv-ΔV)+(high(TdFS)×vlow(TdFO)+vlow(TdFS)×summf(TdFO)+(med(TdFS)+low(TdFS))×vlow(TdFO))×summf(V)×(Lv-ΔV).(2) Middle lane
When from the diving lane the car enters toMiddle lane, the models are
(4.23)ΔV•=-high(V)×ΔV+(med(V)+low(V))×(Hv-ΔV)summf(V),Δφ•=0.
After overtaking, because of applying the fuzzy rules and the membership functions of the change of steering angle in Model II, the change of steering angle model is the obtained model in Model II. The change of speed is
(4.24)ΔV•=0.(3) Left lane
The return to the driving lane is as follows:(4.25)Ret•=Y×p+N×rp+r,
where
(4.26)p=(high(TdB)+med(TdB))×(summf(TdFO)×(vlow(TdFS)+low(TdFS))+(high(TdFO)+med(TdFO))×(high(TdFS)+med(TdFS))+low(TdFO)×med(TdFS))+low(TdB)×(summf(TdFO)×vlow(TdFS)+low(TdFO)×med(TdFS))+vlow(TdB)×(summf(TdFO)×(low(TdFS)+vlow(TdFS))+med(TdFO)×(low(TdFS)+vlow(TdFS))+low(TdFO)×(summf(TdFS)-high(TdFS))+vlow(TdFO)×(low(TdFS)+vlow(TdFS))),r=(high(TdB)+med(TdB))×(low(TdFO)×high(TdFS)+vlow(TdFO)×(high(TdFS)+med(TdFS)))+low(TdB)×(summf(TdFO)×(summf(TdFS)-vlow(TdFS))-low(TdFO)×med(TdFS))+vlow(TdB)×(summf(TdFO)×high(TdFS)+(summf(TdFO)-low(TdFO))×med(TdFS)).The change of steering angle model is the obtained model inModel II. The change of speed model is(4.27)ΔV•=-ΔV+Hv×(med(V)+low(V))summf(V).


## 4.2.1. Model II

(1) Right Lane
When time distance with FSDSL car is low, then the driver intends to take over. So the decision of passing is interpreted by fuzzy rules as follow:
(i) if TdFSDSL is low, then D•pass=Y;
(ii) if  TdFSDSL is high, then  D•pass=N,
whereTdFSDSL is time distance with FSDSL car and Dpass is decision for passing. Also Y and N are positive values and Y>N(Y=0.95,N=0.05), where dot symbol over each term indicates its differentiation. Here D•pass means deviation in decision for passing in time unit.
The possibility of passing is interpreted by fuzzy rules as follows:
(i) if TdBSDOL is low or TdFODOL is low, then P•pass=N;
(ii) if TdBSDOL is high and TdFODOL is high, then  P•pass=Y,
wherePpass is possibility of passing, TdBSDOL is time distance with BSDOL car and TdFODOL is time distance with FODOL car. P•pass represents the deviation in possibility of passing in time unit.
By considering decision and possibility of passing, the pass is interpreted by the following rules:
(i) if Ppass is low, then P•ass=N;
(ii) if Ppass is high and Dpass is low, then P•ass=N;
(iii) if Ppass is high and Dpass  is high, then P•ass=Y.
The time distance with BSDOL, FSDSL, and FODOL car has two linguistic terms,low and high. The membership functions of them for low have been obtained by
(4.10)low(x)=11+|(x-c)/a|2b,
where a,b, and c coefficients are shown in Table 12. Also (4.11) has been used for memberships of high:
(4.11)high(x)=1-low(x).
The same membership functions are applied for Ppass,Dpass, and Pass.Table 12
Coefficients of fuzzy membership functions for time distance with other cars, passing, and return.
Right laneLeft laneabcabcTime distance with BSDOL640230Time distance with FSDSL330230Time distance with FODOL750670Ppass, Dpass, Pass790———Dret, Ret———790By applying Sugeno fuzzy inference, the model ofDpass,Ppass, and Pass will be obtained as [9](4.12)D•pass=N+(Y-N)×low(TdFSDSL),P•pass=Y+(N-Y)×low(TdBSDOL)+low(TdFODOL)1+low(TdBSDOL)×low(TdFODOL),P•ass=N+(Y-N)×high(Ppass)×high(Dpass).
Finally, the driver continues the path or goes to Middle lane for passing. If he/she continues the path, the angle of car’s direction is hold unchanged and in the case of passing the leading car, it is moved toward the left side. The applied fuzzy rules for passing are summarized as follows:(i) if car goes to the left, then Δφ•=-Δφ;(ii) if car goes straight ahead or goes to the right, then Δφ•=L-Δφ,whereΔφ is change of steering angle, R and L are negative and positive values of steering angle, respectively (R=-0.7,L=0.7(in degree)).When the driver must continue the path, fuzzy rules are summarized as follows:(i) if car goes to the left, then Δφ•=R-Δφ;(ii) if car goes straight ahead, then Δφ•=-Δφ;(iii) if car goes to the right, then Δφ•=L-Δφ.The steering angle and direction of car are defined by three linguistic terms (“left”, “zero”, “right”). The membership functions of them are shown in Figure 8.Figure 8
The membership function of direction and steering angle of car in Model II and Model III.For speed change of car, fuzzy rules are(i) if speed of car is decreased, then ΔV•=Lv-ΔV;(ii) if speed of car is fixed, then ΔV•=-ΔV;(iii) if speed of car is increased, then ΔV•=Hv-ΔV,whereΔV is speed change of car, and Lv, and Hv are the lowest and the highest values of car’s speed, respectively, (Lv = 20 Km/h, Hv = 80 Km/h for normaldriver).InModel II, the changes of steering angle and car’s speed are obtained from fuzzy rules as follows:(4.13)Δφ•=left(Dir)×[-Δφ×summf(φ)+R×(left(φ)+zero(φ))]+zero(Dir)×[-Δφ×summf(φ)+R×left(φ)+L×right(φ)]+right(Dir)×[-Δφ×summf(φ)+L×(zero(φ)+right(φ))]+high(pass)×{left(Dir)×(-R×zero(φ)+L×right(φ))+zero(Dir)×(-R×left(φ)+L×zero(φ))+L×right(Dir)×left(φ)},ΔV•=-ΔV×summf(V)+Hv×low(V)+Hv×med(V)×low(Dpass)+low(Ppass)×[Lv×(high(V)+med(V))-Hv×low(V)]+low(Dpass)×low(Ppass)×[Hv×low(V)-Lv×(med(V)+high(V))],in which(4.14)summf(φ)=left(φ)+zero(φ)+right(φ),summf(V)=low(V)+med(V)+high(V),
where Dir is direction of Controlled car and left(x), zero(x), right(x), low(x), med(x), and high(x) show the member of x in left, zero, right, low, med, and high membership functions, respectively.(2) Left lane
We categorize this lane into two stages: before passing and after passing the leading car. In both of them, we check the return conditions. If FODSL car is near, the driver must return to the right lane. For returning to right lane, fuzzy rules are
(i) If TdFODSL is low, then D•ret=Y;
(ii) If TdFODSL is high, then D•ret=N,
whereTdFODSL is time distance with FODSL car and Dret is the decision for returning to right lane.As we know, if before passing, FSDOL car increases speed and becomes far, then driver must return to right lane. So before passing, we have the fuzzy rules as follows:(i)
if TdFSDOL is low and Dret is low, then R•etb=N;(ii)
if TdFSDOL is high and Dret is low, then R•etb=Y;(iii)
if Dret is high, then R•etb=Y,whereRetb denotes the return to right lane before passing and TdFSDOL is the time distance with FSDOL car. After passing, when distance with BSDOL is sufficient then the driver returns to right lane. So after passing, the fuzzy rules are as follows: (i)
if TdBSDOL is low and Dret is high, then R•eta=Y;(ii)
if TdBSDOL is low and Dret is low, then R•eta=N;(iii)
if TdBSDOL is high, then R•eta=Y,whereReta denotes return to right lane after passing. The membership functions for time distance with FODSL, FSDOL, and BSDOL cars, Ret and Dret are obtained by (4.10) and (4.11) with coefficients represented in Table 12.By applying Sugeno fuzzy inference, the models of Dret and Ret are obtained as(4.15)D•ret=N+(Y-N)×low(TdFODSL),R•etb=Y+(N-Y)×low(Dret)×low(TdFSDOL),R•eta=Y+(N-Y)×low(Dret)×low(TdBSDOL).Finally, the driver continues the path or goes toMiddle lane to return. If he/she continues the path, the fuzzy rules for continuing the path (as mentioned for Right lane) is applied and in the case of returning to the right lane, the following fuzzy rules are applied:(i)
if car goes to the left or goes straight ahead, thenΔφ•=R-Δφ;(ii)
if car goes to the right, thenΔφ•=-Δφ.Fuzzy rules of car’s speed inLeft lane are similar to that of Right lane. Finally the models of changes of steering angle and speed are obtained as follows: (4.16)Δφ•=left(Dir)×[-Δφ×summf(φ)+R×(left(φ)+zero(φ))]+zero(Dir)×[-Δφ×summf(φ)+R×left(φ)+L×right(φ)]+right(Dir)×[-Δφ×summf(φ)+L×(zero(φ)+right(φ))]+high(Ret)×{R×left(Dir)×right(φ)+zero(Dir)×[R×zero(φ)-L×right(φ)]+right(Dir)×[R×left(φ)-L×zero(φ)]},ΔV•=-ΔV×summf(V)+Hv×(med(V)+low(V))+high(Ret)×[Lv×high(V)-Hv×(med(V)+low(V))].(3) Middle Lane
As mentioned before, this lane is a transient lane. If conditions for overtaking are satisfied, the driver increases the speed and continues in the same direction to enter the left lane. In this case, the fuzzy rules ofRight lane are applied and the models of changing steering angle and speed of car are
(4.17)Δφ•=left(Dir)×[-Δφ×summf(φ)+R×left(φ)+L×right(φ)]+zero(Dir)×[-Δφ×summf(φ)+L×(zero(φ)+right(φ))]+right(Dir)×(L-Δφ)×summf(φ),ΔV•=-ΔV×summf(V)+Hv×[low(V)+med(V)].
After overtaking, if the return conditions are satisfying, driver enters with the same speed from this lane to right lane. In this case when the return conditions are satisfied, the fuzzy rules of Left lane are applied. Therefore, changes of steering angle and speed of car are obtained as
(4.18)Δφ•=left(Dir)×(R-Δφ)×summf(φ)+zero(Dir)×[-Δφ×summf(φ)+R×(zero(φ)+left(φ))]+right(Dir)×[-Δφ×summf(φ)+R×left(φ)+L×right(φ)],ΔV•=-ΔV×summf(V)+Lv×high(V).


## 4.2.2. Model III

As mentioned before, we apply the membership functions of the time distances with BSDOL, FSDSL, and FODOL which are used inModel I.(1) Right lane
In this model, when a person drives in right lane, passing is based on time distance with BSDOL, FSDSL, and FODOL cars which are represented, respectively, asTdB, TdFS, and TdFO. So we have
(4.19)summf(TdB)=vlow(TdB)+low(TdB)+med(TdB)+high(TdB),summf(TdFO)=vlow(TdFO)+low(TdFO)+med(TdFO)+high(TdFO),summf(TdFS)=vlow(TdFS)+low(TdFS)+med(TdFS)+high(TdFS),p=high(TdB)×high(TdFO)×(low(TdFS)+vlow(TdFS)),r=high(TdB)×[(high(TdFS)+med(TdFS))×summf(TdFO)+(low(TdFS)+vlow(TdFS))×(vlow(TdFO)+low(TdFO)+med(TdFO))]+(med(TdB)+low(TdB)+vlow(TdB))×summf(TdFS)×summf(TdFO).
Then,
(4.20)Pass•=Y×p+N×rp+r.
Because of applying the membership functions and fuzzy rules of the change of steering angle in Model II, the change of steering angle model is the obtained model in Model II. By applying Sugeno fuzzy inference, the change of speed model is obtained as follows. 											(4.21)ΔV•=high(TdB)×h+med(TdB)×m+low(TdB)×l+vlow(TdB)×vlsummf(TdB)×summf(TdFS)×summf(TdFO)×summf(V),
where
(4.22)h=high(TdFS)×summf(TdFO)×(-ΔV×high(V)+(med(V)+low(V))×(Hv-ΔV))+med(TdFS)×high(TdFO)×(-ΔV×high(V)+(med(V)+low(V))×(Hv-ΔV))+med(TdFS)×(low(TdFO)+med(TdFO))×(high(V)+med(V))×(Lv-ΔV)-ΔV×low(V))-ΔV×(med(TdFS)×vlow(TdFO)+low(TdFS)×high(TdFO))×summf(V)+(Lv-ΔV)×summf(V)×(summf(TdFO)×(low(TdFS)+vlow(TdFS))-low(TdFS)×high(TdFS)),m=(high(TdFS)×summf(TdFO)+med(TdFS)×(high(TdFO)+med(TdFO)))×(-ΔV×high(V)+(med(V)+low(V))×(Hv-ΔV))+med(TdFS)×low(TdFO)×((high(V)+med(V))×(Lv-ΔV)-ΔV×low(V))-med(TdFS)×vlow(TdFO)×summf(V)×ΔV+summf(TdFO)×summf(V)×(vlow(TdFS)×(Lv-ΔV)-low(TdFS)×ΔV),l=summf(TdFO)×summf(V)×[(low(TdFS)+vlow(TdFS))×(Lv-ΔV)-high(TdFS)×ΔV]+med(TdFS)×high(TdFO)×((high(V)+med(V))×(Lv-ΔV)-low(V)×ΔV)+med(TdFS)×(summf(TdFO)-high(TdFO))×(high(V)×(Lv-ΔV)-(med(V)+low(V))×ΔV),vl=-(high(TdFS)+med(TdFS))×(high(TdFO)+med(TdFO))×(high(V)+med(V)+low(V))×ΔV+(high(TdFS)×low(TdFO)+low(TdFS)×(summf(TdFO)-vlow(TdFO)))×summf(V)×(Lv-ΔV)+(high(TdFS)×vlow(TdFO)+vlow(TdFS)×summf(TdFO)+(med(TdFS)+low(TdFS))×vlow(TdFO))×summf(V)×(Lv-ΔV).(2) Middle lane
When from the diving lane the car enters toMiddle lane, the models are
(4.23)ΔV•=-high(V)×ΔV+(med(V)+low(V))×(Hv-ΔV)summf(V),Δφ•=0.
After overtaking, because of applying the fuzzy rules and the membership functions of the change of steering angle in Model II, the change of steering angle model is the obtained model in Model II. The change of speed is
(4.24)ΔV•=0.(3) Left lane
The return to the driving lane is as follows:(4.25)Ret•=Y×p+N×rp+r,
where
(4.26)p=(high(TdB)+med(TdB))×(summf(TdFO)×(vlow(TdFS)+low(TdFS))+(high(TdFO)+med(TdFO))×(high(TdFS)+med(TdFS))+low(TdFO)×med(TdFS))+low(TdB)×(summf(TdFO)×vlow(TdFS)+low(TdFO)×med(TdFS))+vlow(TdB)×(summf(TdFO)×(low(TdFS)+vlow(TdFS))+med(TdFO)×(low(TdFS)+vlow(TdFS))+low(TdFO)×(summf(TdFS)-high(TdFS))+vlow(TdFO)×(low(TdFS)+vlow(TdFS))),r=(high(TdB)+med(TdB))×(low(TdFO)×high(TdFS)+vlow(TdFO)×(high(TdFS)+med(TdFS)))+low(TdB)×(summf(TdFO)×(summf(TdFS)-vlow(TdFS))-low(TdFO)×med(TdFS))+vlow(TdB)×(summf(TdFO)×high(TdFS)+(summf(TdFO)-low(TdFO))×med(TdFS)).The change of steering angle model is the obtained model inModel II. The change of speed model is(4.27)ΔV•=-ΔV+Hv×(med(V)+low(V))summf(V).


## 5. Results

The obtained weights of each of environmental parameters from (2.8) are summarized in Table 13. This table shows that among climate parameters, range of view is the most important parameter. Safety is the most important among the road parameters and safety equipment operation is the most important among the car parameters.Table 13
The weights of environmental parameters in fuzzy rules.
Climate parameterWRoad parameterWCar parameterWRange of view0.37Traffic0.21Equipment operation0.47Luminosity0.297Road quality0.13Rain0.178Sign0.11Ergonomy0.25Temperature0.098Moving obstacle0.21Distract agents0.28Humidity0.057Safety0.34The obtained optimum number of linguistic terms for environmental parameters, as input variables, by PSO algorithm is shown in Table14. The number of linguistic terms of output variables (climate, road, and car condition) is fixed and is equal to 5 sets.Table 14
The optimum number of fuzzy sets for environmental parameters.
Climate parametersNumberRoad parametersnumberCar parametersNumberRange of view5Traffic3Equipment operation5Luminosity3Road quality5Rain5Sign3Ergonomy5Temperature3Moving obstacle5Distract agents5Humidity3Safety3In all of simulations, environmental parameters are as represented by Table15.Table 15
The environmental parameters of simulations.
ClimateLinguisticRoadLinguisticCarLinguisticparameterstermparameterstermparameterstermRange of viewGoodTrafficVery lightEquipment OperationGoodLuminosityGoodRoad qualityGoodRainNotSignEnoughErgonomyGoodTemperatureCoolMoving obstaclesVery lowDistract agentsVery lowHumidityGoodSafetygoodTwo strategies for theControlled car are considered. (i)
Controlled car must wait until FODOL car passes then it takes over (Figures 9(a) and 10(a));(ii)
it has enough time to pass the leading car (Figures9(b) and 10(b)).The comparison ofModel I and Model II.
(a)
The comparison ofModel I and Model II for normal driver when he/she waits to takeover.(b)
The comparison ofModel I and Model II for normal driver when he/she has time to pass.The comparison ofModel I and Model III.
(a)
The comparison ofModel I and Model III for normal driver when he/she waits to takeover.(b)
The comparison ofModel I and Model III of normal driver when he/she has time to pass.In all of figures, the paths ofControlled car of Model I are shown with solid lines and paths of Controlled car of    Model II and Model III are shown with dash lines. Also before passing, the paths of FSDSL and FODOL cars with solid lines and during passing with “▸” are shown. When BSDOL car is not near, the Controlled car intends to pass. Therefore, BSDOL car is not shown in simulation results. In Figure 9(a), the start times of passing of two models are equal but in Figure 9(b) the start time of Model II is later than that of Model I. Because in Model II, we have used two linguistic terms for estimating time distance with other cars and in Model I we have four linguistic terms; hence it seems that using two linguistic terms for time distance does not lead to appropriate results. Figure 9(b) shows that in Model I driver decides to pass earlier than in Model II, but in Figure 9(a), drivers of both models wait until FODOL car passes and approaches the FSDSL car. In both conditions, the time of return to right lane is almost equal for two mentioned strategies.Of course, by considering four linguistic terms for estimating the time distance inModel III, the results obtained by Model I and Model III will be more similar as shown in Figure 10. We have a similar model with less fuzzy rules.We investigate the behavior of different drivers under overtaking condition. The comparison of behavior of three drivers under equal passing conditions is shown in Figures11 and 12. As it is seen in Figure 11, normal driver and attentive old driver with very high precision pass the leading car. But attentive old driver with very low precision waits until the FODOL passes and then he/she passes the leading car. The paths of cars before passing are shown by solid lines. The very low precision person’s error is higher than the very high precision person in calculating distance with other car. Because of being attentive, the driver waits for passing the leading car to collision avoidance. The car’s speed of each driver shows the driver’s behavior and decision under equal conditions. The normal driver decided to pass and increases the speed. The movement of car is smooth. The old person with very high precision has more steering direction change because he/she is attentive and old and needs more time of passing than normal driver. The old person with very low precision is late in decision making and waits.  After that he/she is passing the leading car and returns the right lane as soon as because of being attentive.Comparison of different drivers in the same conditions.
(a)
Normal driver(b)
Attentive old driver with very low precision(c)
Attentive old driver with very high precision(d)
Car’s speed by (a), (b), (c) driversThe comparison of different driving behavior in equal conditions.
(a)
Normal driver(b)
Attentive young driver with very low precision(c)
Risky young driver with very low precision(d)
Car’s speed by (a), (b), (c) driversFigure12 compares a normal driver with a young driver. In equal conditions, the risky young driver passes the leading car. But the attentive young driver and normal driver waits until the FODOL car is passed. The speeds of cars are shown in Figure 12(d).


## 6. Conclusion

We used two levels for controlling of car: the low and the high levels. In low-level control, the fuzzified three-position system has been presented and in high-level control, a fuzzy hierarchical system has been proposed. The fuzzy hierarchical system is used for modeling of driver’s behavior. In fact, the low level control system is responsible for modeling the steering angle and the speed variations enforced by the driver. The high level control system is used for the decision making process of the driver. In this paper,Model I is based on fuzzy modeling; Model II and Model III are obtained based on Sugeno fuzzy inference. Different drivers behavior is included in modeling by changing the membership function of input and output variables of fuzzy rules. These membership functions are varied by applying coefficients which are obtained by the hierarchical fuzzy system.The obtained results of Sugeno fuzzy inference models are similar to fuzzy model. Of course inModel II, less fuzzy rules are used. But by applying more fuzzy rules in Model III, Model I and Model III become similar models. Because of using three linguistic terms for defining the steering angle and direction of car in Model II and Model III, both of them have less fuzzy rules than Model I(in this model five linguistic terms are used). The obtained models from Sugeno fuzzy inference (Model II and Model III) can be used to simulate, test the influence of parameters, and predict the behavior of the system.The obtained results ofModel I show that in equal conditions an attentive old driver with very high precision passes the leading car, but attentive old driver with very low precision waits until FODOL car passes and then he/she passes the leading car. The very low precision person’s error is higher than that of the very high precision person in calculating distance with other car. The attentive person needs more time distance with FODOL car than risky person to passing the leading car and returns to the right lane as soon as possible. This method also provides a basis for modeling individual driver behavior characteristics that may be tuned and used in automatically guided vehicles.



---

*Source: 172878-2010-09-23.xml*