Pārlūkot izejas kodu

Fixed a fluke in the code that was present in the original handcoded version as well

Yentl Van Tendeloo 7 gadi atpakaļ
vecāks
revīzija
6de006fe9a

+ 1 - 1
models/WSC/pm_example.mvc

@@ -33,7 +33,7 @@ Activity evaluate {
 }
 ExclusiveChoice choice {
     name = "xor_0"
-    distribution = "lambda iteration: int(random.random() > {0: 0.99, 1: 0.9, 2: 0.8, 3: 0.5, 4: 0.2, 5: 0.1, 6: 0.02}.get(iteration, 0.0))"
+    distribution = "lambda iteration: random.random() > {0: 0.99, 1: 0.9, 2: 0.8, 3: 0.5, 4: 0.2, 5: 0.1, 6: 0.02}.get(iteration, 0.0)"
 }
 Finish finish {
     name = "finish"

+ 1 - 1
models/WSC/pm_library.mvc

@@ -305,7 +305,7 @@ AtomicDEVSBlock ExclusiveChoice {
         """
 
     outputFnc = """
-        if self.state.choice == 0:
+        if self.state.choice == True:
             return {self.my_ports['control_out1']: {}}
         else:
             return {self.my_ports['control_out2']: {}}

+ 1 - 1
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
-Date:   Tue May 15 16:42:31 2018
+Date:   Tue May 15 16:45:47 2018
 
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server