jeudi 19 mars 2015

How to model state of leaving/entering home


I have two sensors: One detecting if the door is open or closed, another if movement has been detected in the corridor. I want to detect if the person has left or entered home. Usually the person has left if:



  1. movement detected

  2. door opened

  3. door closed

  4. no movement detected


Because of the timing problems and the overlapping states (door is open but person also moves) I think the design pattern state is not appropriate here. But I'm struggling to find a better structure.


Any help?





Aucun commentaire:

Enregistrer un commentaire