コード例 #1
0
def integrate_toy_example(x):
    """

    :param x: n_products * [int]
    :return: [float]
    """
    val = simulation(x,
                     10000,
                     n_customers,
                     n_products,
                     cost,
                     sell_price,
                     seed=1)
    return val
コード例 #2
0
def toy_example(n_samples, x):
    """

    :param n_samples: int
    :param x: (n_products * [int] + [n_products * [float]]) inventory levels, and total sum over the
        number of custombers of the Gumbel random vector associated to the n_products.
    :return: [float, float]

    """

    val = simulation(x,
                     n_samples,
                     n_customers,
                     n_products,
                     cost,
                     sell_price,
                     seed=1)
    return val
コード例 #3
0
def toy_example(n_samples, x):
    """

    :param n_samples: int
    :param x: (n_products * [int] + [int]) inventory levels, and total sum over the
        number of custombers of the Gumbel random vector associated to the n_products.
    :return: [float, float]

    """
    inv_levels = x[0:-1]
    inv_levels = [int(a) for a in inv_levels]

    task = x[-1]
    val = simulation(inv_levels,
                     n_samples,
                     n_customers,
                     n_products,
                     cost,
                     sell_price,
                     set_sum_exp=set_constraints[task],
                     seed=1)

    return val