merged RL agent with action map plotting and added it to end of agents train loop

This commit is contained in:
Chanumask
2024-05-12 11:48:05 +02:00
parent 5c5a09be3f
commit f8aa4e0c03
3 changed files with 52 additions and 41 deletions

View File

@ -17,6 +17,7 @@ from collections import deque
from marl_factory_grid.environment.actions import Noop
from marl_factory_grid.modules import Clean, DoorUse
from marl_factory_grid.utils.plotting.plot_single_runs import plot_action_maps
class Names:
@ -571,8 +572,7 @@ class A2C:
if self.cfg[nms.ENV]["save_and_log"]:
self.create_info_maps(env, used_actions)
self.save_agent_models()
plot_action_maps(env, [self])
@torch.inference_mode(True)
def eval_loop(self, n_episodes, render=False):