def setUp(self):
        location_a = Location(5, 3)
        node_a = Node(node_id="1", location=location_a)
        arguments_a = {'arg_1': 1, 'arg_2': 2, 'arg_3': 3}
        self.asynchronous_event_1 = AsynchronousEvent(
            node_id=node_a.id,
            function_to_call=self.an_example_function,
            arguments=arguments_a)

        location_b = Location(1, 2)
        node_b = Node(node_id="1", location=location_b)
        arguments_b = {'arg_1': 5, 'arg_2': 4, 'arg_3': 3}
        self.asynchronous_event_2 = AsynchronousEvent(
            node_id=node_b.id,
            function_to_call=self.an_example_function,
            arguments=arguments_b)

        self.simulator_event_1 = SimulatorEvent(arguments=arguments_a)
        self.simulator_event_2 = SimulatorEvent(arguments=arguments_b)

        self.event_broker = EventBroker()
Beispiel #2
0
 def __init__(self, origin_id, destiny_id):
     arguments = {'origin_id':origin_id, 'destiny_id':destiny_id}
     AsynchronousEvent.__init__(self, node_id=origin_id, function_to_call=DsrNode.start_looking_for_target, arguments=arguments)
Beispiel #3
0
 def __init__(self, origin_id, destiny_id):
     arguments = {'destiny_id':destiny_id}
     AsynchronousEvent.__init__(self, node_id=origin_id, function_to_call=SimpleNode.handle_send_msg_event, arguments=arguments)
Beispiel #4
0
 def __init__(self, origin_id, destiny_id, random_walk_multiply=1, random_walk_max_hop=100, random_walk_time_to_give_up=100+20):
     arguments = {'origin_id':origin_id, 'destiny_id':destiny_id, 'random_walk_multiply':random_walk_multiply, 'random_walk_max_hop':random_walk_max_hop, 'random_walk_time_to_give_up':random_walk_time_to_give_up}
     AsynchronousEvent.__init__(self, node_id=origin_id, function_to_call=BfgNode.start_looking_for_target, arguments=arguments)