bugfix : now if two transitions have their conditions to true, only the
first one will be taken.
Did some correction in GenerateFromTemplate,
Added a function to optemize the execution of the simulation.