Abstract
Intelligent optimized energy management and prediction model in electric vehicles received attraction of the researchers in the last couple of years. Several techniques and models have been proposed in the literature for optimized energy management and control, but the trade-off between occupant comfort index and the energy consumption is still a significant challenge to the research community. In this paper, we have proposed a model based on learning to optimization and learning to control for user comfort maximization and efficient energy consumption. The proposed model is comprised of three layers; prediction module, learning to optimization module and learning to control module. In the prediction module, we have used the Kalman filter for noise removal and prediction of environmental parameters. In learning to optimization module, the bat algorithm has been used for user comfort maximization and energy consumption minimization. Furthermore, we have used the learning module with optimization module in order to tune the user preferences parameters in the comfort index formula used in the bat optimization algorithm. Likewise, the learning module has been used with the conventional fuzzy logic controller in order to improve its performance. In the conventional fuzzy logic controller, the membership functions boundaries are usually determined through hit and trial method, and once the membership functions are determined, they remain fixed for the entire process. In the learning to control module, the membership functions tuning is carried out. The membership functions are continuously tuned to get effective results. Experimental results indicate that the proposed method performs better as compared to the conventional methods and achieves improved user comfort with reduced energy consumption.
Keywords
Introduction
Nowadays passengers comfort in electric vehicles has grasped the attention of many researchers. The purpose is to provide a comfortable environment for passengers with less energy consumption. Novel HVAC (Heating, ventilation and air conditioning) systems are needed in order to provide a comfortable environment to a passenger in electric vehicles. The objective of the comfort index can be achieved using new artificial optimization and control methods[1, 2].
Energy is a valuable key resource of all resources, and its demand is increasing rapidly over time. There are two ways to address the problem of increasing energy demand: (1) exploring alternative energy sources and energy production, and (2) making effective use of available resources. The first method is expensive, time-consuming but the second method is cost effective and highly desirable. It is suitable for green development to use existing energy resources instead of new energy production. Different methods have been proposed to improve the technology and optimize the consumption of power [3, 4].
Energy consumption (EC) in electric vehicles and inhabited buildings is also increasing speedily. Methods used in different sectors for energy saving are incredibly different. Most researchers are working to solve the issue and have made many attempts over the past decade to achieve user comfort in electric vehicles with less energy consumption. For determining passenger comfort in electric vehicles, there are three main factors to consider: thermal comfort, air quality comfort and visual comfort [5]. Thermal comfort refers to the temperature in an electric vehicle. To ensure a comfortable temperature in electric vehicles and buildings, a cooling or heating system is required.
Similarly, the lighting level is also an essential factor for the comfortable environment [6]. Electrical lighting level is considered for visual comfort measurements and CO2 concentration for air quality measurements in comfort zones. The ventilation system keeps the CO2 concentration at least possible level [7]. The above three parameters are generally considered to be user-friendly sanitary controls. Therefore, these three parameters are considered in the proposed study to measure user comfort.
Various strategies based on existing optimization and control systems were used to solve energy management issues [8, 9]. Different optimization algorithms have been taken into account for energy consumption in electric vehicles and buildings, such as genetic algorithm, bee colony algorithm, ant colony algorithm, and so forth. Different control systems have also been applied in electric vehicles and buildings. These control systems base on traditional methods like adaptive control, optimal control, PID, fuzzy control, and so forth. The traditional approach solves some problems. Some developers have used PID control systems to control rapid temperature rise. However, the control parameters used in the previous models are not well known and are not easy to monitor due to some inherent disadvantages. Recently, fuzzy inference systems have attracted the interest of various scholars and have been widely used in diverse fields for various purposes. The fuzzy logic is a multi-valued logic whose true value can be a real number in the range of 0 and 1. It is used to capture uncertainty in the real-world environment. In traditional logic, only inferences can be true or false, but in fuzzy logic, the results are not necessarily true or false, it can be in the middle. Fuzzy logic can use complex mathematical models to describe complex non-linear relational systems. Fuzzy logic models have evolved in many areas and have been recognized as effective and qualified methods for detecting uncertainties caused by inaccuracies, opacity, and lack of information [10].
There are many optimization algorithms used by different researchers in different fields. In the suggested work, we have used the Bat algorithm (BA) which is a very popular method to obtain the best solutions in different areas like in planning energy systems, and mathematical problems. In general, energy optimization (nonlinear optimization problem) has been solved by applying the bat optimization algorithm [11–13]. Traditional energy management methods are based on statistical analyses, and machine learning methods applied to energy consumption data collected from electricity meters [12]. Why must a reliable and efficient energy optimization system be implemented? The answer is to solve the problem of energy waste in electric vehicles. A system is needed to reduce waste and reduce energy consumption [14]. The second factor is the occupant comfort index, which should be taken into account when considering energy consumption.
Another problem is increasing daily energy costs that users or residents of a home cannot control. However, reducing energy consumption through the implementation of energy-saving systems can reduce costs [15]. Furthermore, improving productivity and learning in a comfortable and pleasant environment is highly desirable. Conversely, a poor comfort index can have a negative impact on passenger’s health [16, 17].
In this paper, we have proposed a novel method comprised of three main components namely, the prediction based on Kalman filter, optimization based on bat algorithm and user preferences learning, and control module based on learning to fuzzy inference controller. The primary purpose of the proposed model is to maximize user comfort and minimize energy consumption. The second main aim of the proposed method is to improve the performance of existing optimization and control approaches. In the previous studies, the user preferences in comfort remain fixed, hence in the proposed work, we have considered these parameters, and make it dynamic which are tuned according to user preferences by using learning algorithm. In the conventional Mamdani fuzzy logic controller, the determination of membership functions has been usually determined through hit and trial method which also requires domain expertise. Hence, in the proposed work, we have proposed a method based on learning for membership functions boundaries tuning in order to improve the performance of existing Mamdani fuzzy logic controller. The fuzzy controller’s output is the desired power for controlling the actuator status, such as cooling/heating, lighting, and ventilation. The required power goes to the comparator module as input; afterward; the comparator compares the remaining power and remaining distance. If the remaining power is more than the required power to reach to the destination, then the optimization processes continue; otherwise, it stops. Finally, the required power for temperature, illumination, and air quality move to the coordinator module. The coordinator adjusts the level of actuators according to the provided energy.
The paper organization is carried out as follow: The related work is explained thoroughly in Section 2; the proposed method for energy consumption minimization and passenger comfort maximization is explained in Section 3. The implementations and results are described in Section 4. Section 5 contains the paper conclusion.
Related work
Many authors have used machine learning algorithms for prediction in electric vehicles. Solmaz et al. [18] proposed a methodology base on an artificial neural network to predict the cooling load in electric vehicles. They have considered seven parameters namely latitude, longitude, altitude, day of the year, an hour of the day, hourly average contextual air temperature and hourly solar radiation for cooling load prediction. Seven neurons have been used in the input layer of the neural network, one for each parameter. The selection of the hidden layer neuron has been carried out through trial and error method, and one layer has been selected for the output layer. The machine learning algorithms have also been used in other methods for energy consumption prediction such as Fayaz et al. [13] proposed a methodology based on deep extreme learning machine, adaptive neuro-fuzzy inference system, and artificial neural network for energy consumption prediction in residential buildings.
Similarly, the hidden Markov chain algorithm has been used by Israr et al., in [19] for the prediction of energy in residential buildings. The Kalman filter is also a very popular method and has been used by scholars for prediction purposes in different fields. Ali et al. [20] used a Kalman filter for energy consumption prediction in smart homes. Fayaz et al. [21] used the Kalman filter for risk index prediction of underground facilities. In order to make the prediction algorithm more efficient different modifications has been carried out with the prediction algorithms. Israr et al. [22] proposed a method based on Kalman filter in which the artificial neural network has been used to tune the R-value to improve the performance of the conventional Kalman filter. Similarly, Sehrish et al. [23] used the particle swarm optimization for weight tuning of artificial neural network in order to improve its performance.
Different optimization algorithms have also been used for optimization in electric vehicles as well as in other fields. Busl et al. [24] developed evolutionary algorithms and simplified system models to improve the comfort of electric vehicles and reduce energy consumption. They have also discussed the criteria of selection of optimization algorithm in an electric vehicle for comfort index maximization and energy consumption minimization. Fayaz et al. [1] proposed a method for energy consumption optimization and user comfort maximization in residential buildings. The proposed method based on bat algorithm and conventional fuzzy logic. Three most important user comfort factors namely temperature, illumination, and air quality have been considered for thermal comfort, visual comfort, and air comfort respectively. The three parameters from environmental and similarly three from the user have been the input to the bat algorithm where the algorithm optimized the comfort of the user according to the comfort index formula. The output of the bat algorithm was the optimized parameters, and those parameters have been used as inputs to the fuzzy logic controller. The fuzzy logic provides the energy to actuators according to the difference of the environmental parameters and optimized parameters. Wahid et al. [25] have used the same methodology where the bee colony algorithm has been used instead of bat algorithm for optimization. The bat algorithm is also used for named data networking [26]
Similarly, the fuzzy logic methods have also been used by many authors for controlling purposes. Fayaz et al. [1] used the fuzzy logic controller for providing power to actuators. Fayaz et al., [27, 28] used the fuzzy logic for controlling the IP camera and fan. Beinarts et al. [29] proposed a fuzzy logic based approach for thermal comfort in electric vehicles. They also suggested a way to adjust the set points for the thermal parameters automatically. Ibrahim et al. [30] proposed a strategy for temperature and humidity control in electric vehicles for HVAC. Homod et al. [31] proposed a hybrid model based on fuzzy logic for indoor thermal comfort in residential buildings.
Different authors have modified the conventional fuzzy logic controller in order to improve its performance. Collotta et al. [32] suggested a method based on fuzzy logic controller and artificial neural network. In their proposed method the ANN has been used to predict the temperature, and the fuzzy logic method takes the predicted temperature as input in order to manage the HVAC. The method evaluation has been carried out using the Matlab. Gouda et al. [33] suggested a method called quasi adaptive fuzzy logic controller in order to control building applications. Their proposed method comprised of two modules namely neural network module and fuzzy controller module. The internal air temperature, external air temperature, solar radiation, and control signal parameters have been used as inputs to the neural network module. The fuzzy controller module takes the error between inter air temperature and setpoint temperature, and also the artificial neural network predicted internal air temperature as inputs. The output of the fuzzy controller is the control signal. Van Cleave and Pattan [34] suggested a method in order to tune the membership functions. The proposed method comprised of two main modules namely learning and control. The learning module has been used for membership functions tuning. The previous data have been used to train the neural network and based on training data the neural network tunes the membership functions of the control module. The fuzzy methods also have been used in different areas for different purposes [35–37].
Many efforts have been thru by many researchers in different areas for energy consumption minimization and user comfort maximization, but still, there is a considerable gap in order to develop useful models to achieve the desired purpose. Therefore in the proposed model, not only we have used the prediction, optimization, and control algorithms in combination for user comfort maximization and energy consumption minimization, but also have enhanced the existing techniques through learning modules.
Proposed method
The model of the proposed approach for efficient energy consumption and user comfort enhancement based on learning to optimization and learning to control is illustrated in Fig. 1. The proposed methodology consisted of three main modules namely prediction, learning to optimization and learning to control in electric vehicles. In the prediction module, the Kalman filter has been used for noise removal and accurate value prediction for environmental parameters. The outputs of the prediction module along with the user set parameters values have been used as inputs to the learning to optimization module. The learning to optimization module further consisted of two sub-modules namely optimization and learning. In the optimization module, the bat optimization algorithm has been used, and in the learning module, the feed forward back propagation neural network (FFBPNN) has been used to tune parameters in the bat optimization algorithm. The optimized outputs of the learning to optimization module are further inputs to the learning to control module along with the environmental predicted parameters values. The learning to control module also consists of two sub-modules namely control and learning. In the control and learning modules, the fuzzy logic controller (FLC) and FFBPNN have been used, respectively. The outputs of the learning to control modules are the required power for actuators which is further input to the comparator. The coordinator takes the required power from the comparator and changes the actuator status accordingly.

Proposed conceptual model.
The detail diagram of the suggested methodology is illustrated in Fig. 2. In the proposed work, we have considered the three most important parameters namely temperature, illumination, and air quality for thermal comfort, visual comfort, and air comfort, respectively. The prediction module takes the temperature, illumination, and air quality values from the environment as inputs and provides the estimated actual values for these parameters. The predicted environmental parameters (such as temperature, illumination, and air quality) values are inputs to the difference-1 (D1) along with the user set temperature, illumination, and air quality values. The D1 takes the error differences of the predicted environmentaltemperature (P T ), illumination (P L ), and air quality (P A ) values and user set temperature (T s ) illumination (L s ), and air quality (A s ) values. The error difference for temperature, illumination, and air quality are represented as e T , e L , and e A respectively. The e T , e L , and e A values along with the T s , L s , and A s values are used as inputs to the bat algorithm, and e T , e L , and e A values are input to the FFBPNN in the learning to optimization module. The learning module tunes the user preferences parameters according to user previous settings. The main purpose of the learning to optimization module is to decrease the gap of the user setting factors and the predicted environmental factors. The representation of the gap is carried out by the error difference of the user-defined and predicted environmental factors, and the difference has an effect on the energy consumption, i.e., the gap is reduced; the energy consumption tends to minimize, and vice versa. The complete passenger comfort inside the vehicle is consisted of three factors namely thermal, visual, and air quality. The comfort index is inversely proportional to the error difference and the error difference is related, to power consumption.

Detailed diagram for efficient energy consumption and user comfort improvement based on learning to optimization and learning to control methods.
The outputs of the learning to optimization module are the optimized temperature, illumination, and air quality values which are represented as OT, OL, and OA respectively. These optimized parameters values are then further inputs to the difference-2 which calculate the difference of optimized parameters (temperature, illumination, and air quality) and predicted environmental parameters (temperature, illumination, and air quality) values. The difference between the predicted environmental and optimized temperature, illumination, and air quality values are represented as E1, E2, and E3 respectively. The E1, E2, and E3 values are further used as inputs to the fuzzy logic controller in learning to control module. The FFBPNN in learning to control modules takes OT, OL, OA, E1, E2, E3, and P T , P L , and P A values. The FFBPNN tunes the membership functions boundaries in the fuzzy logic controller module in order to improve its performance. The fuzzy logic controller takes the E1, E2, and E3 values as inputs and produces the desired power for temperature, illumination, and air quality. The comparator takes the power values and calculates the sum of them and checks with the available remaining power. If there is enough remaining power, then the power is forwarded to coordinator. The coordinator takes these power values and set the status of the actuators accordingly.
In the prediction module of the proposed model, we have used the Kalman filter. Kalman filter takes the temperature, illumination, and air quality parameters as inputs from sensors and provides the corrected predicted parameters as outputs. Kalman filter is a very famous filter for smoothing and prediction. The Kalman filter is a very sophisticated and simple algorithm that can intelligently guess the actual state of the system only from the previous state (i.e., not all historical data needs to be kept). All magic is done by strengthening Kalman (often labeled K), which determines whether the sensor values or the system itself accurately predict the actual state of the system or not. The configuration of the Kalman filter is illustrated in Fig. 3.

Configuration diagram of Kalman filter.
First, we calculate the predicted temperature from the previously estimated value using Equation (1).
Where AT is the transpose of the state transition matrix, Pt-1 is the previously calculated covariance, and Q is the estimated error in the process. Then, we adjust the Kalman’s Gain K as Equation (3).
Assuming, the current sensor’s reading from the temperature sensor at time t is zt. Then, Kalman’s filter predicted temperature for the current time interval becomes Equation (4):
Finally, we update the covariance factor for the next iteration as Equation (5).
The conceptual model for learning to optimization based on bat algorithm and learning to user preferences is shown in Fig. 4. Inputs to the learning module based on feed forward back propagation module are the error change in predicted parameters, and user set parameters which are given linguistic term as environmental parameters. The PP represented the predicted parameters using the Kalman filter, and USP represents the user set parameters, and OP represents the optimized parameters. The user preferences are α, β, and γ values in comfort index formula used in bat algorithm.

Proposed conceptual learning to optimization module.
The detailed structure diagram of the proposed model is illustrated in Fig. 5. The learning to optimization module consisted of two sub-modules namely optimization module and learning module. Inputs to the learning module are the error difference between predicted environmental parameters and user-set parameters. The learning module tunes the user preferences (α, β, γ) in the comfort index formula based on historical user data in the optimization module. The comfort index formula is given in Equation (6).

Proposed learning to optimization module based on bat algorithm and feed forward back propagation neural network.
In the above formula α, β, and γ are user preferences parameters, where the complete comfort index of the passenger is between [0, 1]. The parameters that passenger specify are α, β, and γ which are used to resolve the conflicts between temperature, illumination, and air quality. To sum the user preferences factors, it is equal to1 (α + β + γ = 1). In Equation (6), eT, eL and eA indicates changes between passenger set parameters and predicted environmental parameters. Ts, Ls and As indicates the passenger-set temperature, passenger-set lighting, and passenger-set air quality. Equation (6) calculate user comfort by integrating the three comfort parameters mentioned above.
The general formula for CI is provided in the following Equation (7).
Where the user preferences are illustrated as α, α1, β, γ and the changes between the user and environmental predicted parameters are represented as Ep1, Ep2, Ep3, …… …… …… Epn respectively. The parameters UPs1, UPs2, UPs3, …… …… …… UPsn represents the user set parameters.
We have used the bat algorithm for optimization which is a very famous optimization algorithm in which performance is better as compared to PSO and GA [1].
Over the last few decades, many algorithms inspired by natural behaviors have been developed for solving many hard optimization problems. Few of the algorithms are evolutionary algorithms [38], ant colony optimization [39], and particle swarm optimization (PSO) [40], etc. Due to its applications in a variety of problems they are known as multi-purpose algorithms. The bat algorithms have also a lot of applications in different areas [41–44].
Xin-She Yang introduced BAT algorithm in 2010 for optimization problems. BAT algorithm has the following advantages. High convergence rate: if compared with other algorithms BA has a high global convergence rate under the right conditions for large-scale optimization [38]. Frequency tuning: BA provides a solution with frequency tuning just like the key features of Particle Swarm Optimization and Harmony Search [39]. Automatic Zooming: BA has the capability of zooming into a region where promising solutions have been found. This feature is accompanied by the automatic switch from global to local intensive exploration thus quick convergence rates in early iteration can be achieved [1]. Parameter Control: Parameters can be controlled in BA as iteration proceeds in contrast to fixed parameter values in other algorithms, thus converting exploration to exploitation when an optimal solution is approaching, which is advantageous over other algorithms.
The echolocation of micro-bats inspires BA. The echolocation characteristics of micro-bats can be idealized as the following rules: All bats use echolocation to sense distance, and they also” know” the difference between food/prey and background barriers in some magical way; Bats randomly fly with velocity vi at position xi with a fixed frequency fmin, varying wavelength k and loudness A0 to search for prey. They can automatically adjust the wavelength (or frequency) of their emitted pulses and adjust the rate of pulse emission r ɛ [0,1], depending on the proximity of their target; Although the loudness can vary in many ways, it is assumed that the loudness varies from a large (positive) A0 to a minimum constant value Amin.
For each bat (i) in the bat population, its position and velocity represented by xi and vi respectively in a D-dimensional search space should be defined, where D is the number of parameters to be optimized namely temperature (T), illumination (I) and air quality (A). The frequency for bat (8) has been calculated with Equation (8). As iterations proceeds xi and vi should be subsequently updated. The new solutions
Parameters setting in the bat algorithm
In the proposed work, we have used the feed forward back propagation neural network (FFBPNN) [13] to tune the user preferences values in the comfort index formula. The user preference parameters are set as if the predicted environmental temperature and user set temperature is lower, then the alpha values will be settled high as compared to the beta, and gamma values in the comfort index formula. Similarly, if the difference between predicted environmental illumination, and user set illumination have high value as compared to changes in temperature, and air quality then the beta values are settled high as compared to alpha and gamma in the comfort index formula. For gamma setting the same processes is carried out as for alpha and beta in the comfort index formula. Inputs to the neural network are the error change of the predicted environmental parameters and user-set parameters. The eT indicates the change in the predicted temperature and user set temperature. The eL indicates the change of the predicted illumination and user set illumination. The eA indicates the change of the predicted air quality and user set air quality. The number of neurons defined in the hidden layer is ten; the number of neurons in the output layer is three. The tang sigmoid function has been used as an activation function. The ANN provides alpha, beta, and gamma values as output to the comfort index formula used in the bat algorithm.
Learning to control
The proposed learning to control module has consisted of two sub-modules namely control algorithm module and learning algorithm module. The conceptual diagram of the proposed learning to control module is shown in Fig. 6. In control module, we have used the Mamdani fuzzy logic method which is a very simple and famous fuzzy inference method. In the learning module, we have used the FFBPNN.

A proposed conceptual model for learning to fuzzy inference module.
The detailed processing of learning to control module for temperature is shown in Fig. 7. In the control module, we have used the Mamdani fuzzy logic controller.

Learning to fuzzy inference for temperature in electric vehicles.
The concept of fuzzy logic was introduced by Lotfi Zadeh [46]. The Mamdani fuzzy logic controller consisted of fuzzification, inference mechanism, and defuzzification. In fuzzification, we have used the triangular membership functions. The centroid method has been used in the defuzzification module. The triangle membership used in the proposed fuzzy logic controller is given in Equation (13).
First, the crisp values have been used as inputs to the fuzzy logic controller; the fuzzification module takes the crisp values and converts to fuzzy values using the triangular membership functions given in Equation (8). The fuzzy values are then used as inputs to the inference engine and for the rules for converting fuzzy input values to output values. The minimum and aggregation operations are performed on rules to get a single fuzzy value [1]. The fuzzy values are then again converted to crisp values by using the defuzzification module in the fuzzy inference controller. In defuzzification, we have used the centroid method given in Equation (14).
The output of the fuzzy logic controller is the required power for actuators. In the learning module, we have used the feed forward back propagation neural network. The neural network consisted of three layers namely input, hidden, and output layer. We have three input parameters to the neural network; hence three neurons are defined in the neural network each for a parameter. For hidden layer neurons selection the trial and error methods have been used, and ten neurons have been selected in the hidden layer. As it is the regression model; hence one output neuron is selected in the output layer. The tan-sigmoid function has been used as an activation function. The neural network has been trained on historical data consisted of optimized temperature, predicted and the difference of both along with membership functions. The neural network provides membership functions set to the fuzzy logic controller. The output of the controller module is the required temperature for AC/Boiler actuators. Similarly, for illumination, we have created the fuzzy illumination controller, and air quality fuzzy controller and the same processing has been carried in both fuzzy logic controllers.
The proposed learning to control model has been designed to tune the membership functions boundaries as opposed to the traditional fuzzy logic controller where the membership functions boundaries never change. The tuning of membership functions boundaries brings improvement in the fuzzy logic controller results because different boundaries provide different results for the same value as depicted in Table 2.
A membership functions with different distributions
As illustrated below the membership functions with different boundaries gives different results for input values 5.
Hence it is very obligatory to determine appropriate membership function distribution values in order to get accurate results for a system.
We have defined 7 MFs for input variable E1 and output variable RPT. The linguistic terms for input variable E1 are E11, E12, E13, E14, E15, E16, and E17, and the terms for output variable RPT are RPT1, RPT3, RPT3, RPT4, RPT5, RPT6, and RPT7.
In the proposed work, we have used full structure Mamdani fuzzy logic, in order to specify the number of rules in a fuzzy logic method for the same we have used Equation (15).
Where M indicates the number of MFs, and v represents the number of input variables, and R is the output rules. As in the proposed Mamdani fuzzy logic, we have one input variable, and we have defined 7 MFs for that input variable. Hence, the total number of rules in the proposed method are equal to 71 = 7. Rules used in the proposed method have been shown in Tables 3–5. Input to the fuzzy temperature controller is the Error1 which is the error difference between predicted environmental temperature and optimized temperature. Seven MFs have been defined for the input variable.
Fuzzy control rules for temperature
Fuzzy control rules for illumination
Air quality fuzzy control rules
Input variable for the fuzzy illumination controller is E2. MFs labels for input variable E2 variable are E21, E22, E23, E24, E25, E26, E27, E28, E29, E210, E211, E212, E213, E214, and E215. Similarly, the output variable is required power for illumination which is abbreviated as RPL. The linguistic terms for output variable RPL are RPL1, RPL, RPL3, RPL4, RPL5, RPL6, RPL7, RPL8, RPL9, RPL10, RPL11, RPL12, RPL13, RPL14, and RPL15. The fuzzy controller rules for illumination are shown in Table 4.
MFs labels for input E2 variable of the fuzzy logic controller for air quality are E31, E32, E33, E34, E35, E36, E37, E38, and E39. Similarly, the output variable is required power for illumination which is abbreviated as RPL. The linguistic terms for output variable RPA are RPA1, RPA2, RPA3, RPA4, RPA5, RPA6, RPA7, RPA8, and RPA9. The fuzzy controller rules for air quality are shown in Table 5.
Inputs to the comparator are the desired power from fuzzy controllers for the cooling/heating, lighting, and ventilation. The comparator computes the total required power as shown in Equation (16).
Electricity energy consumption based on vehicle types [41]
The following Equations (17–23) are used to calculate trip distance.
Constrains
Execute
Otherwise
Stop
The process of the comparator and coordinator is illustrated in Fig. 8 in order to represent the above equations for better understanding. In comparator first the remaining battery capacity and the remaining distance are calculated, and it is checked that either the remaining battery capacity is high than the remaining distance capacity needs to be covered if it is, then the power is provided to actuators, and the optimization processes continue. If the required power need to cover the remaining distance is equal or less than the remaining battery capacity then the optimization process is stopped. The following illustrates the whole process. Inputs to the coordinator are required power for temperature, illumination, and air quality and the outputs are the levels of the heater or air condition, light, and fan respectively.

Structure diagram of coordinator.
The following Equations (24–26) are used to set the AC/heater level, light level, and CO2 generator level.
Where LH/AC, LL, LF represents the level of temperature actuator, level of illumination actuator, and level of air quality actuator respectively and indicates the ratio RT for temperature which is 3, RL is the ratio for illumination which is 2 and RA indicates ratio for ventilation which is 2.
Actuators are electronic devices used inside the vehicles that consume energy, i.e., AC (for cooling), heater (for heating), light for illumination, and filter for ventilation. The status of these actuators changes according to the error difference between environmental parameters and the BA-optimized parameters.
In order to assess the performance of the prediction and learning to optimization module of the proposed model, the three most important matrices have been considered namely root mean square error (RMSE), mean absolute error (MAE) and mean absolute percentage error (MAPE) [13] as given in Equations (27–29).
Where N indicates the total observations, T represents the target value, and P indicates the estimated value.
Implementation setup
The implementation of this model was carried out on an Intel(R) Core (TM) i5-3570 CPU @ 3.40 GHz with Visual Studio 2015 installed on it. The implementation of FIS is done using the fuzzy toolbox in Matlab. For MFs in fuzzy logic, fuzzy rules editor, rules viewer, and graphs generation, we have used the Matlab 2015a. The system configuration for implementation and simulation analysis is given in Table 8.
The data that have been considered in the proposed model consists of three main parameters that are related to three comforts of the user, such as thermal, visual and air. By combining these parameters, passenger comfort in an electric vehicle has been defined. The data that have been used in the proposed approach is taken from reference [1]. The input/output MFs for temperature, illumination, and air quality fuzzy controller is given in Figs. (9–11) respectively.

Input/output membership functions for Temperature FLC.

Input/output MFs for Illumination FLC.

Input MFs for air quality FLC.
The original values, sensing values and the Kalman filter predicted values for temperature are shown in Fig. 12. The values show that the learning to optimization values is near to original values as compared to sensing values. Hence, the predicted values have been considered for further processing.

Temperature predicted results using Kalman filter.
The original values, sensing values and the Kalman filter predicted values for illumination are shown in Fig. 13. The values show that the learning to optimization values are near to original values as compared to sensing values. Hence, the predicted values have been considered for further processing.

Illumination predicted results using Kalman filter.
The original values, sensing values and the Kalman filter predicted values for air quality are shown in Fig. 14. The values show that the learning to optimization values are near to original values as compared to sensing values. Hence, the predicted values have been considered for further processing.

Air quality predicted results using Kalman filter.
The results of the average user set values for temperature; the learning to optimization module optimized values for temperature and predicted temperature values had been considered. We have considered the user preferences in order to take care of user preferences in learning to optimization module.
Figure 15 illustrates predicted values, learning to optimization module optimized values, and values set by the user for temperature.

User set; environmental and LtOM optimize temperature values.
The results of the average user set values for illumination; the learning to optimization module optimized values for illumination and predicted illumination values are shown in Fig. 16. The purpose of the usage of the optimization approach is to take into account the illumination values if it is not in the required range of the passenger. We have considered the user preferences in order to take care of user preferences in learning to optimization module.

User set parameter, predicted environmental illumination and learning to optimize illumination values.
The results of the average user set values for air quality, the learning to optimization module optimized values for air quality and predicted air quality values could be seen in Fig. 17. The purpose of the usage of the optimization approach is to take into account the air quality values if it is not in the required range of the passenger. We have considered the user preferences in order to take care of user preferences in learning to optimization module.

User set parameter, predicted environmental air quality and learning to optimized air quality values.
The comfort index with optimization and without optimization for temperature, illumination and air quality are shown in Figs. (18–20 respectively. The results show that by using the proposed learning to optimization, the comfort index is high as compared to without optimization approach for the mentioned parameters.

Comfort index values for temperature with and without optimization.

Comfort index values for illumination with and without optimization.

Comfort index values for air quality with and without optimization.
Fig. 21 shows the over all comfort index values. The results show that by using the proposed learning to optimization, the overall comfort index is high as compared to without optimization approach.

Overall comfort index with optimization and without optimization.
The output values using the learning to control module for temperature, illumination and air quality are shown in Figs. (22–24) for power consumptioon without optimization and power consumption with optimization. The result illustrates the learning to control fuzzy inference have a reduced amount of values as compared to conventional FLC.

Power consumption for temperature with learning to user preferences method and conventional fuzzy logic control method.

Power consumption using conventional fuzzy logic method for illumination with learning to optimization and without optimization.

Total Power consumption for illumination with learning to fuzzy inference and conventional fuzzy logic controller method.
In Table 9 the sensor error data and original data has been used for comparison. The RMSE has been calculated for temperature, illumination, and air quality of the Kalman filter resulted in values and sensing data. The resulted RMSE values of Kalman filter is less as compared to the sensing data RMSE values which indicate that the Kalman filter performance is good as compared to sensing data. Hence, the Kalman filter values have been taken into account for further processing.
Terms and abbreviations used in the equations
Simulation configuration of performance analysis
RMSE for temperature, illumination, and air quality data of Kalman filter and Sensing data
For optimization algorithm performance measurement we have used the mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE) for temperature, illumination, and air quality. The values of these performance measures indicate that there is slight variation in the user set parameters and optimized parameters. The performance measurement of the optimization algorithm for temperature, illumination, and air quality are given in Table 10.
The performance measurement of optimization algorithm for temperature, illumination, and air quality
Energy Consumption with optimization using learning to fuzzy inference controller and the conventional fuzzy logic controller
The power consumption with optimization using proposed learning to control method (LtFIC),conventional fuzzy logic control (CFLC) method and without optimization method has been compared. The results in Tables 9–12 for temperature parameter, illumination parameter, air quality power consumption control and total power consumption indicate that with optimization using LtFIC performs good as compared to CFLC with optimization and proposed LtFIC without optimization. Hence, it shows that the proposed fuzzy inference controller and optimization combination outperform the compared schemes.
In Table 12 comparison of the proposed approach has been carried out with GA and PSO. In the genetic algorithm approach, the prediction and conventional fuzzy logic controller method has been used. Similarly, with the particle swarm optimization algorithm, the Kalman prediction and the conventional fuzzy logic controller has been used. The proposed learning to optimization and control method results are also given. The results indicate that the proposed approach is far better as compared to the counterpart’s algorithms as shown in Table 12.
Comparison of the proposed approach (BA and Fuzzy Inference Learning Approach) with other algorithms for the same data
The results indicate that the performance of the learning to optimization and learning with Kalman filter prediction algorithm is far better as compared to the previous methods for the same purpose. The other advantage of the proposed model is that it is dynamic and take care of user choices/preferences. We have proposed a novel idea to include learning model with bat optimizer module and learning to the fuzzy logic controller in the combine for achieving user comfort maximization and energy consumption minimization results.
In this work, we have proposed a methodology for users comfort maximization and energy saving in electric vehicles environment. Our proposed techniques address both energy savings and passenger comfort index simultaneously. The proposed methodology consisted of three main modules namely, prediction, optimization, and control. The proposed technique integrates into its fitness function the passenger comfort index and the corresponding energy consumption. We have considered the three most important environmental parameters namely temperature, illumination, and air quality. These parameters have a direct impact on thermal, visual, and air quality comfort. We have used bat algorithm for optimization with a learning module in order to tune the user preferences according to historical passenger choices. The proposed optimization technique targets to satisfy passenger comfort along with minimal energy consumption. In the control module, we have used the learning to control approach. Here, the Mamdani fuzzy logic has been used as a controller while the feed forward neural network has been used to tune the membership functions boundaries in the control module. The output of the learning to control module is the required power for temperature, illumination, and air quality. The required power for temperature, illumination, and air quality are used as inputs to the comparator, and afterward, the coordinator module set the level of actuators accordingly. Experimental results indicate that proposed learning to optimization and learning to control strategies performs much better as compared to conventional schemes. Proposed approach achieves higher comfort index with reduced energy consumption. These results give us the confidence to further explore this approach through experiments in real environments and related other fields.
In future we would like to add more environmental paramters, use another optimization method such as harmony search, particle swarm optimization, etc., deep neural network instead of simple neural network.
Footnotes
Acknowledgements
This research was supported by Energy Cloud R&D Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Science, ICT (2019M3F2A1073387), and this research was supported by the MSIT (Ministry of Science and ICT), Korea, under the ITRC (Information Technology Research Center) support program (IITP-2019-2014-1-00743) supervised by the IITP (Institute for Information & communications Technology Planning & Evaluation). Any correspondence related to this paper should be addressed to Dohyeun Kim.
