A termite internal state model for elucidating caste differentiation