#print "DEBUG: eventlist: %d" % len(eventList)
#print "DEBUG: eventlist: %s" % eventList
for event in eventList:
- print "DEBUG: Event: %s %d" % (event, eventTypeCounterMap[event])
+ print("DEBUG: Event: %s %d" % (event, eventTypeCounterMap[event]))
numOfActualEvents = numOfActualEvents + eventTypeCounterMap[event]
return numOfActualEvents
extractedEvents.write(line)
event.close()
elif eventList[i] == "motion":
- print("HERE????")
#Write two events subsequently
- event = open("eventSimulator/motionActiveEvent.groovy", "r")
+ event = open("eventSimulator/motionActiveEvent.groovy", "r")
for line in event:
extractedEvents.write(line)
event.close()
eventVarCounterMap[eventList[i]] = eventVarCount + 1
capability = capabilityMap[variable[eventVarCount]]
#Write two events subsequently
- print("//////////////////////")
- print(capability)
if capability == "capability.switch":
event = open("eventSimulator/switchOnEvent.groovy", "r")
elif capability == "capability.switchLevel":
event = open("eventSimulator/switchLevelEvent.groovy", "r")
elif capability == "capability.colorControl":
event = open("eventSimulator/colorLevelChangeEvent.groovy", "r")
- elif capability == "capability.switch":
- event = open("eventSimulator/switchLevelChangeEvent.groovy", "r")
+ elif capability == "capability.switch":
+ event = open("eventSimulator/switchLevelChangeEvent.groovy", "r")
for line in event:
extractedEvents.write(line)
event.close()
for line in event:
extractedEvents.write(line)
event.close()
- elif eventList[i] == "threeAxis":
- event = open("eventSimulator/threeAxisChangeEvent.groovy", "r")
- for line in event:
- extractedEvents.write(line)
- event.close()
+ elif eventList[i] == "threeAxis":
+ event = open("eventSimulator/threeAxisChangeEvent.groovy", "r")
+ for line in event:
+ extractedEvents.write(line)
+ event.close()
elif eventList[i] == "carbonDioxide":
event = open("eventSimulator/carbonDioxideEvent.groovy", "r")
for line in event:
# PART 1: Generate the permutations of app pairs
-print "PHASE 1: Extracting the app pairs from the app lists ...\n"
+print("PHASE 1: Extracting the app pairs from the app lists ...\n")
appList1 = []
appList2 = []
# Extract the first list
# PART 2:
-print "PHASE 2: Running JPF ...\n"
+print("PHASE 2: Running JPF ...\n")
# List down all the log file names
writeLogList = open(jpfLogDir + "logList", "w+")
for item in appPairs:
# Copy apps into Extractor/App1 and Extractor/App2
- print "==> First app: %s" % item[0]
- print "==> Second app: %s" % item[1]
+ print("==> First app: %s" % item[0])
+ print("==> Second app: %s" % item[1])
os.system("cp " + appDir + item[0] + " Extractor/App1/App1.groovy")
os.system("cp " + appDir + item[1] + " Extractor/App2/App2.groovy")
# Run Runner.py to extract things and create main.groovy, then compile it
- print "==> Compiling the apps ...\n"
+ print("==> Compiling the apps ...\n")
os.system("make Runner")
error = extractError()
logName = item[0] + "--" + item[1] + ".log"
# Compile
os.system("make main")
# Call JPF
- print "==> Calling JPF and generate logs ...\n"
+ print("==> Calling JPF and generate logs ...\n")
os.system("cd " + jpfDir + ";./run.sh " + jpfLogDir + logName + " main.jpf")
else:
# This is for specific error, e.g., direct-direct interaction that we need to skip