Beispiel #1
0
    def __init__(self, sender, heat_mem):
        """
        Constructor.
        """
        structure_m = [erp_bloom for erp_bloom in heat_mem[:-1]]
        self.sender_id = sender.id

        arguments = {'structure_m':structure_m, 'sender_id':sender.id}
        BroadcastMessage.__init__(self, sender=sender,
                                  emit_location=sender.location,
                                  function_to_call=BfgNode.receive_hello_message,
                                  arguments=arguments)
Beispiel #2
0
    def test_broadcast_message(self):
        destination_list = [2]
        node_with_power = Node(node_id="1", location=self.location_a, power=10)

        broadcast_message = BroadcastMessage(sender=node_with_power, emit_location=self.location_a, function_to_call=TestMessages.an_example_function,
                                                     arguments={})

        self.assertEqual(broadcast_message.power, 10)
Beispiel #3
0
 def __init__(self, origin_id, sender, destiny_id, query_id, next_node, route):
     arguments = {'query_id':query_id, 'origin_id':origin_id, 'previous_node':sender, 'destiny_id':destiny_id, 'next_node':next_node, 'route':route}
     BroadcastMessage.__init__(self, sender=sender, emit_location=sender.location, function_to_call=DsrNode.run_node_backward, arguments=arguments)
Beispiel #4
0
 def __init__(self, origin_id, sender, destiny_id, query_id, route):
     arguments = {'query_id':query_id, 'origin_id':origin_id, 'previous_node_id':sender.id, 'destiny_id':destiny_id, 'route':route}
     BroadcastMessage.__init__(self, sender=sender, emit_location=sender.location, function_to_call=BfgNode.receive_dsr_type_message, arguments=arguments)
Beispiel #5
0
 def __init__(self, origin_id, sender, destiny_id, query_id, next_node_id, route):
     arguments = {'query_id':query_id, 'origin_id':origin_id, 'sender_id':sender.id, 'destiny_id':destiny_id, 'next_node_id':next_node_id, 'route':route}
     BroadcastMessage.__init__(self, sender=sender, emit_location=sender.location, function_to_call=BfgNode.receive_go_back_route, arguments=arguments)
Beispiel #6
0
    def __init__(self, origin_id, sender, destiny_id, query_id, next_node_id, route, random_walk_max_hop):
        arguments = {'query_id':query_id, 'origin_id':origin_id, 'destiny_id':destiny_id, 'next_node_id':next_node_id, 'route':route, 'random_walk_max_hop':random_walk_max_hop}

        BroadcastMessage.__init__(self, sender=sender, emit_location=sender.location, function_to_call=BfgNode.receive_random_walk_message, arguments=arguments)