gameboy_worlds.emulation.legend_of_zelda.test_metrics
1from typing import Optional 2 3import numpy as np 4 5from gameboy_worlds.emulation.tracker import TerminationMetric 6from gameboy_worlds.emulation.legend_of_zelda.parsers import ( 7 LegendOfZeldaLinksAwakeningParser, 8 LegendOfZeldaTheOracleOfSeasonsParser 9) 10 11class ZeldaRegionMatchTerminationOnlyMetric(TerminationMetric): 12 REQUIRED_PARSER = LegendOfZeldaLinksAwakeningParser 13 _TERMINATION_NAMED_REGION = None 14 15 def determine_terminated( 16 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 17 ) -> bool: 18 if self._TERMINATION_NAMED_REGION is None: 19 raise ValueError("_TERMINATION_NAMED_REGION must be set.") 20 21 all_frames = [current_frame] 22 if recent_frames is not None: 23 all_frames = recent_frames 24 25 for frame in all_frames: 26 self.state_parser: LegendOfZeldaLinksAwakeningParser 27 matched = self.state_parser.named_region_matches_target( 28 frame, self._TERMINATION_NAMED_REGION 29 ) 30 if matched: 31 return True 32 return False 33 34class ZeldaRegionAndStateTerminationMetric(TerminationMetric): 35 REQUIRED_PARSER = LegendOfZeldaLinksAwakeningParser 36 _TERMINATION_NAMED_REGION = None 37 _TERMINATION_AGENT_STATE = None 38 39 def determine_terminated( 40 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 41 ) -> bool: 42 if self._TERMINATION_NAMED_REGION is None: 43 raise ValueError("_TERMINATION_NAMED_REGION must be set.") 44 if self._TERMINATION_AGENT_STATE is None: 45 raise ValueError("_TERMINATION_AGENT_STATE must be set.") 46 47 all_frames = [current_frame] 48 if recent_frames is not None: 49 all_frames = recent_frames 50 51 for frame in all_frames: 52 self.state_parser: LegendOfZeldaLinksAwakeningParser 53 region_matched = self.state_parser.named_region_matches_target( 54 frame, self._TERMINATION_NAMED_REGION 55 ) 56 state_matched = ( 57 self.state_parser.get_agent_state(frame) 58 == self._TERMINATION_AGENT_STATE 59 ) 60 if region_matched and state_matched: 61 return True 62 return False 63 64class ZeldaMultiRegionTerminationOnlyMetric(TerminationMetric): 65 REQUIRED_PARSER = LegendOfZeldaLinksAwakeningParser 66 _TERMINATION_NAMED_REGIONS = [] 67 68 def determine_terminated( 69 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 70 ) -> bool: 71 if len(self._TERMINATION_NAMED_REGIONS) == 0: 72 raise ValueError("_TERMINATION_NAMED_REGIONS must be set.") 73 74 all_frames = [current_frame] 75 if recent_frames is not None: 76 all_frames = recent_frames 77 78 for frame in all_frames: 79 self.state_parser: LegendOfZeldaLinksAwakeningParser 80 all_matched = True 81 82 for region_name in self._TERMINATION_NAMED_REGIONS: 83 matched = self.state_parser.named_region_matches_target( 84 frame, region_name 85 ) 86 if not matched: 87 all_matched = False 88 break 89 90 if all_matched: 91 return True 92 93 return False 94 95 96class ZeldaAnyRegionTerminationOnlyMetric(TerminationMetric): 97 REQUIRED_PARSER = LegendOfZeldaLinksAwakeningParser 98 _TERMINATION_NAMED_REGIONS = [] 99 100 def determine_terminated( 101 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 102 ) -> bool: 103 if len(self._TERMINATION_NAMED_REGIONS) == 0: 104 raise ValueError("_TERMINATION_NAMED_REGIONS must be set.") 105 106 all_frames = [current_frame] 107 if recent_frames is not None: 108 all_frames = recent_frames 109 110 for frame in all_frames: 111 self.state_parser: LegendOfZeldaLinksAwakeningParser 112 113 for region_name in self._TERMINATION_NAMED_REGIONS: 114 matched = self.state_parser.named_region_matches_target( 115 frame, region_name 116 ) 117 if matched: 118 return True 119 120 return False 121 122 123class ZeldaStateTerminationMetric(TerminationMetric): 124 REQUIRED_PARSER = LegendOfZeldaLinksAwakeningParser 125 _TERMINATION_AGENT_STATE = None 126 127 def determine_terminated( 128 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 129 ) -> bool: 130 if self._TERMINATION_AGENT_STATE is None: 131 raise ValueError("_TERMINATION_AGENT_STATE must be set.") 132 133 all_frames = [current_frame] 134 if recent_frames is not None: 135 all_frames = recent_frames 136 137 for frame in all_frames: 138 self.state_parser: LegendOfZeldaLinksAwakeningParser 139 state_matched = ( 140 self.state_parser.get_agent_state(frame) 141 == self._TERMINATION_AGENT_STATE 142 ) 143 if state_matched: 144 return True 145 return False 146 147class ToronboShorePickupSwordTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 148 _TERMINATION_NAMED_REGION = "equipped_action_2" 149 150class ShieldEquippedTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 151 _TERMINATION_NAMED_REGION = "shield_tracker" 152 153class OutsideTarinHouseTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 154 _TERMINATION_NAMED_REGION = "outside_tarinhouse_tracker" 155 156class OpenInventoryTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 157 _TERMINATION_NAMED_REGION = "health_bar_top" 158 159class NoWeaponTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 160 _TERMINATION_NAMED_REGION = "no_weapon" 161 162class YesWeaponTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 163 _TERMINATION_NAMED_REGION = "yes_weapon" 164 165class TalkToKidTerminateMetric(ZeldaRegionAndStateTerminationMetric): 166 _TERMINATION_NAMED_REGION = "kid_screen_tracker" 167 _TERMINATION_AGENT_STATE = "in_dialogue" 168 169class StatueTalkTerminateMetric(ZeldaRegionAndStateTerminationMetric): 170 _TERMINATION_NAMED_REGION = "girl" 171 _TERMINATION_AGENT_STATE = "in_dialogue" 172 173class ReadSignboardTerminateMetric(ZeldaRegionAndStateTerminationMetric): 174 _TERMINATION_NAMED_REGION = "signboard" 175 _TERMINATION_AGENT_STATE = "in_dialogue" 176 177class GoInsideShopTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 178 _TERMINATION_NAMED_REGION = "cash_counter_tracker" 179 180class MakeCallTerminateMetric(ZeldaMultiRegionTerminationOnlyMetric): 181 _TERMINATION_NAMED_REGIONS = [ 182 "telephone_tracker", 183 "telephone_speech_tracker", 184 ] 185 186class EnterDarkForestTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 187 _TERMINATION_NAMED_REGION = "brave_keyword_tracker" 188 189 190class InsideTunnelTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 191 _TERMINATION_NAMED_REGION = "gemstone" 192 193 194class OpenChestTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 195 _TERMINATION_NAMED_REGION = "open_chest_tracker" 196 197class HeartTakeTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 198 _TERMINATION_NAMED_REGION = "piece" 199 200class ShroomTakeTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 201 _TERMINATION_NAMED_REGION = "shroom_taker" 202 203class ShroomSwordTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 204 _TERMINATION_NAMED_REGION = "shroom_sword" 205 206class ShroomShieldTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 207 _TERMINATION_NAMED_REGION = "shroom_shield" 208 209class SignCheckerTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 210 _TERMINATION_NAMED_REGION = "signboard2" 211 212class WaterCheckerTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 213 _TERMINATION_NAMED_REGION = "empty_land" 214 215class MakeCall2TerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 216 _TERMINATION_NAMED_REGION = "bring_keyword_tracker" 217 218 219class SkeletonHouseTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 220 _TERMINATION_NAMED_REGION = "skeleton_tracker" 221 222 223class UndergroundTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 224 _TERMINATION_NAMED_REGION = "skeleton2_tracker" 225 226 227class DiamondKidTalkTerminateMetric(ZeldaRegionAndStateTerminationMetric): 228 _TERMINATION_NAMED_REGION = "diamond_tracker" 229 _TERMINATION_AGENT_STATE = "in_dialogue" 230 231 232class InsideHouseTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 233 _TERMINATION_NAMED_REGION = "stool" 234 235 236class PotRoomTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 237 _TERMINATION_NAMED_REGION = "char_onstairs" 238 239 240class PondTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 241 _TERMINATION_NAMED_REGION = "pond" 242 243 244class WeirdTunnelInsideTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 245 _TERMINATION_NAMED_REGION = "witch_tracker" 246 247 248class WitchTalkTerminateMetric(ZeldaRegionAndStateTerminationMetric): 249 _TERMINATION_NAMED_REGION = "pots_tracker" 250 _TERMINATION_AGENT_STATE = "in_dialogue" 251 252 253class PotholesSignboardReadTerminateMetric(ZeldaRegionAndStateTerminationMetric): 254 _TERMINATION_NAMED_REGION = "signboard_tracker" 255 _TERMINATION_AGENT_STATE = "in_dialogue" 256 257 258class PineappleScreenTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 259 _TERMINATION_NAMED_REGION = "pineapple" 260 261 262class CallBoothApproachTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 263 _TERMINATION_NAMED_REGION = "call_booth" 264 265 266class GrannyCornerTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 267 _TERMINATION_NAMED_REGION = "onewood" 268 269 270class LeaveBaldStoreCarpetTerminateMetric(ZeldaAnyRegionTerminationOnlyMetric): 271 _TERMINATION_NAMED_REGIONS = ["empty_carpet", "chimney"] 272 273 274class LeaveTrackTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 275 _TERMINATION_NAMED_REGION = "empty_track" 276 277 278class ExitFatHouseTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 279 _TERMINATION_NAMED_REGION = "wood" 280 281 282class BoothHouseUpTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 283 _TERMINATION_NAMED_REGION = "chunkgrass" 284 285 286class ChickHouseBlockTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 287 _TERMINATION_NAMED_REGION = "block" 288 289 290class PurplestoneStairsTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 291 _TERMINATION_NAMED_REGION = "purplestone" 292 293 294class HeavyStonePushTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 295 _TERMINATION_NAMED_REGION = "too_heavy" 296 297 298class BoyDialogueExitTerminateMetric(ZeldaStateTerminationMetric): 299 _TERMINATION_AGENT_STATE = "free_roam" 300 301 302class DirtPatchTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 303 _TERMINATION_NAMED_REGION = "dirt" 304 305 306class DirtPatchTwoTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 307 _TERMINATION_NAMED_REGION = "dirt2" 308 309 310class StonehouseRightTreeTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 311 _TERMINATION_NAMED_REGION = "twopurple" 312 313 314class SecondBoyDialogueExitTerminateMetric(ZeldaStateTerminationMetric): 315 _TERMINATION_AGENT_STATE = "free_roam" 316 317 318class RailingJumpTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 319 _TERMINATION_NAMED_REGION = "railing" 320 321 322class PalmtJumpTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 323 _TERMINATION_NAMED_REGION = "palmt" 324 325 326class MonsterDeathTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 327 _TERMINATION_NAMED_REGION = "gameover" 328 329 330class TileslongEscapeTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 331 _TERMINATION_NAMED_REGION = "treerighthouse" 332 333 334class BoardSignApproachTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 335 _TERMINATION_NAMED_REGION = "treestopr" 336 337#oracle 338class OracleRegionMatchTerminationOnlyMetric(ZeldaRegionMatchTerminationOnlyMetric): 339 REQUIRED_PARSER = LegendOfZeldaTheOracleOfSeasonsParser 340 341 342class OracleRegionAndStateTerminationMetric(ZeldaRegionAndStateTerminationMetric): 343 REQUIRED_PARSER = LegendOfZeldaTheOracleOfSeasonsParser 344 345 346class OracleMultiRegionTerminationOnlyMetric(ZeldaMultiRegionTerminationOnlyMetric): 347 REQUIRED_PARSER = LegendOfZeldaTheOracleOfSeasonsParser 348 349 350class OracleAnyRegionAndStateTerminationMetric(TerminationMetric): 351 REQUIRED_PARSER = LegendOfZeldaTheOracleOfSeasonsParser 352 _TERMINATION_NAMED_REGIONS = [] 353 _TERMINATION_AGENT_STATE = None 354 355 def determine_terminated( 356 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 357 ) -> bool: 358 if len(self._TERMINATION_NAMED_REGIONS) == 0: 359 raise ValueError("_TERMINATION_NAMED_REGIONS must be set.") 360 if self._TERMINATION_AGENT_STATE is None: 361 raise ValueError("_TERMINATION_AGENT_STATE must be set.") 362 363 all_frames = [current_frame] 364 if recent_frames is not None: 365 all_frames = recent_frames 366 367 for frame in all_frames: 368 self.state_parser: LegendOfZeldaTheOracleOfSeasonsParser 369 370 state_matched = ( 371 self.state_parser.get_agent_state(frame) 372 == self._TERMINATION_AGENT_STATE 373 ) 374 if not state_matched: 375 continue 376 377 for region_name in self._TERMINATION_NAMED_REGIONS: 378 if self.state_parser.named_region_matches_target(frame, region_name): 379 return True 380 381 return False 382 383 384class OracleOtherPeopleTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 385 _TERMINATION_NAMED_REGION = "beer_guy_tracker" 386 387 388class OracleGirlTalkTerminateMetric(OracleRegionAndStateTerminationMetric): 389 _TERMINATION_NAMED_REGION = "red_edges" 390 _TERMINATION_AGENT_STATE = "in_dialogue" 391 392 393class OracleJumpingTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 394 _TERMINATION_NAMED_REGION = "after_jump" 395 396 397class OracleFarmerTalkTerminateMetric(OracleRegionAndStateTerminationMetric): 398 _TERMINATION_NAMED_REGION = "flowers" 399 _TERMINATION_AGENT_STATE = "in_dialogue" 400 401 402class OracleLibraryTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 403 _TERMINATION_NAMED_REGION = "books" 404 405 406class OracleParrotTalkTerminateMetric(OracleAnyRegionAndStateTerminationMetric): 407 _TERMINATION_NAMED_REGIONS = ["books", "door"] 408 _TERMINATION_AGENT_STATE = "in_dialogue" 409 410 411class OracleFallTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 412 _TERMINATION_NAMED_REGION = "edge_character" 413 414 415class OracleStairsTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 416 _TERMINATION_NAMED_REGION = "char_onstairs" 417 418 419class OracleSignboardReadTerminateMetric(OracleRegionAndStateTerminationMetric): 420 _TERMINATION_NAMED_REGION = "bush" 421 _TERMINATION_AGENT_STATE = "in_dialogue" 422 423 424class OracleShopInsideTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 425 _TERMINATION_NAMED_REGION = "clocks" 426 427 428class OracleShopPersonTalkTerminateMetric(OracleRegionAndStateTerminationMetric): 429 _TERMINATION_NAMED_REGION = "clocks" 430 _TERMINATION_AGENT_STATE = "in_dialogue" 431 432 433class OracleGirlHouseTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 434 _TERMINATION_NAMED_REGION = "fireplace" 435 436 437class OraclePotInteractionTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 438 _TERMINATION_NAMED_REGION = "oof_its_heavy" 439 440 441class OracleInsideTunnelTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 442 _TERMINATION_NAMED_REGION = "green_rock_tracker" 443 444 445class OracleArtistTalkTerminateMetric(OracleRegionAndStateTerminationMetric): 446 _TERMINATION_NAMED_REGION = "rock" 447 _TERMINATION_AGENT_STATE = "in_dialogue" 448 449 450class OracleChickenHouseTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 451 _TERMINATION_NAMED_REGION = "almirah" 452 453 454class OracleJigglyPathWalkTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 455 _TERMINATION_NAMED_REGION = "signboard_entry" 456 457 458class OracleFairyMeetTerminateMetric(OracleRegionAndStateTerminationMetric): 459 _TERMINATION_NAMED_REGION = "grass_right" 460 _TERMINATION_AGENT_STATE = "in_dialogue" 461 462 463class OracleThingInteractionTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 464 _TERMINATION_NAMED_REGION = "open_gate" 465 466 467class OracleInventoryOpenTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 468 _TERMINATION_NAMED_REGION = "bricks" 469 470 471class OracleClockTowerSignReadTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 472 _TERMINATION_NAMED_REGION = "sign_dialogue" 473 474 475class OracleNearStairsTerminateMetric(OracleMultiRegionTerminationOnlyMetric): 476 _TERMINATION_NAMED_REGIONS = ["left_screen", "right_screent", "right_screenb"] 477 478 479class OracleTalkToGirlTerminateMetric(OracleRegionAndStateTerminationMetric): 480 _TERMINATION_NAMED_REGION = "stool" 481 _TERMINATION_AGENT_STATE = "in_dialogue" 482 483 484class OraclePierGoTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 485 _TERMINATION_NAMED_REGION = "bush_of_pier" 486 487 488class OracleBoardwalkTerminateMetric(OracleRegionAndStateTerminationMetric): 489 _TERMINATION_NAMED_REGION = "empty_walk" 490 _TERMINATION_AGENT_STATE = "in_dialogue" 491 492 493class OracleCatCheckTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 494 _TERMINATION_NAMED_REGION = "cat" 495 496 497class OracleCatTalkTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 498 _TERMINATION_NAMED_REGION = "meow" 499 500 501class OracleOwnerTalkTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 502 _TERMINATION_NAMED_REGION = "look_no_matter" 503 504 505class OracleBridgeWalkTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 506 _TERMINATION_NAMED_REGION = "chest" 507 508 509class OracleDogTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 510 _TERMINATION_NAMED_REGION = "dog" 511 512 513class OracleMickeyLeftTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 514 _TERMINATION_NAMED_REGION = "mickey" 515 516 517class OracleStepOffGrassBlockTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 518 _TERMINATION_NAMED_REGION = "empty_block" 519 520 521class OracleShopSignPathTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 522 _TERMINATION_NAMED_REGION = "shopsign" 523 524 525class OracleClocksUpTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 526 _TERMINATION_NAMED_REGION = "mickeynoddy" 527 528 529class OracleJoystickRightTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 530 _TERMINATION_NAMED_REGION = "joystick" 531 532 533class OracleJoystickHouseEntryTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 534 _TERMINATION_NAMED_REGION = "redbook" 535 536 537class OracleApproachRedSnakeTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 538 _TERMINATION_NAMED_REGION = "redsnake" 539 540 541class OracleApproachBlueSnakeTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 542 _TERMINATION_NAMED_REGION = "bluesnake" 543 544 545class OracleRedSnakeTalkTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 546 _TERMINATION_NAMED_REGION = "redsnaketalk" 547 548 549class OracleBlueSnakeTalkTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 550 _TERMINATION_NAMED_REGION = "bluesnaketalk" 551 552 553class OracleBlueBookReadTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 554 _TERMINATION_NAMED_REGION = "bluetext" 555 556 557class OracleRedBookReadTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 558 _TERMINATION_NAMED_REGION = "redtext" 559 560 561class OracleLavaFloorTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 562 _TERMINATION_NAMED_REGION = "guyonlava" 563 564 565class OracleStepOffTrackTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 566 _TERMINATION_NAMED_REGION = "mickeynoddy" 567 568 569class OracleGloomyPlaceLeftTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 570 _TERMINATION_NAMED_REGION = "boundaryred" 571 572 573class OracleGameoverDeathTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 574 _TERMINATION_NAMED_REGION = "gameover" 575 576 577class OracleLeaveGreenCarpetTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 578 _TERMINATION_NAMED_REGION = "greencarpet" 579 580 581class OracleHolesToTrunkTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 582 _TERMINATION_NAMED_REGION = "alleytunnel" 583 584 585class OracleTrunkToHolesTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 586 _TERMINATION_NAMED_REGION = "emptybeforehole" 587 588 589class OracleLeftOfTrunkTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 590 _TERMINATION_NAMED_REGION = "4cy"
12class ZeldaRegionMatchTerminationOnlyMetric(TerminationMetric): 13 REQUIRED_PARSER = LegendOfZeldaLinksAwakeningParser 14 _TERMINATION_NAMED_REGION = None 15 16 def determine_terminated( 17 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 18 ) -> bool: 19 if self._TERMINATION_NAMED_REGION is None: 20 raise ValueError("_TERMINATION_NAMED_REGION must be set.") 21 22 all_frames = [current_frame] 23 if recent_frames is not None: 24 all_frames = recent_frames 25 26 for frame in all_frames: 27 self.state_parser: LegendOfZeldaLinksAwakeningParser 28 matched = self.state_parser.named_region_matches_target( 29 frame, self._TERMINATION_NAMED_REGION 30 ) 31 if matched: 32 return True 33 return False
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
The StateParser which implements the minimum required functionality for this MetricGroup to work.
16 def determine_terminated( 17 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 18 ) -> bool: 19 if self._TERMINATION_NAMED_REGION is None: 20 raise ValueError("_TERMINATION_NAMED_REGION must be set.") 21 22 all_frames = [current_frame] 23 if recent_frames is not None: 24 all_frames = recent_frames 25 26 for frame in all_frames: 27 self.state_parser: LegendOfZeldaLinksAwakeningParser 28 matched = self.state_parser.named_region_matches_target( 29 frame, self._TERMINATION_NAMED_REGION 30 ) 31 if matched: 32 return True 33 return False
Determines whether the environment was terminated.
Parameters
- current_frame: The current frame rendered by the emulator.
- recent_frames: The stack of frames that were rendered during the last action. Shape is [n_frames, height, width, channels]. Can be None if rendering is disabled.
Returns
True if the environment was terminated, False otherwise.
Inherited Members
35class ZeldaRegionAndStateTerminationMetric(TerminationMetric): 36 REQUIRED_PARSER = LegendOfZeldaLinksAwakeningParser 37 _TERMINATION_NAMED_REGION = None 38 _TERMINATION_AGENT_STATE = None 39 40 def determine_terminated( 41 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 42 ) -> bool: 43 if self._TERMINATION_NAMED_REGION is None: 44 raise ValueError("_TERMINATION_NAMED_REGION must be set.") 45 if self._TERMINATION_AGENT_STATE is None: 46 raise ValueError("_TERMINATION_AGENT_STATE must be set.") 47 48 all_frames = [current_frame] 49 if recent_frames is not None: 50 all_frames = recent_frames 51 52 for frame in all_frames: 53 self.state_parser: LegendOfZeldaLinksAwakeningParser 54 region_matched = self.state_parser.named_region_matches_target( 55 frame, self._TERMINATION_NAMED_REGION 56 ) 57 state_matched = ( 58 self.state_parser.get_agent_state(frame) 59 == self._TERMINATION_AGENT_STATE 60 ) 61 if region_matched and state_matched: 62 return True 63 return False
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
The StateParser which implements the minimum required functionality for this MetricGroup to work.
40 def determine_terminated( 41 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 42 ) -> bool: 43 if self._TERMINATION_NAMED_REGION is None: 44 raise ValueError("_TERMINATION_NAMED_REGION must be set.") 45 if self._TERMINATION_AGENT_STATE is None: 46 raise ValueError("_TERMINATION_AGENT_STATE must be set.") 47 48 all_frames = [current_frame] 49 if recent_frames is not None: 50 all_frames = recent_frames 51 52 for frame in all_frames: 53 self.state_parser: LegendOfZeldaLinksAwakeningParser 54 region_matched = self.state_parser.named_region_matches_target( 55 frame, self._TERMINATION_NAMED_REGION 56 ) 57 state_matched = ( 58 self.state_parser.get_agent_state(frame) 59 == self._TERMINATION_AGENT_STATE 60 ) 61 if region_matched and state_matched: 62 return True 63 return False
Determines whether the environment was terminated.
Parameters
- current_frame: The current frame rendered by the emulator.
- recent_frames: The stack of frames that were rendered during the last action. Shape is [n_frames, height, width, channels]. Can be None if rendering is disabled.
Returns
True if the environment was terminated, False otherwise.
Inherited Members
65class ZeldaMultiRegionTerminationOnlyMetric(TerminationMetric): 66 REQUIRED_PARSER = LegendOfZeldaLinksAwakeningParser 67 _TERMINATION_NAMED_REGIONS = [] 68 69 def determine_terminated( 70 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 71 ) -> bool: 72 if len(self._TERMINATION_NAMED_REGIONS) == 0: 73 raise ValueError("_TERMINATION_NAMED_REGIONS must be set.") 74 75 all_frames = [current_frame] 76 if recent_frames is not None: 77 all_frames = recent_frames 78 79 for frame in all_frames: 80 self.state_parser: LegendOfZeldaLinksAwakeningParser 81 all_matched = True 82 83 for region_name in self._TERMINATION_NAMED_REGIONS: 84 matched = self.state_parser.named_region_matches_target( 85 frame, region_name 86 ) 87 if not matched: 88 all_matched = False 89 break 90 91 if all_matched: 92 return True 93 94 return False
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
The StateParser which implements the minimum required functionality for this MetricGroup to work.
69 def determine_terminated( 70 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 71 ) -> bool: 72 if len(self._TERMINATION_NAMED_REGIONS) == 0: 73 raise ValueError("_TERMINATION_NAMED_REGIONS must be set.") 74 75 all_frames = [current_frame] 76 if recent_frames is not None: 77 all_frames = recent_frames 78 79 for frame in all_frames: 80 self.state_parser: LegendOfZeldaLinksAwakeningParser 81 all_matched = True 82 83 for region_name in self._TERMINATION_NAMED_REGIONS: 84 matched = self.state_parser.named_region_matches_target( 85 frame, region_name 86 ) 87 if not matched: 88 all_matched = False 89 break 90 91 if all_matched: 92 return True 93 94 return False
Determines whether the environment was terminated.
Parameters
- current_frame: The current frame rendered by the emulator.
- recent_frames: The stack of frames that were rendered during the last action. Shape is [n_frames, height, width, channels]. Can be None if rendering is disabled.
Returns
True if the environment was terminated, False otherwise.
Inherited Members
97class ZeldaAnyRegionTerminationOnlyMetric(TerminationMetric): 98 REQUIRED_PARSER = LegendOfZeldaLinksAwakeningParser 99 _TERMINATION_NAMED_REGIONS = [] 100 101 def determine_terminated( 102 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 103 ) -> bool: 104 if len(self._TERMINATION_NAMED_REGIONS) == 0: 105 raise ValueError("_TERMINATION_NAMED_REGIONS must be set.") 106 107 all_frames = [current_frame] 108 if recent_frames is not None: 109 all_frames = recent_frames 110 111 for frame in all_frames: 112 self.state_parser: LegendOfZeldaLinksAwakeningParser 113 114 for region_name in self._TERMINATION_NAMED_REGIONS: 115 matched = self.state_parser.named_region_matches_target( 116 frame, region_name 117 ) 118 if matched: 119 return True 120 121 return False
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
The StateParser which implements the minimum required functionality for this MetricGroup to work.
101 def determine_terminated( 102 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 103 ) -> bool: 104 if len(self._TERMINATION_NAMED_REGIONS) == 0: 105 raise ValueError("_TERMINATION_NAMED_REGIONS must be set.") 106 107 all_frames = [current_frame] 108 if recent_frames is not None: 109 all_frames = recent_frames 110 111 for frame in all_frames: 112 self.state_parser: LegendOfZeldaLinksAwakeningParser 113 114 for region_name in self._TERMINATION_NAMED_REGIONS: 115 matched = self.state_parser.named_region_matches_target( 116 frame, region_name 117 ) 118 if matched: 119 return True 120 121 return False
Determines whether the environment was terminated.
Parameters
- current_frame: The current frame rendered by the emulator.
- recent_frames: The stack of frames that were rendered during the last action. Shape is [n_frames, height, width, channels]. Can be None if rendering is disabled.
Returns
True if the environment was terminated, False otherwise.
Inherited Members
124class ZeldaStateTerminationMetric(TerminationMetric): 125 REQUIRED_PARSER = LegendOfZeldaLinksAwakeningParser 126 _TERMINATION_AGENT_STATE = None 127 128 def determine_terminated( 129 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 130 ) -> bool: 131 if self._TERMINATION_AGENT_STATE is None: 132 raise ValueError("_TERMINATION_AGENT_STATE must be set.") 133 134 all_frames = [current_frame] 135 if recent_frames is not None: 136 all_frames = recent_frames 137 138 for frame in all_frames: 139 self.state_parser: LegendOfZeldaLinksAwakeningParser 140 state_matched = ( 141 self.state_parser.get_agent_state(frame) 142 == self._TERMINATION_AGENT_STATE 143 ) 144 if state_matched: 145 return True 146 return False
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
The StateParser which implements the minimum required functionality for this MetricGroup to work.
128 def determine_terminated( 129 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 130 ) -> bool: 131 if self._TERMINATION_AGENT_STATE is None: 132 raise ValueError("_TERMINATION_AGENT_STATE must be set.") 133 134 all_frames = [current_frame] 135 if recent_frames is not None: 136 all_frames = recent_frames 137 138 for frame in all_frames: 139 self.state_parser: LegendOfZeldaLinksAwakeningParser 140 state_matched = ( 141 self.state_parser.get_agent_state(frame) 142 == self._TERMINATION_AGENT_STATE 143 ) 144 if state_matched: 145 return True 146 return False
Determines whether the environment was terminated.
Parameters
- current_frame: The current frame rendered by the emulator.
- recent_frames: The stack of frames that were rendered during the last action. Shape is [n_frames, height, width, channels]. Can be None if rendering is disabled.
Returns
True if the environment was terminated, False otherwise.
Inherited Members
148class ToronboShorePickupSwordTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 149 _TERMINATION_NAMED_REGION = "equipped_action_2"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
151class ShieldEquippedTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 152 _TERMINATION_NAMED_REGION = "shield_tracker"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
154class OutsideTarinHouseTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 155 _TERMINATION_NAMED_REGION = "outside_tarinhouse_tracker"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
157class OpenInventoryTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 158 _TERMINATION_NAMED_REGION = "health_bar_top"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
160class NoWeaponTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 161 _TERMINATION_NAMED_REGION = "no_weapon"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
163class YesWeaponTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 164 _TERMINATION_NAMED_REGION = "yes_weapon"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
166class TalkToKidTerminateMetric(ZeldaRegionAndStateTerminationMetric): 167 _TERMINATION_NAMED_REGION = "kid_screen_tracker" 168 _TERMINATION_AGENT_STATE = "in_dialogue"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
170class StatueTalkTerminateMetric(ZeldaRegionAndStateTerminationMetric): 171 _TERMINATION_NAMED_REGION = "girl" 172 _TERMINATION_AGENT_STATE = "in_dialogue"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
174class ReadSignboardTerminateMetric(ZeldaRegionAndStateTerminationMetric): 175 _TERMINATION_NAMED_REGION = "signboard" 176 _TERMINATION_AGENT_STATE = "in_dialogue"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
178class GoInsideShopTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 179 _TERMINATION_NAMED_REGION = "cash_counter_tracker"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
181class MakeCallTerminateMetric(ZeldaMultiRegionTerminationOnlyMetric): 182 _TERMINATION_NAMED_REGIONS = [ 183 "telephone_tracker", 184 "telephone_speech_tracker", 185 ]
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
187class EnterDarkForestTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 188 _TERMINATION_NAMED_REGION = "brave_keyword_tracker"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
191class InsideTunnelTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 192 _TERMINATION_NAMED_REGION = "gemstone"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
195class OpenChestTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 196 _TERMINATION_NAMED_REGION = "open_chest_tracker"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
198class HeartTakeTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 199 _TERMINATION_NAMED_REGION = "piece"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
201class ShroomTakeTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 202 _TERMINATION_NAMED_REGION = "shroom_taker"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
204class ShroomSwordTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 205 _TERMINATION_NAMED_REGION = "shroom_sword"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
207class ShroomShieldTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 208 _TERMINATION_NAMED_REGION = "shroom_shield"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
210class SignCheckerTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 211 _TERMINATION_NAMED_REGION = "signboard2"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
213class WaterCheckerTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 214 _TERMINATION_NAMED_REGION = "empty_land"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
216class MakeCall2TerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 217 _TERMINATION_NAMED_REGION = "bring_keyword_tracker"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
220class SkeletonHouseTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 221 _TERMINATION_NAMED_REGION = "skeleton_tracker"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
224class UndergroundTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 225 _TERMINATION_NAMED_REGION = "skeleton2_tracker"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
228class DiamondKidTalkTerminateMetric(ZeldaRegionAndStateTerminationMetric): 229 _TERMINATION_NAMED_REGION = "diamond_tracker" 230 _TERMINATION_AGENT_STATE = "in_dialogue"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
233class InsideHouseTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 234 _TERMINATION_NAMED_REGION = "stool"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
237class PotRoomTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 238 _TERMINATION_NAMED_REGION = "char_onstairs"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
241class PondTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 242 _TERMINATION_NAMED_REGION = "pond"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
245class WeirdTunnelInsideTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 246 _TERMINATION_NAMED_REGION = "witch_tracker"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
249class WitchTalkTerminateMetric(ZeldaRegionAndStateTerminationMetric): 250 _TERMINATION_NAMED_REGION = "pots_tracker" 251 _TERMINATION_AGENT_STATE = "in_dialogue"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
254class PotholesSignboardReadTerminateMetric(ZeldaRegionAndStateTerminationMetric): 255 _TERMINATION_NAMED_REGION = "signboard_tracker" 256 _TERMINATION_AGENT_STATE = "in_dialogue"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
259class PineappleScreenTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 260 _TERMINATION_NAMED_REGION = "pineapple"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
263class CallBoothApproachTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 264 _TERMINATION_NAMED_REGION = "call_booth"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
267class GrannyCornerTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 268 _TERMINATION_NAMED_REGION = "onewood"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
271class LeaveBaldStoreCarpetTerminateMetric(ZeldaAnyRegionTerminationOnlyMetric): 272 _TERMINATION_NAMED_REGIONS = ["empty_carpet", "chimney"]
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
275class LeaveTrackTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 276 _TERMINATION_NAMED_REGION = "empty_track"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
279class ExitFatHouseTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 280 _TERMINATION_NAMED_REGION = "wood"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
283class BoothHouseUpTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 284 _TERMINATION_NAMED_REGION = "chunkgrass"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
287class ChickHouseBlockTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 288 _TERMINATION_NAMED_REGION = "block"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
291class PurplestoneStairsTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 292 _TERMINATION_NAMED_REGION = "purplestone"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
295class HeavyStonePushTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 296 _TERMINATION_NAMED_REGION = "too_heavy"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
299class BoyDialogueExitTerminateMetric(ZeldaStateTerminationMetric): 300 _TERMINATION_AGENT_STATE = "free_roam"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
303class DirtPatchTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 304 _TERMINATION_NAMED_REGION = "dirt"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
307class DirtPatchTwoTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 308 _TERMINATION_NAMED_REGION = "dirt2"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
311class StonehouseRightTreeTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 312 _TERMINATION_NAMED_REGION = "twopurple"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
315class SecondBoyDialogueExitTerminateMetric(ZeldaStateTerminationMetric): 316 _TERMINATION_AGENT_STATE = "free_roam"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
319class RailingJumpTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 320 _TERMINATION_NAMED_REGION = "railing"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
323class PalmtJumpTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 324 _TERMINATION_NAMED_REGION = "palmt"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
327class MonsterDeathTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 328 _TERMINATION_NAMED_REGION = "gameover"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
331class TileslongEscapeTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 332 _TERMINATION_NAMED_REGION = "treerighthouse"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
335class BoardSignApproachTerminateMetric(ZeldaRegionMatchTerminationOnlyMetric): 336 _TERMINATION_NAMED_REGION = "treestopr"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
339class OracleRegionMatchTerminationOnlyMetric(ZeldaRegionMatchTerminationOnlyMetric): 340 REQUIRED_PARSER = LegendOfZeldaTheOracleOfSeasonsParser
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
The StateParser which implements the minimum required functionality for this MetricGroup to work.
Inherited Members
343class OracleRegionAndStateTerminationMetric(ZeldaRegionAndStateTerminationMetric): 344 REQUIRED_PARSER = LegendOfZeldaTheOracleOfSeasonsParser
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
The StateParser which implements the minimum required functionality for this MetricGroup to work.
Inherited Members
347class OracleMultiRegionTerminationOnlyMetric(ZeldaMultiRegionTerminationOnlyMetric): 348 REQUIRED_PARSER = LegendOfZeldaTheOracleOfSeasonsParser
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
The StateParser which implements the minimum required functionality for this MetricGroup to work.
Inherited Members
351class OracleAnyRegionAndStateTerminationMetric(TerminationMetric): 352 REQUIRED_PARSER = LegendOfZeldaTheOracleOfSeasonsParser 353 _TERMINATION_NAMED_REGIONS = [] 354 _TERMINATION_AGENT_STATE = None 355 356 def determine_terminated( 357 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 358 ) -> bool: 359 if len(self._TERMINATION_NAMED_REGIONS) == 0: 360 raise ValueError("_TERMINATION_NAMED_REGIONS must be set.") 361 if self._TERMINATION_AGENT_STATE is None: 362 raise ValueError("_TERMINATION_AGENT_STATE must be set.") 363 364 all_frames = [current_frame] 365 if recent_frames is not None: 366 all_frames = recent_frames 367 368 for frame in all_frames: 369 self.state_parser: LegendOfZeldaTheOracleOfSeasonsParser 370 371 state_matched = ( 372 self.state_parser.get_agent_state(frame) 373 == self._TERMINATION_AGENT_STATE 374 ) 375 if not state_matched: 376 continue 377 378 for region_name in self._TERMINATION_NAMED_REGIONS: 379 if self.state_parser.named_region_matches_target(frame, region_name): 380 return True 381 382 return False
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
The StateParser which implements the minimum required functionality for this MetricGroup to work.
356 def determine_terminated( 357 self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray] 358 ) -> bool: 359 if len(self._TERMINATION_NAMED_REGIONS) == 0: 360 raise ValueError("_TERMINATION_NAMED_REGIONS must be set.") 361 if self._TERMINATION_AGENT_STATE is None: 362 raise ValueError("_TERMINATION_AGENT_STATE must be set.") 363 364 all_frames = [current_frame] 365 if recent_frames is not None: 366 all_frames = recent_frames 367 368 for frame in all_frames: 369 self.state_parser: LegendOfZeldaTheOracleOfSeasonsParser 370 371 state_matched = ( 372 self.state_parser.get_agent_state(frame) 373 == self._TERMINATION_AGENT_STATE 374 ) 375 if not state_matched: 376 continue 377 378 for region_name in self._TERMINATION_NAMED_REGIONS: 379 if self.state_parser.named_region_matches_target(frame, region_name): 380 return True 381 382 return False
Determines whether the environment was terminated.
Parameters
- current_frame: The current frame rendered by the emulator.
- recent_frames: The stack of frames that were rendered during the last action. Shape is [n_frames, height, width, channels]. Can be None if rendering is disabled.
Returns
True if the environment was terminated, False otherwise.
Inherited Members
385class OracleOtherPeopleTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 386 _TERMINATION_NAMED_REGION = "beer_guy_tracker"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
389class OracleGirlTalkTerminateMetric(OracleRegionAndStateTerminationMetric): 390 _TERMINATION_NAMED_REGION = "red_edges" 391 _TERMINATION_AGENT_STATE = "in_dialogue"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
394class OracleJumpingTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 395 _TERMINATION_NAMED_REGION = "after_jump"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
398class OracleFarmerTalkTerminateMetric(OracleRegionAndStateTerminationMetric): 399 _TERMINATION_NAMED_REGION = "flowers" 400 _TERMINATION_AGENT_STATE = "in_dialogue"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
403class OracleLibraryTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 404 _TERMINATION_NAMED_REGION = "books"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
407class OracleParrotTalkTerminateMetric(OracleAnyRegionAndStateTerminationMetric): 408 _TERMINATION_NAMED_REGIONS = ["books", "door"] 409 _TERMINATION_AGENT_STATE = "in_dialogue"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
412class OracleFallTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 413 _TERMINATION_NAMED_REGION = "edge_character"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
416class OracleStairsTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 417 _TERMINATION_NAMED_REGION = "char_onstairs"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
420class OracleSignboardReadTerminateMetric(OracleRegionAndStateTerminationMetric): 421 _TERMINATION_NAMED_REGION = "bush" 422 _TERMINATION_AGENT_STATE = "in_dialogue"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
425class OracleShopInsideTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 426 _TERMINATION_NAMED_REGION = "clocks"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
429class OracleShopPersonTalkTerminateMetric(OracleRegionAndStateTerminationMetric): 430 _TERMINATION_NAMED_REGION = "clocks" 431 _TERMINATION_AGENT_STATE = "in_dialogue"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
434class OracleGirlHouseTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 435 _TERMINATION_NAMED_REGION = "fireplace"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
438class OraclePotInteractionTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 439 _TERMINATION_NAMED_REGION = "oof_its_heavy"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
442class OracleInsideTunnelTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 443 _TERMINATION_NAMED_REGION = "green_rock_tracker"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
446class OracleArtistTalkTerminateMetric(OracleRegionAndStateTerminationMetric): 447 _TERMINATION_NAMED_REGION = "rock" 448 _TERMINATION_AGENT_STATE = "in_dialogue"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
451class OracleChickenHouseTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 452 _TERMINATION_NAMED_REGION = "almirah"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
455class OracleJigglyPathWalkTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 456 _TERMINATION_NAMED_REGION = "signboard_entry"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
459class OracleFairyMeetTerminateMetric(OracleRegionAndStateTerminationMetric): 460 _TERMINATION_NAMED_REGION = "grass_right" 461 _TERMINATION_AGENT_STATE = "in_dialogue"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
464class OracleThingInteractionTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 465 _TERMINATION_NAMED_REGION = "open_gate"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
468class OracleInventoryOpenTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 469 _TERMINATION_NAMED_REGION = "bricks"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
472class OracleClockTowerSignReadTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 473 _TERMINATION_NAMED_REGION = "sign_dialogue"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
476class OracleNearStairsTerminateMetric(OracleMultiRegionTerminationOnlyMetric): 477 _TERMINATION_NAMED_REGIONS = ["left_screen", "right_screent", "right_screenb"]
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
480class OracleTalkToGirlTerminateMetric(OracleRegionAndStateTerminationMetric): 481 _TERMINATION_NAMED_REGION = "stool" 482 _TERMINATION_AGENT_STATE = "in_dialogue"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
485class OraclePierGoTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 486 _TERMINATION_NAMED_REGION = "bush_of_pier"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
489class OracleBoardwalkTerminateMetric(OracleRegionAndStateTerminationMetric): 490 _TERMINATION_NAMED_REGION = "empty_walk" 491 _TERMINATION_AGENT_STATE = "in_dialogue"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
494class OracleCatCheckTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 495 _TERMINATION_NAMED_REGION = "cat"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
498class OracleCatTalkTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 499 _TERMINATION_NAMED_REGION = "meow"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
502class OracleOwnerTalkTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 503 _TERMINATION_NAMED_REGION = "look_no_matter"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
506class OracleBridgeWalkTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 507 _TERMINATION_NAMED_REGION = "chest"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
510class OracleDogTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 511 _TERMINATION_NAMED_REGION = "dog"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
514class OracleMickeyLeftTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 515 _TERMINATION_NAMED_REGION = "mickey"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
518class OracleStepOffGrassBlockTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 519 _TERMINATION_NAMED_REGION = "empty_block"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
522class OracleShopSignPathTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 523 _TERMINATION_NAMED_REGION = "shopsign"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
526class OracleClocksUpTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 527 _TERMINATION_NAMED_REGION = "mickeynoddy"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
530class OracleJoystickRightTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 531 _TERMINATION_NAMED_REGION = "joystick"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
534class OracleJoystickHouseEntryTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 535 _TERMINATION_NAMED_REGION = "redbook"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
538class OracleApproachRedSnakeTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 539 _TERMINATION_NAMED_REGION = "redsnake"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
542class OracleApproachBlueSnakeTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 543 _TERMINATION_NAMED_REGION = "bluesnake"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
546class OracleRedSnakeTalkTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 547 _TERMINATION_NAMED_REGION = "redsnaketalk"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
550class OracleBlueSnakeTalkTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 551 _TERMINATION_NAMED_REGION = "bluesnaketalk"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
554class OracleBlueBookReadTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 555 _TERMINATION_NAMED_REGION = "bluetext"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
558class OracleRedBookReadTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 559 _TERMINATION_NAMED_REGION = "redtext"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
562class OracleLavaFloorTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 563 _TERMINATION_NAMED_REGION = "guyonlava"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
566class OracleStepOffTrackTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 567 _TERMINATION_NAMED_REGION = "mickeynoddy"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
570class OracleGloomyPlaceLeftTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 571 _TERMINATION_NAMED_REGION = "boundaryred"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
574class OracleGameoverDeathTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 575 _TERMINATION_NAMED_REGION = "gameover"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
578class OracleLeaveGreenCarpetTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 579 _TERMINATION_NAMED_REGION = "greencarpet"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
582class OracleHolesToTrunkTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 583 _TERMINATION_NAMED_REGION = "alleytunnel"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
586class OracleTrunkToHolesTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 587 _TERMINATION_NAMED_REGION = "emptybeforehole"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).
Inherited Members
590class OracleLeftOfTrunkTerminateMetric(OracleRegionMatchTerminationOnlyMetric): 591 _TERMINATION_NAMED_REGION = "4cy"
Tracks whether the environment was terminated or truncated.
Reports:
terminated: Whether the environment was terminated.truncated: Whether the environment was truncated.
Final Reports:
episode_end_reason: List of reasons for episode endings: "terminated", "truncated", or None (None will occur only if there is a bug that leads to a premature reset).