An algorithmic approach to non-homogeneous semimarkov processes