Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/ Smac Load #283

Merged
merged 3 commits into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mava/utils/environments/render_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Renderer:
Adapted from https://github.com/oxwhirl/smac/pull/71.
"""

def __init__(self, env: StarCraft2Env, mode: str):
def __init__(self, env: "StarCraft2Env", mode: str):
os.environ["PYGAME_HIDE_SUPPORT_PROMPT"] = "hide"

self.env = env
Expand Down
2 changes: 1 addition & 1 deletion mava/utils/environments/smac_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from mava.wrappers import SMACEnvWrapper # type:ignore


def load_smac_env(env_config: Dict[str, Any]) -> StarCraft2Env:
def load_smac_env(env_config: Dict[str, Any]) -> "StarCraft2Env":
"""Loads a smac environment given a config dict. Also, the possible agents in the
environment are set"""

Expand Down
2 changes: 1 addition & 1 deletion mava/wrappers/smac.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class SMACEnvWrapper(ParallelEnvWrapper):
Based on RLlib wrapper provided by SMAC.
"""

def __init__(self, environment: StarCraft2Env) -> None:
def __init__(self, environment: "StarCraft2Env") -> None:
"""Create a new multi-agent StarCraft env compatible with RLlib.
Arguments:
smac_args (dict): Arguments to pass to the underlying
Expand Down
2 changes: 1 addition & 1 deletion tests/systems/dial_system_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_recurrent_dial_on_debugging_env(self) -> None:
system = dial.DIAL(
environment_factory=environment_factory,
network_factory=network_factory,
num_executors=2,
num_executors=1,
min_replay_size=16,
max_replay_size=1000,
batch_size=16,
Expand Down
8 changes: 4 additions & 4 deletions tests/systems/mad4pg_system_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_mad4pg_on_debugging_env(self) -> None:
system = mad4pg.MAD4PG(
environment_factory=environment_factory,
network_factory=network_factory,
num_executors=2,
num_executors=1,
batch_size=32,
min_replay_size=32,
max_replay_size=1000,
Expand Down Expand Up @@ -103,7 +103,7 @@ def test_recurrent_mad4pg_on_debugging_env(self) -> None:
system = mad4pg.MAD4PG(
environment_factory=environment_factory,
network_factory=network_factory,
num_executors=2,
num_executors=1,
batch_size=16,
min_replay_size=16,
max_replay_size=1000,
Expand Down Expand Up @@ -160,7 +160,7 @@ def test_centralised_mad4pg_on_debugging_env(self) -> None:
system = mad4pg.MAD4PG(
environment_factory=environment_factory,
network_factory=network_factory,
num_executors=2,
num_executors=1,
batch_size=16,
min_replay_size=16,
max_replay_size=1000,
Expand Down Expand Up @@ -216,7 +216,7 @@ def test_state_based_mad4pg_on_debugging_env(self) -> None:
system = mad4pg.MAD4PG(
environment_factory=environment_factory,
network_factory=network_factory,
num_executors=2,
num_executors=1,
batch_size=16,
min_replay_size=16,
max_replay_size=1000,
Expand Down
10 changes: 5 additions & 5 deletions tests/systems/maddpg_system_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_maddpg_on_debugging_env(self) -> None:
system = maddpg.MADDPG(
environment_factory=environment_factory,
network_factory=network_factory,
num_executors=2,
num_executors=1,
batch_size=32,
min_replay_size=32,
max_replay_size=1000,
Expand Down Expand Up @@ -105,7 +105,7 @@ def test_recurrent_maddpg_on_debugging_env(self) -> None:
system = maddpg.MADDPG(
environment_factory=environment_factory,
network_factory=network_factory,
num_executors=2,
num_executors=1,
batch_size=16,
min_replay_size=16,
max_replay_size=1000,
Expand Down Expand Up @@ -162,7 +162,7 @@ def test_centralised_maddpg_on_debugging_env(self) -> None:
system = maddpg.MADDPG(
environment_factory=environment_factory,
network_factory=network_factory,
num_executors=2,
num_executors=1,
batch_size=16,
min_replay_size=16,
max_replay_size=1000,
Expand Down Expand Up @@ -217,7 +217,7 @@ def test_networked_maddpg_on_debugging_env(self) -> None:
system = maddpg.MADDPG(
environment_factory=environment_factory,
network_factory=network_factory,
num_executors=2,
num_executors=1,
batch_size=16,
min_replay_size=16,
max_replay_size=1000,
Expand Down Expand Up @@ -274,7 +274,7 @@ def test_state_based_maddpg_on_debugging_env(self) -> None:
system = maddpg.MADDPG(
environment_factory=environment_factory,
network_factory=network_factory,
num_executors=2,
num_executors=1,
batch_size=16,
min_replay_size=16,
max_replay_size=1000,
Expand Down
4 changes: 2 additions & 2 deletions tests/systems/madqn_system_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_madqn_on_debugging_env(self) -> None:
system = madqn.MADQN(
environment_factory=environment_factory,
network_factory=network_factory,
num_executors=2,
num_executors=1,
batch_size=32,
min_replay_size=32,
max_replay_size=1000,
Expand Down Expand Up @@ -101,7 +101,7 @@ def test_recurrent_madqn_on_debugging_env(self) -> None:
system = madqn.MADQN(
environment_factory=environment_factory,
network_factory=network_factory,
num_executors=2,
num_executors=1,
batch_size=16,
min_replay_size=16,
max_replay_size=1000,
Expand Down
2 changes: 1 addition & 1 deletion tests/systems/mappo_system_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_mappo_on_debugging_env(self) -> None:
system = mappo.MAPPO(
environment_factory=environment_factory,
network_factory=network_factory,
num_executors=2,
num_executors=1,
batch_size=32,
max_queue_size=1000,
policy_optimizer=snt.optimizers.Adam(learning_rate=1e-3),
Expand Down
2 changes: 1 addition & 1 deletion tests/systems/qmix_system_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_qmix_on_debugging_env(self) -> None:
system = qmix.QMIX(
environment_factory=environment_factory,
network_factory=network_factory,
num_executors=2,
num_executors=1,
batch_size=32,
min_replay_size=32,
max_replay_size=1000,
Expand Down
2 changes: 1 addition & 1 deletion tests/systems/vdn_system_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_vdn_on_debugging_env(self) -> None:
system = vdn.VDN(
environment_factory=environment_factory,
network_factory=network_factory,
num_executors=2,
num_executors=1,
batch_size=32,
min_replay_size=32,
max_replay_size=1000,
Expand Down