
module seatBeltFeature
{
  var beeper : boolean;
  var warningLight : boolean;
  var time : int;
  var ignition : boolean;
  var buckled : boolean;
  var warn : boolean;
  var nowarn : boolean;

  init {
    beeper = false;
    warningLight = false;
    time = 0;
    ignition = false;
    buckled = false;
    warn = false;
    nowarn = false;
  }

  transition {
    if (ignition && warn && !buckled) {
      beeper = true;
      warningLight = true;
    }

    if (beeper && time < 30 && !buckled) {
      time := time + 1;
    } else {
      beeper = false;
    }

    if (buckled || nowarn) {
      beeper = false;
      warningLight = false;
      time = 0;
    }

    if (!ignition || nowarn) {
      beeper = false;
      warningLight = false;
      time = 0;
    }
  }
}
