**6. Conclusions**

In this work, we have analyzed how the mental state of the driver and the interior state of the vehicle affects driving and its relation to compliance with traffic regulations and accidents.

Among the factors analyzed, the negative influence of stress stands out. On the one hand, stress is strongly related to an aggressive driving style with sudden accelerations and decelerations. This behavior means that the rest of the road users are not able to predict their actions, increasing the probability of traffic accidents. In the driving tests, these drivers did not often respect the speed limits, they overtook other vehicles in areas where this action should not be performed and did not stop at the crosswalks. On the other hand, the driving style associated with this state increases fuel consumption. As the driver drives at an inappropriate speed, the brakes are used more, and the driver does not take advantage of the energy generated by burning the fuel.

Sadness also influences driving behavior. This emotion in combination with stress and listening to fast music increases the number of harsh accelerations, causing problems for both safety and the environment. Drivers suffering from sadness are frequently involved in traffic accidents because they are thinking about their own problems and do not focus on paying attention to the road.

Tiredness is another analyzed factor that has negative consequences. We have observed that tired drivers suffer more stress while driving than non-tired drivers. Tiredness increases response times, and as a result, drivers accelerate and brake more frequently. This could cause a traffic accident because the driver of the vehicle behind only has a short time to react.

Furthermore, we have observed that drivers who listen to music with a fast tempo drive at high speeds, not respecting the limits indicated on the traffic signs. High-speed driving demands more cognitive ability. If the demand is prolonged, it causes an increase in the level of fatigue.

Regarding the interior state of the vehicle, the results obtained when analyzing the data of drivers who were exposed to high concentrations of CO2 are very similar to those of drivers who were tired. A high concentration of CO2 causes fatigue and headache, reducing the concentration of the driver on the road. Finally, we want to highlight that we have observed that some drivers who liked video games and were very stressed or tired improved their initial state when doing the driving test. This result could be very useful for developing driving assistants.

In conclusion, this work shows that the driver's behavior not only depends on the driving conditions, but that it is also influenced by the driver's state. Factors such as stress or fatigue can intensify while driving, but the initial values before driving are also very relevant and strongly related to more erratic and dangerous driving. Researchers working on the design of driving assistants could explore whether issuing lifestyle advice improves driving safety and driving efficiency.

As future work, we would like to evaluate how the personality of the driver impacts driving. This, combined with the results obtained in this work, would allow us to develop an advanced driving assistant (ADAS) that fits with the driver profile. An ADAS could intelligently influence the driver's emotions.

**Author Contributions:** Conceptualization, V.C.M. and W.D.S.; methodology, V.C.M. and W.D.S.; formal analysis, V.C.M.; investigation, all authors; resources, R.S. and X.G.P.; writing—original draft preparation, V.C.M.; writing—review and editing, all authors; supervision, R.F., N.M.M., X.G.P. and R.G.; funding acquisition, X.G.P. and R.G. All authors have read and agreed to the published version of the manuscript.

**Funding:** This work was supported in part by the Spanish National Research Program under Project TIN2017-82928-R.

**Acknowledgments:** This publication received technical support from the Statistical Consulting Unit of the Scientific-Technical Services of the University of Oviedo (Spain).

**Conflicts of Interest:** The authors declare no conflict of interest.
