Nowadays, despite technological advances, traffic continues to be a major worry, not only for governments and political authorities but also to the citizens who see in their daily life the large traffic impact on their routine. In order to prevent all these consequences, historical data provided by CCTV cameras and other devices which allow currently store traffic data, like mobile phones with accelerometers or cars with intelligent sensors, are analysed using data mining and machine learning techniques in order to detect black points in roads, predict traffic flows, speeds etc. However, these data is very difficult to obtain, due to their cost and their sensibility. For that reason, this work addresses the problematic of obtaining realistic traffic data, which is solved through the building of a traffic simulation tool, which generates traffic data in a realistic way, taking into account traffic dynamics and its uncertainty. Finally, the present work addresses a short-term traffic flow forecasting problem in different traffic networks which is solved through different artificial intelligence techniques, like time series, neural networks and regression.