A library for discrete-events simulations based on three-phase world view