This thesis work proposes a novel method for the automatic generation of simulation code of discrete event systems. This method uses the location information of the products during operation of the system. This flow, of tuples (product id, location, time) is the input of the proposed algorithm that generates a queueing-network simulation model. This type of approach can achieve a significant time gain for the design, maintenance and on-line reconfiguration of the model. The thesis is composed on five chapters. The first chapter poses the problem and fixes the theoretical framework of the thesis. The second chapter is a literature review of the broad sense of simulation and present works using the notion of trajectories for modeling. The third chapter is to highlight the proposal of the heart of this thesis. The fourth chapter describes the generator developed. The fifth and final chapter presents the experiments and the validation of the generator.