Ejemplo n.º 1
0
height = 36
N_cust = 120
pixel_ratio = 20
num_agents = 12
theme = "cluster"
strategy = "Random_test_4"
steps = 520
RUNS = 65
strategies = [0, 0.25, 0.5, 0.75, 1]
adaptive = True

cust_d, score_d, hapiness_d, hist_d, strategy_d, dict2 = [], [], [], [], [], []

for run in range(RUNS):
    print("RUN ", run)
    park = Themepark(num_agents, N_cust, width, height, strategy, theme, steps,
                     strategies, adaptive)

    for i in range(steps + 1):
        print("step", i)
        park.step()

    print("Number of run:", run)

    try:
        cust = pickle.load(open("data/customers.p", 'rb'))
        score = pickle.load(open("data/park_score.p", "rb"))
        hapiness = pickle.load(open("data/hapiness.p", "rb"))
        hist = pickle.load(open("data/cust_history.p", 'rb'))
        strategy_hist = pickle.load(open("data/strategy_history.p", 'rb'))
        dict2_data = pickle.load(open("data/eff_score_history.p", 'rb'))
    except:
Ejemplo n.º 2
0
strategies = [0, 0.25, 0.5, 0.75, 1, "Random"]

N_cust = 120
num_agents = 12
steps = 520
RUNS = 65

cust_d, score_d, hapiness_d, hist_d, strat_d, score_ed = [], [], [], [], [], []

for j in range(RUNS):

    print()
    print("RUN ", j)
    print()

    park = Themepark(num_agents, N_cust, width, height, strategy, theme, steps,
                     None)

    for i in range(steps + 1):
        print("step", i)
        park.step()

    cust = pickle.load(open("../data/customers.p", 'rb'))
    score = pickle.load(open("../data/park_score.p", "rb"))
    hapiness = pickle.load(open("../data/hapiness.p", "rb"))
    hist = pickle.load(open("../data/cust_history.p", 'rb'))
    strategy_hist = pickle.load(open("../data/stategy_history.p", 'rb'))

    cust_d.append(cust)
    score_d.append(score)
    hapiness_d.append(hapiness)
    hist_d.append(hist)