from Fortuna import *
# from fortuna_extras.fortuna_pure import *
import random  # Base Cases


if __name__ == "__main__":
    N = 6
    population = ["Apple", "Banana", "Cherry", "Grape", "Lime", "Orange", "Pineapple"]
    cum_weights = [7, 11, 13, 23, 26, 30, 35]
    rel_weights = [7, 4, 2, 10, 3, 4, 5]
    cum_weighted_choice = CumulativeWeightedChoice(zip(cum_weights, population))
    rel_weighted_choice = RelativeWeightedChoice(zip(rel_weights, population))
    truffle_shuffle = TruffleShuffle(population)
    quantum_monty = QuantumMonty(population)
    flex_cat = FlexCat({
        'Cat_A': ('A1', 'A2', 'A3'),
        'Cat_B': ('B1', 'B2', 'B3'),
        'Cat_C': ('C1', 'C2', 'C3'),
    })

    print("\nBase Cases: random module")
    print("-" * 73)
    print(f"random.randint({-N}, {N}):")
    distribution_timer(random.randint, -N, N)
    print(f"random.randrange({-N}, {N}):")
    distribution_timer(random.randrange, -N, N)
    print(f"random.choice(population):")
    distribution_timer(random.choice, population)
    print(f"random.choices(population, cum_weights=cum_weights):")
    distribution_timer(random.choices, population, cum_weights=cum_weights)
    print(f"random.choices(population, weights=rel_weights):")
    distribution_timer(random.choices, population, weights=rel_weights)
    print(f"random.shuffle(population):")
    distribution_timer(random.shuffle, population, dist=False)
    print(f"random.random():")
    distribution_timer(random.random, dist=False)

    print("\nTest Cases: Fortuna Functions")
    print("-" * 73)
    print(f"random_range({-N}, {N}):")
    distribution_timer(random_range, -N, N)
    print(f"random_below({N}):")
    distribution_timer(random_below, N)
    print(f"d({N}):")
    distribution_timer(d, N)
    print(f"dice(3, {N}):")
    distribution_timer(dice, 3, N)
    print(f"plus_or_minus({N}):")
    distribution_timer(plus_or_minus, N)
    print(f"plus_or_minus_linear({N}):")
    distribution_timer(plus_or_minus_linear, N)
    print(f"plus_or_minus_curve({N}):")
    distribution_timer(plus_or_minus_curve, N)
    print(f"plus_or_minus_linear_down({N}):")
    distribution_timer(plus_or_minus_linear_down, N)
    print(f"plus_or_minus_curve_down({N}):")
    distribution_timer(plus_or_minus_curve_down, N)
    print(f"zero_flat({N}):")
    distribution_timer(zero_flat, N)
    print(f"zero_cool({N}):")
    distribution_timer(zero_cool, N)
    print(f"zero_extreme({N}):")
    distribution_timer(zero_extreme, N)
    print(f"max_cool({N}):")
    distribution_timer(max_cool, N)
    print(f"max_extreme({N}):")
    distribution_timer(max_extreme, N)
    print(f"mostly_middle({N}):")
    distribution_timer(mostly_middle, N)
    print(f"mostly_center({N}):")
    distribution_timer(mostly_center, N)
    print(f"mostly_not_middle({N}):")
    distribution_timer(mostly_not_middle, N)
    print(f"mostly_not_center({N}):")
    distribution_timer(mostly_not_center, N)
    print(f"random_value(population):")
    distribution_timer(random_value, population)
    print(f"percent_true(30):")
    distribution_timer(percent_true, 30)
    print(f"percent_true_float(33.33):")
    distribution_timer(percent_true_float, 33.33)
    print(f"random_float():")
    distribution_timer(random_float, dist=False)
    print(f"shuffle(population):")
    distribution_timer(shuffle, population, dist=False)

    print("\nTest Cases: Fortuna Classes")
    print("-" * 73)
    print(f"cum_weighted_choice():")
    distribution_timer(cum_weighted_choice)
    print(f"rel_weighted_choice():")
    distribution_timer(rel_weighted_choice)
    print(f"truffle_shuffle():")
    distribution_timer(truffle_shuffle)
    print(f"quantum_monty.mostly_flat():")
    distribution_timer(quantum_monty.mostly_flat)
    print(f"quantum_monty.mostly_middle():")
    distribution_timer(quantum_monty.mostly_middle)
    print(f"quantum_monty.mostly_center():")
    distribution_timer(quantum_monty.mostly_center)
    print(f"quantum_monty.mostly_front():")
    distribution_timer(quantum_monty.mostly_front)
    print(f"quantum_monty.mostly_back():")
    distribution_timer(quantum_monty.mostly_back)
    print(f"quantum_monty.mostly_first():")
    distribution_timer(quantum_monty.mostly_first)
    print(f"quantum_monty.mostly_last():")
    distribution_timer(quantum_monty.mostly_last)
    print(f"quantum_monty.mostly_cycle():")
    distribution_timer(quantum_monty.mostly_cycle)
    print(f"quantum_monty.quantum_monty():")
    distribution_timer(quantum_monty.quantum_monty)
    print(f"quantum_monty.mostly_not_middle():")
    distribution_timer(quantum_monty.mostly_not_middle)
    print(f"quantum_monty.mostly_not_center():")
    distribution_timer(quantum_monty.mostly_not_center)
    print(f"quantum_monty.quantum_not_monty():")
    distribution_timer(quantum_monty.quantum_not_monty)
    print(f"flex_cat():")
    distribution_timer(flex_cat)
    print(f"flex_cat('Cat_A'):")
    distribution_timer(flex_cat, 'Cat_A')
    print(f"flex_cat('Cat_B'):")
    distribution_timer(flex_cat, 'Cat_B')
    print(f"flex_cat('Cat_C'):")
    distribution_timer(flex_cat, 'Cat_C')
