소스 검색

Add comparisons for Events.

Bentley James Oakes 7 년 전
부모
커밋
d50dfd4c20
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  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