package ContactSensor
import Timer.SimulatedTimer
-//JPF's Verify API
-import gov.nasa.jpf.vm.Verify
-
public class ContactSensors {
private int deviceNumbers
private List contacts
private String alarmState = "armed"
- ContactSensors(Closure sendEvent, int deviceNumbers) {
+ ContactSensors(Closure sendEvent, int deviceNumbers, boolean init) {
this.sendEvent = sendEvent
this.deviceNumbers = deviceNumbers
this.contacts = []
+
+ if (init) {
+ this.contactState = "closed"
+ this.currentContact = "closed"
+ this.latestValue = "closed"
+ this.alarmState = "armed"
+ } else {
+ this.contactState = "open"
+ this.currentContact = "open"
+ this.latestValue = "open"
+ this.alarmState = "not armed"
+ }
contacts.add(new ContactSensor(id, label, displayName, this.contactState, this.currentContact, this.alarmState, this.latestValue))
}