Browse Source

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

Yentl Van Tendeloo 7 years ago
parent
commit
6de006fe9a
3 changed files with 3 additions and 3 deletions
  1. 1 1
      models/WSC/pm_example.mvc
  2. 1 1
      models/WSC/pm_library.mvc
  3. 1 1
      wrappers/modelverse_SCCD.py

+ 1 - 1
models/WSC/pm_example.mvc

@@ -33,7 +33,7 @@ Activity evaluate {
 }
 }
 ExclusiveChoice choice {
 ExclusiveChoice choice {
     name = "xor_0"
     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 {
 Finish finish {
     name = "finish"
     name = "finish"

+ 1 - 1
models/WSC/pm_library.mvc

@@ -305,7 +305,7 @@ AtomicDEVSBlock ExclusiveChoice {
         """
         """
 
 
     outputFnc = """
     outputFnc = """
-        if self.state.choice == 0:
+        if self.state.choice == True:
             return {self.my_ports['control_out1']: {}}
             return {self.my_ports['control_out1']: {}}
         else:
         else:
             return {self.my_ports['control_out2']: {}}
             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)
 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 author: Yentl Van Tendeloo
 Model name:   MvK Server
 Model name:   MvK Server