summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoïc Guégan <loic.guegan@mailbox.org>2024-10-24 23:14:53 +0200
committerLoïc Guégan <loic.guegan@mailbox.org>2024-10-24 23:14:53 +0200
commit6f007a0bec729807a56c67e88c2dd12ec9665020 (patch)
tree824fcc0130ffd3458998386e9a530191b13ee598
parent247999c6d1c105438cf40f457720510d78009c2a (diff)
Debug
-rw-r--r--esds/simulator.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/esds/simulator.py b/esds/simulator.py
index f98bff9..d8557cc 100644
--- a/esds/simulator.py
+++ b/esds/simulator.py
@@ -271,9 +271,8 @@ class Simulator:
#### All CASES WHERE INTERFERENCES OCCUR
# receiver_is_sending
# 1) check if current com receiver already sending
- # 2) if yes, we check if current com is one that should be marked as interterference (current com is actually involving the receiver) see interferences_bug1 test
- # 3) ensure not dealing with the special com (where sender is the receiver)
- receiver_is_sending=(receiver==com_sender and com_receiver==receiver and sender!=receiver)
+ # 2) ensure not dealing with the special com (where sender is the receiver)
+ receiver_is_sending=(receiver==com_sender and sender!=receiver)
# receiver_is_receiving
# 1) check if the current com receiver is already receiving (thus interference)
# 2) ensure not dealing with the special com (where sender is the receiver)
@@ -284,8 +283,10 @@ class Simulator:
sender_is_receiving=(com_receiver==sender and com_sender!=com_sender)
##### Update com return code
if receiver_is_sending or receiver_is_receiving or sender_is_receiving:
- status=True
- if com_sender != com_receiver:
+ status=True # receiver_is_sending is handled by return code (see self.communicate())
+ # In the following test, we ignore the receiver_is_sending (see comment line above)
+ # By ignoring receiver_is_sending, we solve the interferences_bug1 (see tests)
+ if not receiver_is_sending and com_sender != com_receiver:
event[2][10]=RCode.INTERFERENCES # Tell the sender/receiver interferences occurred
return status