diff --git a/nmmo/entity/entity.py b/nmmo/entity/entity.py index 2a091ba2..0d7f9a41 100644 --- a/nmmo/entity/entity.py +++ b/nmmo/entity/entity.py @@ -332,4 +332,3 @@ def attack_level(self) -> int: mage = self.skills.mage.level.val return int(max(melee, ranged, mage)) - diff --git a/nmmo/entity/entity_manager.py b/nmmo/entity/entity_manager.py index 8679984e..6dc2dc2a 100644 --- a/nmmo/entity/entity_manager.py +++ b/nmmo/entity/entity_manager.py @@ -136,7 +136,7 @@ def reset(self): self.spawned = OrderedSet() def spawn_individual(self, r, c, idx): - pop, agent = next(self.agents) + agent = next(self.agents) agent = agent(self.config, idx) player = Player(self.realm, (r, c), agent) super().spawn(player) diff --git a/nmmo/entity/npc.py b/nmmo/entity/npc.py index 84881dac..c593b64f 100644 --- a/nmmo/entity/npc.py +++ b/nmmo/entity/npc.py @@ -3,7 +3,6 @@ from nmmo.entity import entity from nmmo.io import action as Action -from nmmo.lib.colors import Neon from nmmo.systems import combat, droptable from nmmo.systems.ai import policy from nmmo.systems import item as Item @@ -46,6 +45,7 @@ def packet(self): return packet +# pylint: disable=no-member class NPC(entity.Entity): def __init__(self, realm, pos, iden, name, npc_type): super().__init__(realm, pos, iden, name) diff --git a/nmmo/lib/spawn.py b/nmmo/lib/spawn.py index c80aae4d..e4eb5d6b 100644 --- a/nmmo/lib/spawn.py +++ b/nmmo/lib/spawn.py @@ -4,8 +4,6 @@ class SequentialLoader: '''config.PLAYER_LOADER that spreads out agent populations''' def __init__(self, config): items = config.PLAYERS - for idx, itm in enumerate(items): - itm.policyID = idx self.items = items self.idx = -1 @@ -15,28 +13,7 @@ def __iter__(self): def __next__(self): self.idx = (self.idx + 1) % len(self.items) - return self.idx, self.items[self.idx] - -class TeamLoader: - '''config.PLAYER_LOADER that loads agent populations adjacent''' - def __init__(self, config): - items = config.PLAYERS - self.team_size = config.PLAYER_N // len(items) - - for idx, itm in enumerate(items): - itm.policyID = idx - - self.items = items - self.idx = -1 - - def __iter__(self): - return self - - def __next__(self): - self.idx += 1 - team_idx = self.idx // self.team_size - return team_idx, self.items[team_idx] - + return self.items[self.idx] def spawn_continuous(config): '''Generates spawn positions for new agents diff --git a/tests/testhelpers.py b/tests/testhelpers.py index ef887c4f..be2236aa 100644 --- a/tests/testhelpers.py +++ b/tests/testhelpers.py @@ -332,21 +332,21 @@ def _check_assert_make_action(self, env, atn, test_cond): self.assertEqual( cond['ent_mask'], self._check_ent_mask(ent_obs, atn, cond['tgt_id']), - "ent_id: {}, atn: {}, tgt_id: {}".format(ent_id, atn, cond['tgt_id']) + f"ent_id: {ent_id}, atn: {ent_id}, tgt_id: {cond['tgt_id']}" ) if atn in [action.Give]: self.assertEqual( cond['inv_mask'], self._check_inv_mask(ent_obs, atn, cond['item_sig']), - "ent_id: {}, atn: {}, item_sig: {}".format(ent_id, atn, cond['item_sig']) + f"ent_id: {ent_id}, atn: {ent_id}, tgt_id: {cond['item_sig']}" ) if atn in [action.Buy]: self.assertEqual( cond['mkt_mask'], self._check_mkt_mask(ent_obs, cond['item_id']), - "ent_id: {}, atn: {}, item_id: {}".format(ent_id, atn, cond['item_id']) + f"ent_id: {ent_id}, atn: {ent_id}, tgt_id: {cond['item_id']}" ) # append the actions