def get_automaton(self): automaton = SubgoalAutomaton() automaton.add_state("u0") automaton.add_state("u1") automaton.add_state("u_acc") automaton.add_edge( "u0", "u1", [OfficeWorldObject.COFFEE, "~" + OfficeWorldObject.OFFICE]) automaton.add_edge( "u0", "u_acc", [OfficeWorldObject.COFFEE, OfficeWorldObject.OFFICE]) automaton.add_edge( "u1", "u_acc", [OfficeWorldObject.OFFICE, "~" + OfficeWorldObject.PLANT]) if self.drop_coffee_on_plant_enable: automaton.add_edge("u1", "u0", [OfficeWorldObject.PLANT]) else: automaton.add_state("u_rej") automaton.set_reject_state("u_rej") automaton.add_edge("u0", "u_rej", [ OfficeWorldObject.PLANT, "~" + OfficeWorldObject.COFFEE, "~" + OfficeWorldObject.OFFICE ]) automaton.add_edge("u1", "u_rej", [OfficeWorldObject.PLANT]) automaton.set_initial_state("u0") automaton.set_accept_state("u_acc") return automaton
def get_automaton(self): automaton = SubgoalAutomaton() automaton.add_state("u0") automaton.add_state("u1") automaton.add_state("u2") automaton.add_state("u3") automaton.add_state("u_acc") automaton.add_state("u_rej") automaton.add_edge( "u0", "u1", [OfficeWorldObject.ROOM_A, "~" + OfficeWorldObject.PLANT]) automaton.add_edge("u0", "u_rej", [OfficeWorldObject.PLANT]) automaton.add_edge( "u1", "u2", [OfficeWorldObject.ROOM_B, "~" + OfficeWorldObject.PLANT]) automaton.add_edge("u1", "u_rej", [OfficeWorldObject.PLANT]) automaton.add_edge( "u2", "u3", [OfficeWorldObject.ROOM_C, "~" + OfficeWorldObject.PLANT]) automaton.add_edge("u2", "u_rej", [OfficeWorldObject.PLANT]) automaton.add_edge( "u3", "u_acc", [OfficeWorldObject.ROOM_D, "~" + OfficeWorldObject.PLANT]) automaton.add_edge("u3", "u_rej", [OfficeWorldObject.PLANT]) automaton.set_initial_state("u0") automaton.set_accept_state("u_acc") automaton.set_reject_state("u_rej") return automaton
def _set_basic_automata(self): self.automata = [] for _ in range(self.num_domains): # the initial automaton is an automaton that doesn't accept nor reject anything automaton = SubgoalAutomaton() automaton.add_state(ISAAlgorithmBase.INITIAL_STATE_NAME) automaton.set_initial_state(ISAAlgorithmBase.INITIAL_STATE_NAME) # automaton.add_state(ISAAlgorithm.ACCEPTING_STATE_NAME) # DO NOT UNCOMMENT! # automaton.add_state(ISAAlgorithm.REJECTING_STATE_NAME) # automaton.set_accept_state(ISAAlgorithm.ACCEPTING_STATE_NAME) # automaton.set_reject_state(ISAAlgorithm.REJECTING_STATE_NAME) self.automata.append(automaton)
def get_automaton(self): automaton = SubgoalAutomaton() automaton.set_initial_state("u0") automaton.set_accept_state("u_acc") if self._is_strict_sequence(): self._add_strict_transitions_to_automaton(automaton) automaton.set_reject_state("u_rej") else: if self.obs_to_avoid is not None: automaton.set_reject_state("u_rej") self._add_transitions_to_automaton(automaton) return automaton
def get_automaton(self): automaton = SubgoalAutomaton() automaton.add_state("u0") automaton.add_state("u1") automaton.add_state("u2") automaton.add_state("u3") automaton.add_state("u_acc") if self.enforce_single_observable_per_location: automaton.add_edge( "u0", "u2", [CraftWorldObject.WOOD, "~" + CraftWorldObject.IRON]) automaton.add_edge("u0", "u3", [CraftWorldObject.IRON]) automaton.add_edge("u2", "u1", [CraftWorldObject.IRON]) automaton.add_edge("u3", "u1", [CraftWorldObject.WOOD]) else: automaton.add_edge("u0", "u1", [ CraftWorldObject.WOOD, "~" + CraftWorldObject.WORKBENCH, CraftWorldObject.IRON ]) automaton.add_edge( "u0", "u2", [CraftWorldObject.WOOD, "~" + CraftWorldObject.IRON]) automaton.add_edge( "u0", "u3", ["~" + CraftWorldObject.WOOD, CraftWorldObject.IRON]) automaton.add_edge("u0", "u_acc", [ CraftWorldObject.WOOD, CraftWorldObject.WORKBENCH, CraftWorldObject.IRON ]) automaton.add_edge( "u2", "u1", ["~" + CraftWorldObject.WORKBENCH, CraftWorldObject.IRON]) automaton.add_edge( "u2", "u_acc", [CraftWorldObject.WORKBENCH, CraftWorldObject.IRON]) automaton.add_edge( "u3", "u1", [CraftWorldObject.WOOD, "~" + CraftWorldObject.WORKBENCH]) automaton.add_edge( "u3", "u_acc", [CraftWorldObject.WOOD, CraftWorldObject.WORKBENCH]) automaton.add_edge("u1", "u_acc", [CraftWorldObject.WORKBENCH]) automaton.set_initial_state("u0") automaton.set_accept_state("u_acc") return automaton
def get_automaton(self): automaton = SubgoalAutomaton() automaton.add_state("u0") automaton.add_state("u1") automaton.add_state("u_acc") if self.enforce_single_observable_per_location: automaton.add_edge("u0", "u1", [CraftWorldObject.GRASS]) else: automaton.add_edge( "u0", "u1", [CraftWorldObject.GRASS, "~" + CraftWorldObject.TOOLSHED]) automaton.add_edge( "u0", "u_acc", [CraftWorldObject.GRASS, CraftWorldObject.TOOLSHED]) automaton.add_edge("u1", "u_acc", [CraftWorldObject.TOOLSHED]) automaton.set_initial_state("u0") automaton.set_accept_state("u_acc") return automaton
def get_automaton(self): automaton = SubgoalAutomaton() automaton.add_state("u0") automaton.add_state("u1") automaton.add_state("u_acc") automaton.add_state("u_rej") automaton.add_edge("u0", "u1", [ OfficeWorldObject.MAIL, "~" + OfficeWorldObject.OFFICE, "~" + OfficeWorldObject.PLANT ]) automaton.add_edge("u0", "u_acc", [ OfficeWorldObject.MAIL, OfficeWorldObject.OFFICE, "~" + OfficeWorldObject.PLANT ]) automaton.add_edge("u0", "u_rej", [OfficeWorldObject.PLANT]) automaton.add_edge( "u1", "u_acc", [OfficeWorldObject.OFFICE, "~" + OfficeWorldObject.PLANT]) automaton.add_edge("u1", "u_rej", [OfficeWorldObject.PLANT]) automaton.set_initial_state("u0") automaton.set_accept_state("u_acc") automaton.set_reject_state("u_rej") return automaton