Thermally and Optically Stimulated Luminescence. A Simulation Approach