-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.py
More file actions
29 lines (21 loc) · 819 Bytes
/
Main.py
File metadata and controls
29 lines (21 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from Agent import Agent, QNetwork, Agent_subgoal, ActorCritic, Q_table_agent_selection_agent
from Monitor import interact, interact1
import gym
import numpy as np
from taxi import TaxiEnv
import tensorflow as tf
from memory import Memory
from frozen_lake import FrozenLakeEnv
env = FrozenLakeEnv()
#env = TaxiEnv()
agent1 = Agent()
agent2 = Agent()
agent3 = Agent()
agent4 = Agent()
agent_selection = Q_table_agent_selection_agent()
agent = Agent_subgoal()
#agent = QNetwork()
#agent = ActorCritic()
avg_rewards, best_avg_reward = interact(env, agent1,agent2,agent3,agent4,agent_selection, num_episodes=50000)
avg_rewards_single, best_avg_reward_single = interact1(env, agent, num_episodes=50000)
print("Multi-Agent average reward =", max(avg_rewards), "Single-Agent average reward =", max(avg_rewards_single))