I'm not actually looking for the name of the state in the "alertness" routine, instead I am expecting a reply of the driver's alertness value. In the State pattern, the state makes modifications to (or performs functions on) the values of the "owning" class. For instance, if I made a state for the driver that was called "dstatetired" I could have the alertness routine
return $curAlertness - 2;. I would set the current state through routines in the driver class.
That being said, thank you for reminding me about the accessor and I will quit prototyping in my OO code (I'm used to Java, so pardon me.)