functions build_state and get_state_id added to semi-markov model