added itemagent test

This commit is contained in:
Chanumask
2023-12-07 13:18:41 +01:00
parent 24221f90d1
commit 78e1d5b4fc
3 changed files with 136 additions and 40 deletions

View File

@ -4,6 +4,7 @@ from random import randint
from tqdm import trange
from marl_factory_grid.algorithms.static.TSP_dirt_agent import TSPDirtAgent
from marl_factory_grid.algorithms.static.TSP_item_agent import TSPItemAgent
from marl_factory_grid.environment.factory import Factory
if __name__ == '__main__':
@ -22,7 +23,7 @@ if __name__ == '__main__':
if render:
factory.render()
action_spaces = factory.action_space
agents = [TSPDirtAgent(factory, 0)]
agents = [TSPDirtAgent(factory, 0), TSPItemAgent(factory, 1)]
while not done:
a = [randint(0, x.n - 1) for x in action_spaces]
obs_type, _, _, done, info = factory.step(a)