Modeling States of Waking and Sleeping