|
@@ -13,7 +13,7 @@ class CommunicationProcessor():
|
|
|
def __init__(self, packets):
|
|
|
self.packets = packets
|
|
|
|
|
|
- def set_mapping(self, packets, mapped_ids, id_comms):
|
|
|
+ def set_mapping(self, packets: list, mapped_ids: dict, id_comms:dict):
|
|
|
"""
|
|
|
Set the selected mapping for this communication processor.
|
|
|
|
|
@@ -301,7 +301,7 @@ class CommunicationProcessor():
|
|
|
msg_id += 1
|
|
|
|
|
|
# store the retrieved information in this object for later use
|
|
|
- self.init_ids, self.respnd_ids, self.both_ids = init_ids, respnd_ids, both_ids
|
|
|
+ self.init_ids, self.respnd_ids, self.both_ids = sorted(init_ids), sorted(respnd_ids), sorted(both_ids)
|
|
|
self.messages = msgs
|
|
|
|
|
|
# return the retrieved information
|
|
@@ -317,7 +317,7 @@ class CommunicationProcessor():
|
|
|
:param prob_rspnd_local: the probabilty that a responder is local
|
|
|
"""
|
|
|
init_ids, respnd_ids, both_ids = self.init_ids, self.respnd_ids, self.both_ids
|
|
|
- id_comms = self.id_comms
|
|
|
+ id_comms = sorted(self.id_comms)
|
|
|
external_ids = set()
|
|
|
local_ids = set()
|
|
|
ids = self.ids
|
|
@@ -327,6 +327,7 @@ class CommunicationProcessor():
|
|
|
Map the given ID as local and handle its communication partners' locality
|
|
|
"""
|
|
|
# loop over all communication entries
|
|
|
+
|
|
|
for id_comm in id_comms:
|
|
|
ids = id_comm.split("-")
|
|
|
other = ids[0] if id_ == ids[1] else ids[1]
|