예제 #1
0
    def bound(self, param_list: List[float]) -> float:
        theta = param_list[0]

        if self.number_servers == 1:
            s_net: Service = Leftover(arr=self.arr_list[1],
                                      ser=self.ser_list[0])

        elif self.number_servers == 2:
            leftover_service_list = [
                Leftover(arr=self.arr_list[1], ser=self.ser_list[0]),
                AggregateList(arr_list=self.arr_list[2], p_list=[]),
                Deconvolve(arr=self.arr_list[1], ser=self.ser_list[0])
            ]

            s_net: Service = Convolve(ser1=leftover_service_list[0],
                                      ser2=leftover_service_list[1],
                                      indep=False,
                                      p=param_list[1])

        else:
            raise ValueError(
                "This number of servers {0} is not implemented yet".format(
                    self.number_servers))

        return evaluate_single_hop(foi=self.arr_list[0],
                                   s_net=s_net,
                                   theta=theta,
                                   perform_param=self.perform_param)
예제 #2
0
def new_delay(theta: float, delay: int, a_1: ArrivalDistribution,
              a_2: ArrivalDistribution, s_1: ConstantRate,
              s_2: TokenBucketConstant, s_3: ConstantRate) -> float:
    s_net: Service = Convolve(ser1=Leftover(arr=a_2, ser=s_1),
                              ser2=Leftover(arr=s_2, ser=s_3),
                              indep=True)

    return evaluate_single_hop(foi=a_1,
                               s_net=s_net,
                               theta=theta,
                               perform_param=PerformParameter(
                                   perform_metric=PerformEnum.DELAY_PROB,
                                   value=delay))
    def bound(self, param_list: List[float]) -> float:
        theta = param_list[0]

        s_net: Service = Leftover(arr=self.arr_list[self.number_servers + 1],
                                  ser=self.ser_list[self.number_servers])

        for _i in range(self.number_servers, -1, -1):
            s_net = Convolve(ser1=s_net, ser2=self.ser_list[_i])
            s_net = Leftover(arr=self.arr_list[_i + 1], ser=s_net)

        return evaluate_single_hop(foi=self.arr_list[0],
                                   s_net=s_net,
                                   theta=theta,
                                   perform_param=self.perform_param)
예제 #4
0
def standard_delay(theta: float, p: float, delay: int,
                   a_1: ArrivalDistribution, a_2: ArrivalDistribution,
                   a_3: ArrivalDistribution, s_1: ConstantRate,
                   s_2: ConstantRate, s_3: ConstantRate) -> float:
    f_3_output: Arrival = Deconvolve(arr=a_3,
                                     ser=Leftover(arr=Deconvolve(arr=a_2,
                                                                 ser=s_1),
                                                  ser=s_2))
    s_net: Service = Convolve(ser1=Leftover(arr=a_2, ser=s_1),
                              ser2=Leftover(arr=f_3_output, ser=s_3),
                              indep=False,
                              p=p)

    return evaluate_single_hop(foi=a_1,
                               s_net=s_net,
                               theta=theta,
                               perform_param=PerformParameter(
                                   perform_metric=PerformEnum.DELAY_PROB,
                                   value=delay))
    def bound(self, param_list: List[float]) -> float:
        theta = param_list[0]

        leftover_service_list: List[Service] = [
            Leftover(arr=self.arr_list[i + 1], ser=self.ser_list[i])
            for i in range(self.number_servers)
        ]

        s_net: Service = leftover_service_list[0]
        for i in range(1, self.number_servers):
            s_net = Convolve(s_net, leftover_service_list[i])

        return evaluate_single_hop(
            foi=self.arr_list[0],
            s_net=s_net,
            theta=theta,
            perform_param=self.perform_param)
예제 #6
0
    def bound(self, param_list: List[float]) -> float:
        theta = param_list[0]

        output_list: List[Arrival] = [
            Deconvolve(arr=self.arr_list[i], ser=self.ser_list[i])
            for i in range(1, self.number_servers)
        ]
        # we use i + 1, since i = 0 is the foi

        aggregated_cross: Arrival = AggregateList(
            arr_list=output_list, p_list=[])
        s_net: Service = Leftover(arr=aggregated_cross, ser=self.ser_list[0])

        return evaluate_single_hop(
            foi=self.arr_list[0],
            s_net=s_net,
            theta=theta,
            perform_param=self.perform_param)
예제 #7
0
    def bound(self, param_list: List[float]) -> float:
        theta = param_list[0]

        leftover_service_list: List[Service] = [
            Leftover(arr=self.arr_list[i + 1], ser=self.ser_list[i])
            for i in range(self.number_servers)
        ]

        delay_val = 0.0

        input_traffic = self.arr_list[0]

        for i in range(self.number_servers):
            delay_val += delay(arr=input_traffic,
                               ser=leftover_service_list[i],
                               theta=theta,
                               prob_d=self.prob_d)

            input_traffic = Deconvolve(arr=input_traffic,
                                       ser=leftover_service_list[i])

        return delay_val
예제 #8
0
    def new_bound(self, param_l_list: List[float]) -> float:
        # len(param_list) = theta (1) + output bounds (len(arr_list)-1)
        if len(param_l_list) != len(self.arr_list):
            raise NameError("Check number of parameters")

        output_list: List[Arrival] = [
            DeconvolvePower(
                arr=self.arr_list[i],
                ser=self.ser_list[i],
                l_power=param_l_list[i])
            for i in range(1, self.number_servers)
        ]
        # we use i + 1, since i = 0 is the foi

        aggregated_cross: Arrival = AggregateList(
            arr_list=output_list, p_list=[])
        s_net: Service = Leftover(arr=aggregated_cross, ser=self.ser_list[0])

        return evaluate_single_hop(
            foi=self.arr_list[0],
            s_net=s_net,
            theta=param_l_list[0],
            perform_param=self.perform_param)