Skip to content
Snippets Groups Projects
Commit acc51350 authored by Christoph Kowalski's avatar Christoph Kowalski
Browse files

Flattened Int converter and supressed logs

parent 4bfbd814
No related branches found
No related tags found
2 merge requests!110V1.2.0 changes,!109SB3 RL with Hydra
Pipeline #61113 passed
......@@ -717,7 +717,7 @@ class PlateDispenser(Counter):
[self.create_item() for _ in range(self.plate_config.dirty_plates)]
)
if self.plate_config.clean_plates > 0:
log.info(f"Setup {self.plate_config.dirty_plates} clean plates.")
#log.info(f"Setup {self.plate_config.dirty_plates} clean plates.")
self.occupied_by.extend(
[
self.create_item(clean=True)
......
......@@ -587,7 +587,7 @@ class Environment:
for callback_name, setup_kwargs in self.environment_config[
"hook_callbacks"
].items():
log.info(f"Setup hook callback {callback_name}")
#log.info(f"Setup hook callback {callback_name}")
hooks_via_callback_class(name=callback_name, env=self, **setup_kwargs)
def increment_score(self, score: int | float, info: str = ""):
......
......@@ -615,7 +615,7 @@ class Hooks:
def print_hook_callback(text, env, **kwargs):
"""Dummy hook callback. Print env time and hook ref."""
print(env.env_time, text)
#print(env.env_time, text)
class HookCallbackClass:
......
......@@ -109,8 +109,7 @@ class AdvancedStateConverterInt(StateToObservationConverter):
for free_idx in grid_idxs:
grid[free_idx[0]][free_idx[1]].append(self.counter_list.index("Empty"))
grid[free_idx[0]][free_idx[1]].append(self.counter_list.index("Empty"))
print(grid)
return np.array(grid)
return np.array(grid).flatten()
def vectorize_item(self, item, item_list):
if item is None:
......
import hydra
import stable_baselines3.common.env_checker
from gymnasium.utils.play import play
from omegaconf import DictConfig
......@@ -11,6 +12,7 @@ def main(cfg: DictConfig):
Enables steering the agent in the environment used for rl.
"""
env = EnvGymWrapper(cfg)
stable_baselines3.common.env_checker.check_env(env)
env.render_mode = "rgb_array"
play(env, keys_to_action={"a": 2, "d": 3, "w": 0, "s": 1, " ": 4, "k": 5}, noop=8)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment