Skip to content
Snippets Groups Projects

More deterministic sorting of processes

Merged Oscar Gustafsson requested to merge sortprocess into master
2 files
+ 17
4
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 11
3
@@ -30,9 +30,17 @@ class Process:
self._name = name
def __lt__(self, other):
return self._start_time < other.start_time or (
self._start_time == other.start_time
and self.execution_time > other.execution_time
return (
self._start_time < other.start_time
or (
self._start_time == other.start_time
and self.execution_time > other.execution_time
)
or ( # Sorting on name to possibly get deterministic behavior
self._start_time == other.start_time
and self.execution_time == other.execution_time
and self._name < other.name
)
)
@property
Loading