Explorar el Código

Add comparisons for Events.

Bentley James Oakes hace 7 años
padre
commit
d50dfd4c20
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      src/python_sccd/python_sccd_runtime/statecharts_core.py

+ 5 - 0
src/python_sccd/python_sccd_runtime/statecharts_core.py

@@ -402,6 +402,11 @@ class Event(object):
         self.parameters = parameters
         self.port = port
 
+    #for comparisons in heaps
+    def __lt__(self, other):
+        s = str(self.name) + str(self.parameters) + str(self.port)
+        return len(s)
+
     def getName(self):
         return self.name