Browse Source

Add comparisons for Events.

Bentley James Oakes 7 years ago
parent
commit
d50dfd4c20
1 changed files with 5 additions and 0 deletions
  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