From: rtrimana Date: Sun, 28 Jul 2019 01:09:07 +0000 (-0700) Subject: Completing physical interaction runs. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b8d2107a7b906dd2784ab745c2c2d9e2d52a67cc;p=smartthings-infrastructure.git Completing physical interaction runs. --- diff --git a/Extractor/ExtractorScript.py b/Extractor/ExtractorScript.py index f762b81..8e10962 100644 --- a/Extractor/ExtractorScript.py +++ b/Extractor/ExtractorScript.py @@ -101,6 +101,7 @@ def AnalyzeCapabilities(Temp, appName, F): if (Temp == "capability.switch" or Temp == "capability.switchLevel" or Temp == "capability.illuminanceMeasurement" or + Temp == "capability.colorControl" or #Motion related Temp == "capability.motionSensor" or Temp == "capability.accelerationSensor" or @@ -129,7 +130,7 @@ def AnalyzeCapabilities(Temp, appName, F): def AnalyzePhysicalInteraction(app1Capab, app2Capab): #Light if ("capability.illuminanceMeasurement" in app1Capab) and ("capability.switch" in app2Capab or - "capability.switchLevel" in app2Capab): + "capability.switchLevel" in app2Capab or "capability.colorControl" in app2Capab): print ("\nWARNING: Potential PHYSICAL CONFLICT (light) detected between App1 and App2!\n") #Motion # TODO: Technically this is not entirely precise since we need to be able to detect that the other app creates motion diff --git a/ModelCheck.py b/ModelCheck.py index 601323e..b47a095 100644 --- a/ModelCheck.py +++ b/ModelCheck.py @@ -52,8 +52,11 @@ if useSecondList is False: else: # Generate pairs from 2 lists for i in range(len(appList1)): - for j in range(len(appList2)): - appPairs.append((appList1[i], appList2[j])) + for j in range(len(appList2)): + # Skip if both are the same + if appList1[i] == appList2[j]: + continue + appPairs.append((appList1[i], appList2[j])) # PART 2: print "PHASE 2: Running JPF ...\n" @@ -63,7 +66,7 @@ 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 "==> 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") @@ -76,6 +79,6 @@ for item in appPairs: print "==> Calling JPF and generate logs ...\n" logName = jpfLogDir + item[0] + "--" + item[1] + ".log" writeLogList.write(logName + "\n") - os.system("cd " + jpfDir + ";./run.sh " + logName + " main.jpf") + #os.system("cd " + jpfDir + ";./run.sh " + logName + " main.jpf") writeLogList.close() diff --git a/run.sh b/run.sh index 7ba9baa..b0f8b05 100755 --- a/run.sh +++ b/run.sh @@ -1,2 +1,10 @@ #!/bin/bash -python ModelCheck.py ../jpf-core/ ../logs/ ../smartapps/ ../smartapps/appList1 + +# Device conflict +#python ModelCheck.py ../jpf-core/ ../logs/ ../smartapps/ ../smartapps/appList1 + +# Physical conflict +python ModelCheck.py ../jpf-core/ ../logs/ ../smartapps/ appLists/physical-interaction/soundsensorAppList appLists/physical-interaction/soundAppList +python ModelCheck.py ../jpf-core/ ../logs/ ../smartapps/ appLists/physical-interaction/motionsensorAppList appLists/physical-interaction/motionAppList +python ModelCheck.py ../jpf-core/ ../logs/ ../smartapps/ appLists/physical-interaction/illuminancesensorAppList appLists/physical-interaction/lightAppList +python ModelCheck.py ../jpf-core/ ../logs/ ../smartapps/ appLists/physical-interaction/watersensorAppList appLists/physical-interaction/watervalveAppList \ No newline at end of file