Skip to content

Commit 0e0d9f3

Browse files
committed
python: Added reason field to simulation comparison results.
1 parent 47cf58c commit 0e0d9f3

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

python/inet/simulation/compare.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,25 @@ def __init__(self, multiple_task_results=None, **kwargs):
4141
self.statistical_comparison_result = "IDENTICAL"
4242
self.statistical_comparison_color = COLOR_GREEN
4343

44+
self.reason = ""
45+
self.result = "IDENTICAL"
46+
self.color = COLOR_GREEN
4447
if self.stdout_trajectory_comparison_result == "DIVERGENT":
45-
self.result = "DIVERGENT"
48+
if self.result == "DONE":
49+
self.result = "DIVERGENT"
4650
self.color = COLOR_YELLOW
47-
elif self.fingerprint_trajectory_comparison_result == "DIVERGENT":
48-
self.result = "DIVERGENT"
51+
self.reason = self.reason + ", different STDOUT trajectories"
52+
if self.fingerprint_trajectory_comparison_result == "DIVERGENT":
53+
if self.result == "DONE":
54+
self.result = "DIVERGENT"
4955
self.color = COLOR_YELLOW
50-
elif self.statistical_comparison_result == "DIFFERENT":
51-
self.result = "DIFFERENT"
56+
self.reason = self.reason + ", different fingerprint trajectories"
57+
if self.statistical_comparison_result == "DIFFERENT":
58+
if self.result == "DONE":
59+
self.result = "DIFFERENT"
5260
self.color = COLOR_YELLOW
53-
else:
54-
self.result = "IDENTICAL"
55-
self.color = COLOR_GREEN
61+
self.reason = self.reason + ", different statistics"
62+
self.reason = None if self.reason == "" else self.reason[2:]
5663
else:
5764
self.fingerprint_trajectory_divergence_position = None
5865
self.different_statistical_results = pd.DataFrame()

0 commit comments

Comments
 (0)