The invention relates to the cross technical field of
artificial intelligence and
traffic simulation, and relates to an automatic
traffic simulation method for generating an SUMO recognizable
XML based on a large
language model, which comprises the following steps: constructing and preprocessing an instruction-
fine tuning data set comprising a
natural language instruction and an SUMO-
XML file mapping relationship; performing
fine tuning on the basic large
language model by combining a
fine tuning technology with a structured prompt and thinking chain strategy to obtain an SUMO-
XML adaptive large
language model; when a
natural language instruction of a user is received, an initial XML text is generated through the adaptive model, and an XML file capable of being recognized by SUMO is generated after hierarchical iterative grammar and semantic
verification and correction; and finally, the
simulation driving program module reads the file and drives the SUMO to complete automatic
simulation. The problems that in existing SUMO
simulation, XML generation efficiency is low, the technical threshold is high and scene adaptability is poor are effectively solved, simulation efficiency is remarkably improved, the use threshold of a user is lowered, and the method can be widely applied to multiple scenes such as urban
traffic management,
traffic planning, emergency simulation and teaching and scientific research.