Exemplo n.º 1
0
    # both agents interact (times):
    interactions = 300
    #
    payouts, moves, states = morl_interact_multiple_episodic(
        chebyagent,
        problem,
        interactions,
        max_episode_length=300,
        discounted_eps=False)
    # print("TEST(cheby): interactions made: \nP: "+str(payouts[:])+",\n M: " + str(moves[:]) + ",\n S: " +
    #       str(states[:]) + '\n')
    #, moves, states = morl_interact_multiple_average_episodic(chebyagent, problem, 10, 500)

    # time = problem.time_token
    chebyagent._epsilon = 0.9
    payouts, moves2, states = morl_interact_multiple_episodic(
        chebyagent, problem, 1, 300)
    velocity = problem.get_velocities(states)
    states = problem.create_plottable_states(states)
    plot_hypervolume([chebyagent], problem)
    forward_acc = []
    backward_acc = []
    nothin = []
    for i in xrange(len(moves)):
        counter = list(moves[i])
        nothin.append(counter.count(0))
        forward_acc.append(counter.count(1))
        backward_acc.append(counter.count(2))
    x = np.arange(len(nothin))
    if show_trend:
Exemplo n.º 2
0
    # agent interact (times):
    interactions = 200
    #
    payouts, moves, states = morl_interact_multiple_episodic(
        chebyagent,
        problem,
        interactions,
        max_episode_length=300,
        discounted_eps=False)
    # print("TEST(cheby): interactions made: \nP: "+str(payouts[:])+",\n M: " + str(moves[:]) + ",\n S: " +
    #       str(states[:]) + '\n')
    #, moves, states = morl_interact_multiple_average_episodic(chebyagent, problem, 10, 500)

    # time = problem.time_token
    chebyagent._epsilon = 1.0
    payouts, moves2, states = morl_interact_multiple_episodic(
        chebyagent, problem, 1, 300)
    velocity = problem.get_velocities(states)
    states = problem.create_plottable_states(states)
    plot_hypervolume([chebyagent], problem)
    forward_acc = []
    backward_acc = []
    nothin = []
    for i in xrange(len(moves)):
        counter = list(moves[i])
        nothin.append(counter.count(0))
        forward_acc.append(counter.count(1))
        backward_acc.append(counter.count(2))
    x = np.arange(len(nothin))
    if show_trend: