當前位置: 首頁>>代碼示例>>Python>>正文


Python StateMachine.get_action方法代碼示例

本文整理匯總了Python中statemachine.StateMachine.get_action方法的典型用法代碼示例。如果您正苦於以下問題:Python StateMachine.get_action方法的具體用法?Python StateMachine.get_action怎麽用?Python StateMachine.get_action使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在statemachine.StateMachine的用法示例。


在下文中一共展示了StateMachine.get_action方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: go

# 需要導入模塊: from statemachine import StateMachine [as 別名]
# 或者: from statemachine.StateMachine import get_action [as 別名]
    def go(self):
        m = StateMachine()
        # for  tmp in self.__cargos:
        #     print(tmp)
        '''Present'''
        m.add_state("Start", self.start_transitions)
        m.add_state('1A_state', self._1A_state_transitions)
        m.add_state('1C_state', None, end_state=1)
        m.add_state('2A_state', self._2A_state_transitions)
        m.add_state('2B_state', None, end_state=1)
        m.add_state('2C_state', None, end_state=1)

        m.add_state('Z1_VBP_state', self._Z1_VBP_state_transitions)
        m.add_state('Z1_VBZ_state', self._Z1_VBZ_state_transitions)
        m.add_state('1B_VBP_state', None, end_state=1)
        m.add_state('1B_VBZ_state', None, end_state=1)
        m.add_state('1D_state', None, end_state=1)  ### TODO: review, we add quan-subj state for uw-166

        m.add_state('Z2_state', self._Z2_state_transitions)
        m.add_state('3A_state', self._3A_state_transitions)
        m.add_state('3B_state', None, end_state=1)
        m.add_state('3C_state', None, end_state=1)
        m.add_state('4A_state', self._4A_state_transitions)
        m.add_state('4B_state', None, end_state=1)
        m.add_state('4C_state', None, end_state=1)

        '''Past'''
        m.add_state('5A_state', self._5A_state_transitions)
        m.add_state('5C_state', None, end_state=1)
        m.add_state('6A_state', self._6A_state_transitions)
        m.add_state('6B_state', None, end_state=1)
        m.add_state('6C_state', None, end_state=1)

        m.add_state('Z3_state', self._Z3_state_transitions)
        m.add_state('5B_state', None, end_state=1)

        m.add_state('Z4_state', self._Z4_state_transitions)
        m.add_state('7A_state', self._7A_state_transitions)
        m.add_state('7B_state', None, end_state=1)
        m.add_state('7C_state', None, end_state=1)
        m.add_state('8A_state', self._8A_state_transitions)
        m.add_state('8B_state', None, end_state=1)
        m.add_state('8C_state', None, end_state=1)

        '''Future and MD'''
        m.add_state('ZM_state', self._ZM_state_transitions)
        m.add_state('9A_state', self._9A_state_transitions)
        m.add_state('9C_state', None, end_state=1)
        m.add_state('10A_state', self._10A_state_transitions)
        m.add_state('10B_state', None, end_state=1)
        m.add_state('10C_state', None, end_state=1)

        # m.add_state('Z3_state', self._Z3_state_transitions)
        m.add_state('9B_state', self._9B_state_transitions)

        # m.add_state('Z5_state', self._Z5_state_transitions) Z5 merged with 9B
        m.add_state('11A_state', self._11A_state_transitions)
        m.add_state('11B_state', None, end_state=1)
        m.add_state('11C_state', None, end_state=1)
        m.add_state('12A_state', self._12A_state_transitions)
        m.add_state('12B_state', None, end_state=1)
        m.add_state('12C_state', None, end_state=1)
        m.add_state('error_state', None, end_state=1)

        m.set_start("Start")
        m.run(self.__cargos, actions)

        return m.get_tvstate(), m.get_action()
開發者ID:Joecth,項目名稱:MWP_ExplanationGenerator,代碼行數:70,代碼來源:statemachine_tv.py


注:本文中的statemachine.StateMachine.get_action方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。