def __init__(self, sim_args, metric_mng, simulation_mng):
        self.num_nodes = sim_args.num_nodes
        self.sparcity = sim_args.sparcity
        self.router_ratio = sim_args.router_ratio
        self.max_connections = sim_args.max_connections
        self.buffer_size = sim_args.buffer_size
        self.battery_weight = sim_args.battery_weight
        self.metric_mng = metric_mng
        self.simulation_mng = simulation_mng
        self.adjacency_matrix = [[0 for i in range(sim_args.num_nodes)]
                                 for j in range(sim_args.num_nodes)]

        # Set up common arguments for each layer
        self.ROUTER_ARGS = [
            layers.LinkLayerArgs(self.buffer_size),
            layers.NetworkingLayerArgs(self.battery_weight)
        ]
        top_layer_args = [
            layers.TransportLayerArgs(sim_args.retransmission_delay),
            layers.ApplicationLayerArgs()
        ]

        # Set up the class lists for routers and sensors
        self.ROUTER_CLASS_LIST = [layers.LinkLayer, layers.NetworkingLayer]
        top_layer_class_list = [layers.TransportLayer, layers.ApplicationLayer]

        self.SENSOR_ARGS = self.ROUTER_ARGS + top_layer_args
        self.SENSOR_CLASS_LIST = self.ROUTER_CLASS_LIST + top_layer_class_list
Esempio n. 2
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.stack_class_list = [layers.LinkLayer, layers.TestTopLayer]
        self.TEST_LAYER = len(self.stack_class_list) - 1

        BUFFER_SIZE = 100
        self.stack_args = [layers.LinkLayerArgs(BUFFER_SIZE), layers.TestTopLayerArgs()]
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.stack_class_list = [layers.LinkLayer, layers.NetworkingLayer, layers.TransportLayer, layers.ApplicationLayer]
        self.TEST_LAYER = len(self.stack_class_list) - 1

        BUFFER_SIZE = 100
        BATTERY_WEIGHT = 0.5
        self.RETRANSMISSION_DELAY = 1
        self.stack_args = [layers.LinkLayerArgs(BUFFER_SIZE), layers.NetworkingLayerArgs(BATTERY_WEIGHT), layers.TransportLayerArgs(self.RETRANSMISSION_DELAY), layers.ApplicationLayerArgs()]
Esempio n. 4
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.stack_class_list = [
            layers.LinkLayer, layers.NetworkingLayer, layers.TestTopLayer
        ]
        self.TEST_LAYER = len(self.stack_class_list) - 1

        BUFFER_SIZE = 100
        BATTERY_WEIGHT = 0.5
        self.stack_args = [
            layers.LinkLayerArgs(BUFFER_SIZE),
            layers.NetworkingLayerArgs(BATTERY_WEIGHT),
            layers.TestTopLayerArgs()
        ]