Beispiel #1
0
    def __init__(self, *args, **kwargs):
        map = """
|----------
|.........+
|----------
"""
        lvl_gen = LevelGenerator(map=map, lit=True)

        lvl_gen.set_start_pos((1, 1))
        kwargs["options"] = kwargs.pop("options", [])
        kwargs["options"].append("autopickup")
        kwargs["max_episode_steps"] = kwargs.pop("max_episode_steps", 50)

        lvl_gen.add_object(name="death",
                           symbol="/",
                           cursestate="blessed",
                           place=((1, 1)))
        lvl_gen.add_monster("minotaur", args=("asleep", ), place=(9, 1))

        des_file = lvl_gen.get_des()

        rwrd_mngr = RewardManager()
        rwrd_mngr.add_kill_event("minotaur")

        super().__init__(*args,
                         des_file=des_file,
                         reward_manager=rwrd_mngr,
                         **kwargs)
Beispiel #2
0
 def __init__(self, *args, **kwargs):
     kwargs["max_episode_steps"] = kwargs.pop("max_episode_steps", 5000)
     reward_manager = RewardManager()
     reward_manager.add_message_event(["squeak"],
                                      reward=0,
                                      terminal_sufficient=True,
                                      terminal_required=True)
     reward_manager.add_kill_event("grid bug",
                                   terminal_sufficient=True,
                                   terminal_required=True)
     super().__init__(*args,
                      des_file="memory.des",
                      reward_manager=reward_manager,
                      **kwargs)