|
@@ -169,7 +169,7 @@ class CommunicationProcessor():
|
|
# setup initial variables and their values
|
|
# setup initial variables and their values
|
|
respnd_ids = set()
|
|
respnd_ids = set()
|
|
# msgs --> the filtered messages, msg_id --> an increasing ID to give every message an artificial primary key
|
|
# msgs --> the filtered messages, msg_id --> an increasing ID to give every message an artificial primary key
|
|
- msgs, msg_id = {}, 0
|
|
|
|
|
|
+ msgs, msg_id = [], 0
|
|
# keep track of previous request to find connections
|
|
# keep track of previous request to find connections
|
|
prev_reqs = {}
|
|
prev_reqs = {}
|
|
init_ids = self.init_ids
|
|
init_ids = self.init_ids
|
|
@@ -193,7 +193,7 @@ class CommunicationProcessor():
|
|
# convert the abstract message into a message object to handle it better
|
|
# convert the abstract message into a message object to handle it better
|
|
msg_str = "{0}-{1}".format(id_src, id_dst)
|
|
msg_str = "{0}-{1}".format(id_src, id_dst)
|
|
msg = Message(msg_id, id_src, id_dst, msg_type, time)
|
|
msg = Message(msg_id, id_src, id_dst, msg_type, time)
|
|
- msgs[msg_id] = msg
|
|
|
|
|
|
+ msgs.append(msg)
|
|
prev_reqs[msg_str] = msg_id
|
|
prev_reqs[msg_str] = msg_id
|
|
|
|
|
|
# process a reply
|
|
# process a reply
|
|
@@ -209,7 +209,7 @@ class CommunicationProcessor():
|
|
msgs[refer_idx].refer_msg_id = msg_id
|
|
msgs[refer_idx].refer_msg_id = msg_id
|
|
# print(msgs[refer_idx])
|
|
# print(msgs[refer_idx])
|
|
msg = Message(msg_id, id_src, id_dst, msg_type, time, refer_idx)
|
|
msg = Message(msg_id, id_src, id_dst, msg_type, time, refer_idx)
|
|
- msgs[msg_id] = msg
|
|
|
|
|
|
+ msgs.append(msg)
|
|
# remove the request to this response from storage
|
|
# remove the request to this response from storage
|
|
del(prev_reqs[msg_str])
|
|
del(prev_reqs[msg_str])
|
|
|
|
|
|
@@ -222,7 +222,7 @@ class CommunicationProcessor():
|
|
self.messages = msgs
|
|
self.messages = msgs
|
|
|
|
|
|
# return the retrieved information
|
|
# return the retrieved information
|
|
- return self.init_ids, self.respnd_ids, msgs
|
|
|
|
|
|
+ return self.init_ids, self.respnd_ids, self.messages
|
|
|
|
|
|
|
|
|
|
def det_ext_and_local_ids(self, prob_rspnd_local: int):
|
|
def det_ext_and_local_ids(self, prob_rspnd_local: int):
|