def __init__(self, StateIndex, TheTransitionMap, SkiDb): # A 'PseudoTemplateState' does not implement a 'MegaState_Entry'. assert isinstance(StateIndex, long) self.__entry = MegaState_Entry() AnalyzerState.set_index(self, StateIndex) # AnalyzerState.__init__(StateIndex, InitStateF, EngineType, TheTransitionMap): self.ski_db = SkiDb self.transition_map = TheTransitionMap # Maintain a list of states with which the state may not combine well self.__bad_company = set()
def __init__(self, AbsorbedAnalyzerState, AbsorbingMegaState): AnalyzerState.set_index(self, AbsorbedAnalyzerState.index) # The absorbing MegaState may, most likely, contain other transitions # than the transitions into the AbsorbedAnalyzerState. Those, others # do not do any harm, though. Filtering out those out of the hash map # does, most likely, not bring any benefit. assert AbsorbedAnalyzerState.index in AbsorbingMegaState.implemented_state_index_list() #---------------------------------------------------------------------- self.__entry = AbsorbedState_Entry(AbsorbedAnalyzerState.index, AbsorbingMegaState.entry.transition_db, AbsorbingMegaState.entry.door_db) self.absorbed_by = AbsorbingMegaState self.__state = AbsorbedAnalyzerState
def __init__(self, AbsorbedAnalyzerState, AbsorbingMegaState): AnalyzerState.set_index(self, AbsorbedAnalyzerState.index) # The absorbing MegaState may, most likely, contain other transitions # than the transitions into the AbsorbedAnalyzerState. Those, others # do not do any harm, though. Filtering out those out of the hash map # does, most likely, not bring any benefit. assert AbsorbedAnalyzerState.index in AbsorbingMegaState.implemented_state_index_list( ) #---------------------------------------------------------------------- self.__entry = AbsorbedState_Entry( AbsorbedAnalyzerState.index, AbsorbingMegaState.entry.transition_db, AbsorbingMegaState.entry.door_db) self.absorbed_by = AbsorbingMegaState self.__state = AbsorbedAnalyzerState
def __init__(self, TheEntry, TheDropOut, StateIndex): # A 'PseudoMegaState' does not implement a 'MegaState_Entry' and 'MegaState_DropOut'. # On the long term 'MegaState_DropOut' should be derived from 'DropOut'. assert isinstance(TheEntry, Entry), Entry.__class__.__name__ assert isinstance(TheDropOut, (MegaState_DropOut, DropOut, DropOutBackward, DropOutBackwardInputPositionDetection)) assert isinstance(StateIndex, long) self.__entry = TheEntry self.__drop_out = TheDropOut AnalyzerState.set_index(self, StateIndex) # Maintain a list of states with which the state may not combine well self.__bad_company = set() # State Index Sequence: Implemented States (and may be others) in an # ordered Sequence. self.__state_index_sequence = None
def __init__(self, AbsorbedAnalyzerState, AbsorbingMegaState): AnalyzerState.set_index(self, AbsorbedAnalyzerState.index) # The absorbing MegaState may, most likely, contain other transitions # than the transitions into the AbsorbedAnalyzerState. Those, others # do not do any harm, though. Filtering out those out of the hash map # does, most likely, not bring any benefit. assert AbsorbedAnalyzerState.index in AbsorbingMegaState.implemented_state_index_list() if False: for transition_id in AbsorbedAnalyzerState.entry.door_db.iterkeys(): if transition_id.state_index != AbsorbedAnalyzerState.index: continue assert AbsorbingMegaState.entry.door_db.has_key(transition_id), \ "MegaState %i absorbed %s but does not implement transition %s" % \ (AbsorbingMegaState.index, \ AbsorbingMegaState.implemented_state_index_list(), transition_id) #---------------------------------------------------------------------- self.__entry = AbsorbedState_Entry(AbsorbedAnalyzerState.index, AbsorbingMegaState.entry.transition_db, AbsorbingMegaState.entry.door_db) self.absorbed_by = AbsorbingMegaState self.__state = AbsorbedAnalyzerState