Altarica is a modeling language for safety analysis and supports simulation analysis. Although Altarica is widely used in the industry, research studies on simulation algorithm are rarely found. Therefore, we design and implement a simulation algorithm. We first briefly introduce the syntax and characteristics of Altarica, and then describe the design and implementation of the algorithm in detail, and finally accurately simulate the most probable sequence of events. We use Reverse Polish Notation to deal with complex event triggered conditions, and support three kinds of synchronization, including Synchronization, Broadcasting and Common Cause Failure, and support multiple probability distribution types. At the end of this paper, through case study and comparison with SIMFIA, the correctness of the algorithm is proved.