本文整理匯總了Python中statemachine.StateMachine.set_start方法的典型用法代碼示例。如果您正苦於以下問題:Python StateMachine.set_start方法的具體用法?Python StateMachine.set_start怎麽用?Python StateMachine.set_start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類statemachine.StateMachine
的用法示例。
在下文中一共展示了StateMachine.set_start方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: startthegoddamnedgame
# 需要導入模塊: from statemachine import StateMachine [as 別名]
# 或者: from statemachine.StateMachine import set_start [as 別名]
def startthegoddamnedgame():
m = StateMachine()
m.add_state("GameStarts", game_started)
m.add_state("p1TurnStart", p1_turn_start)
m.add_state("p2TurnStart", p2_turn_start)
m.add_state("p1TurnEnd", p1_turn_end)
m.add_state("p2TurnEnd", p2_turn_end)
m.add_state("p1Win", p1_win)
m.add_state("p2Win", p2_win)
m.add_state("Game_Over", None, end_state=1)
m.set_start("GameStarts")
m.run(allTiles)
示例2: run
# 需要導入模塊: from statemachine import StateMachine [as 別名]
# 或者: from statemachine.StateMachine import set_start [as 別名]
def run(fpin, fpout):
global fpindex
fpindex = fpout
m = StateMachine();
m.add_state(parse)
m.add_state(NOTES)
m.add_state(QUOTES)
m.add_state(segment)
m.add_state(error, end_state=1)
m.add_state(eof, end_state=1)
m.set_start(parse)
m.run((fpin, ''))
示例3: handle
# 需要導入模塊: from statemachine import StateMachine [as 別名]
# 或者: from statemachine.StateMachine import set_start [as 別名]
def handle (self):
m = StateMachine()
try:
m.add_state('greeting', greeting)
m.add_state('helo', helo)
m.add_state('mail', mail)
m.add_state('rcpt', rcpt)
m.add_state('data', data)
m.add_state('process', process)
m.add_state('done', None, end_state=1)
m.set_start('greeting')
m.run((self, {}))
# in the event of an exception, capture the current
# state and cargo dict and use the information
# as part of the message sent to stdout
except Exception as e:
exception_data = {'state':m.current_state}
if m.current_cargo:
exception_data['data'] = m.current_cargo[1]
e.args = (exception_data,)
raise
示例4: math_func
# 需要導入模塊: from statemachine import StateMachine [as 別名]
# 或者: from statemachine.StateMachine import set_start [as 別名]
val = math_func(val)
print " >>"
return (newState, val)
def twenties_counter(val):
print "TWENTIES State:",
while 1:
if val <= 0 or val >= 30:
newState = "Out_of_Range"; break
elif 1 <= val < 10:
newState = "ONES"; break
elif 10 <= val < 20:
newState = "TENS"; break
else:
print " *%2.1f+" % val,
val = math_func(val)
print " >>"
return (newState, val)
def math_func(n):
from math import sin
return abs(sin(n))*31
if __name__== "__main__":
m = StateMachine()
m.add_state("ONES", ones_counter)
m.add_state("TENS", tens_counter)
m.add_state("TWENTIES", twenties_counter)
m.add_state("OUT_OF_RANGE", None, end_state=1)
m.set_start("ONES")
m.run(1)
示例5: __init__
# 需要導入模塊: from statemachine import StateMachine [as 別名]
# 或者: from statemachine.StateMachine import set_start [as 別名]
class SamParaParser:
def __init__(self):
# These attributes are set by the parse method
self.doc = None
self.para = None
self.current_string = None
self.flow = None
self.stateMachine = StateMachine()
self.stateMachine.add_state("PARA", self._para)
self.stateMachine.add_state("ESCAPE", self._escape)
self.stateMachine.add_state("END", None, end_state=1)
self.stateMachine.add_state("ANNOTATION-START", self._annotation_start)
self.stateMachine.add_state("CITATION-START", self._citation_start)
self.stateMachine.add_state("BOLD-START", self._bold_start)
self.stateMachine.add_state("ITALIC-START", self._italic_start)
self.stateMachine.add_state("MONO-START", self._mono_start)
self.stateMachine.add_state("QUOTES-START", self._quotes_start)
self.stateMachine.add_state("INLINE-INSERT", self._inline_insert)
self.stateMachine.set_start("PARA")
self.patterns = {
"escape": re.compile(r"\\"),
"escaped-chars": re.compile(r"[\\\(\{\}\[\]_\*,`]"),
"annotation": re.compile(
r'(?<!\\)\{(?P<text>.*?)(?<!\\)\}(\(\s*(?P<type>\S*?\s*[^\\"\']?)(["\'](?P<specifically>.*?)["\'])??\s*(\((?P<namespace>\w+)\))?\))?'
),
"bold": re.compile(r"\*(?P<text>\S.+?\S)\*"),
"italic": re.compile(r"_(?P<text>\S.*?\S)_"),
"mono": re.compile(r"`(?P<text>\S.*?\S)`"),
"quotes": re.compile(r'"(?P<text>\S.*?\S)"'),
"inline-insert": re.compile(r">>\((?P<attributes>.*?)\)"),
"citation": re.compile(
r"(\[\s*\*(?P<id>\S+)(\s+(?P<id_extra>.+?))?\])|(\[\s*\#(?P<name_name>\S+)(\s+(?P<extra>.+?))?\])|(\[\s*(?P<citation>.*?)\])"
),
}
def parse(self, para, doc, strip=True):
if para is None:
return None
self.doc = doc
self.para = Para(para, strip)
self.current_string = ""
self.flow = Flow()
self.stateMachine.run(self.para)
return self.flow
def _para(self, para):
try:
char = para.next_char
except IndexError:
self.flow.append(self.current_string)
self.current_string = ""
return "END", para
if char == "\\":
return "ESCAPE", para
elif char == "{":
return "ANNOTATION-START", para
elif char == "[":
return "CITATION-START", para
elif char == "*":
return "BOLD-START", para
elif char == "_":
return "ITALIC-START", para
elif char == "`":
return "MONO-START", para
elif char == '"':
return "QUOTES-START", para
elif char == ">":
return "INLINE-INSERT", para
else:
self.current_string += char
return "PARA", para
def _annotation_start(self, para):
match = self.patterns["annotation"].match(para.rest_of_para)
if match:
self.flow.append(self.current_string)
self.current_string = ""
annotation_type = match.group("type")
text = match.group("text")
# If there is an annotated phrase with no annotation, look back
# to see if it has been annotated already, and if so, copy the
# closest preceding annotation.
if annotation_type is None:
# First look back in the current flow
# (which is not part of the doc structure yet).
previous = self.flow.find_last_annotation(text)
if previous is not None:
self.flow.append(previous)
else:
# Then look back in the document.
previous = self.doc.find_last_annotation(text)
if previous is not None:
self.flow.append(previous)
# Else raise an exception.
else:
raise SAMParserError(
"Blank annotation found: {"
#.........這裏部分代碼省略.........
示例6: return
# 需要導入模塊: from statemachine import StateMachine [as 別名]
# 或者: from statemachine.StateMachine import set_start [as 別名]
print 'player 2 wins!'
newState = 'game_end'
return(newState, inpList)
def game_end(inpList):
print 'End of game!'
return None
##########################################################################
# Setting up game:
allTiles = []
allTiles.extend(User1.tiles)
allTiles.extend(User2.tiles)
if __name__ == "__main__":
m = StateMachine()
m.add_state("GameStarts", game_started)
m.add_state("p1TurnStart", p1_turn_start)
m.add_state("p2TurnStart", p2_turn_start)
m.add_state("p1TurnEnd", p1_turn_end)
m.add_state("p2TurnEnd", p2_turn_end)
m.add_state("p1Win", p1_win)
m.add_state("p2Win", p2_win)
m.add_state("GameOver", game_end)
m.add_state("Out of range", None, end_state=1)
m.set_start("GameStarts")
m.run(allTiles)
示例7: math_func
# 需要導入模塊: from statemachine import StateMachine [as 別名]
# 或者: from statemachine.StateMachine import set_start [as 別名]
else:
val = math_func(val)
return (newState, val)
def twenties_counter(val):
while True:
if val <= 0 or val >= 30:
newState = STATE_OUT_OF_RANGE
break
elif 1 <= val < 10:
newState = STATE_ONES
break
elif 10 <= val < 20:
newState = STATE_TENS
break
else:
val = math_func(val)
return (newState, val)
def math_func(n):
return abs(math.sin(n))*31
if __name__== '__main__':
m = StateMachine()
m.add_state(STATE_ONES, ones_counter, end_state=False)
m.add_state(STATE_TENS, tens_counter, end_state=False)
m.add_state(STATE_TWENTIES, twenties_counter, end_state=False)
m.add_state(STATE_OUT_OF_RANGE, None, end_state=True)
m.set_start(STATE_ONES)
m.run(1)
示例8: return
# 需要導入模塊: from statemachine import StateMachine [as 別名]
# 或者: from statemachine.StateMachine import set_start [as 別名]
currentPos = m.currentpos
msg = json.dumps(currentPos)
msg = m.tractor.encrypt(msg)
xmpp.send_message(mto="[email protected]", mbody=msg)
#time.sleep(1)
newState = "AT_REST"
print "///////////////////////////////////////////"
return (newState, cargo)
if __name__ == '__main__':
try:
q = Queue(1)
xmpp = EchoBot('[email protected]', 'Q9MTZx14we',q)
xmpp.connect()
xmpp.process(block=False)
m = StateMachine(xmpp, q)
m.add_state("AT_REST", at_rest)
m.add_state("DOWNLOAD_PATH", download_path)
m.add_state("EXECUTE_PATH", execute_path)
m.add_state("UPLOAD_DATA", upload_data)
m.add_state("SHUTTING_DOWN", shutdown)
m.add_state("OFF", None, end_state = 1)
m.set_start("AT_REST")
m.run(1)
finally:
xmpp.disconnect()
示例9: __init__
# 需要導入模塊: from statemachine import StateMachine [as 別名]
# 或者: from statemachine.StateMachine import set_start [as 別名]
class SamParaParser:
def __init__(self):
# These attributes are set by the parse method
self.doc = None
self.para = None
self.current_string = None
self.flow = None
self.stateMachine = StateMachine()
self.stateMachine.add_state("PARA", self._para)
self.stateMachine.add_state("ESCAPE", self._escape)
self.stateMachine.add_state("END", None, end_state=1)
self.stateMachine.add_state("ANNOTATION-START", self._annotation_start)
self.stateMachine.add_state("CITATION-START", self._citation_start)
self.stateMachine.add_state("BOLD-START", self._bold_start)
self.stateMachine.add_state("ITALIC-START", self._italic_start)
self.stateMachine.add_state("CODE-START", self._code_start)
self.stateMachine.add_state("QUOTES-START", self._quotes_start)
self.stateMachine.add_state("INLINE-INSERT", self._inline_insert)
self.stateMachine.add_state("CHARACTER-ENTITY", self._character_entity)
self.stateMachine.set_start("PARA")
self.patterns = {
'escape': re.compile(r'\\', re.U),
'escaped-chars': re.compile(r'[\\\(\{\}\[\]_\*,\.\*`"&]', re.U),
'annotation': re.compile(
r'(?<!\\)\{(?P<text>.*?)(?<!\\)\}(\(\s*(?P<type>\S*?\s*[^\\"\']?)(["\'](?P<specifically>.*?)["\'])??\s*(\((?P<namespace>\w+)\))?\s*(~(?P<language>[\w-]+))?\))?', re.U),
'bold': re.compile(r'\*(?P<text>((?<=\\)\*|[^\*])*)(?<!\\)\*', re.U),
'italic': re.compile(r'_(?P<text>((?<=\\)_|[^_])*)(?<!\\)_', re.U),
'code': re.compile(r'`(?P<text>(``|[^`])*)`', re.U),
'quotes': re.compile(r'"(?P<text>((?<=\\)"|[^"])*)(?<!\\)"', re.U),
'inline-insert': re.compile(r'>\((?P<attributes>.*?)\)', re.U),
'character-entity': re.compile(r'&(\#[0-9]+|#[xX][0-9a-fA-F]+|[\w]+);'),
'citation': re.compile(r'(\[\s*\*(?P<id>\S+)(\s+(?P<id_extra>.+?))?\])|(\[\s*\#(?P<name_name>\S+)(\s+(?P<extra>.+?))?\])|(\[\s*(?P<citation>.*?)\])', re.U)
}
def parse(self, para, doc, strip=True):
if para is None:
return None
self.doc = doc
self.para = Para(para, strip)
self.current_string = ''
self.flow = Flow()
self.stateMachine.run(self.para)
return self.flow
def _para(self, para):
try:
char = para.next_char
except IndexError:
self.flow.append(self.current_string)
self.current_string = ''
return "END", para
if char == '\\':
return "ESCAPE", para
elif char == '{':
return "ANNOTATION-START", para
elif char == '[':
return "CITATION-START", para
elif char == "*":
return "BOLD-START", para
elif char == "_":
return "ITALIC-START", para
elif char == "`":
return "CODE-START", para
elif char == '"':
return "QUOTES-START", para
elif char == ">":
return "INLINE-INSERT", para
elif char == "&":
return "CHARACTER-ENTITY", para
else:
self.current_string += char
return "PARA", para
def _annotation_start(self, para):
match = self.patterns['annotation'].match(para.rest_of_para)
if match:
self.flow.append(self.current_string)
self.current_string = ''
annotation_type = match.group('type')
language = match.group('language')
text = self._unescape(match.group("text"))
# If there is an annotated phrase with no annotation, look back
# to see if it has been annotated already, and if so, copy the
# closest preceding annotation.
if annotation_type is None and not language:
# First look back in the current flow
# (which is not part of the doc structure yet).
previous = self.flow.find_last_annotation(text)
if previous is not None:
self.flow.append(previous)
else:
# Then look back in the document.
previous = self.doc.find_last_annotation(text)
if previous is not None:
self.flow.append(previous)
# Else output a warning.
else:
#.........這裏部分代碼省略.........
示例10: __init__
# 需要導入模塊: from statemachine import StateMachine [as 別名]
# 或者: from statemachine.StateMachine import set_start [as 別名]
class SamParser:
def __init__(self):
self.stateMachine = StateMachine()
self.stateMachine.add_state("NEW", self._new_file)
self.stateMachine.add_state("SAM", self._sam)
self.stateMachine.add_state("BLOCK", self._block)
self.stateMachine.add_state("CODEBLOCK-START", self._codeblock_start)
self.stateMachine.add_state("CODEBLOCK", self._codeblock)
self.stateMachine.add_state("PARAGRAPH-START", self._paragraph_start)
self.stateMachine.add_state("PARAGRAPH", self._paragraph)
self.stateMachine.add_state("RECORD-START", self._record_start)
self.stateMachine.add_state("RECORD", self._record)
self.stateMachine.add_state("LIST-ITEM", self._list_item)
self.stateMachine.add_state("NUM-LIST-ITEM", self._num_list_item)
self.stateMachine.add_state("BLOCK-INSERT", self._block_insert)
self.stateMachine.add_state("END", None, end_state=1)
self.stateMachine.set_start("NEW")
self.current_paragraph = None
self.doc = DocStructure()
self.source = None
self.patterns = {
'comment': re.compile(r'\s*#.*'),
'block-start': re.compile(r'(\s*)([a-zA-Z0-9-_]+):(?:\((.*?)\))?(.*)'),
'codeblock-start': re.compile(r'(\s*)```(.*)'),
'codeblock-end': re.compile(r'(\s*)```\s*$'),
'paragraph-start': re.compile(r'\w*'),
'blank-line': re.compile(r'^\s*$'),
'record-start': re.compile(r'\s*[a-zA-Z0-9-_]+::(.*)'),
'list-item': re.compile(r'(\s*)(\*\s+)(.*)'),
'num-list-item': re.compile(r'(\s*)([0-9]+\.\s+)(.*)'),
'block-insert': re.compile(r'(\s*)>>\(.*?\)\w*')
}
def parse(self, source):
self.source = source
try:
self.stateMachine.run(self.source)
except EOFError:
raise Exception("Document ended before structure was complete. At:\n\n"
+ self.current_paragraph)
def paragraph_start(self, line):
self.current_paragraph = line.strip()
def paragraph_append(self, line):
self.current_paragraph += " " + line.strip()
def pre_start(self, line):
self.current_paragraph = line
def pre_append(self, line):
self.current_paragraph += line
def _new_file(self, source):
line = source.next_line
if line[:4] == 'sam:':
self.doc.new_root('sam', line[5:])
return "SAM", source
else:
raise Exception("Not a SAM file!")
def _block(self, source):
line = source.currentLine
match = self.patterns['block-start'].match(line)
indent = len(match.group(1))
element = match.group(2).strip()
attributes = match.group(3)
content = match.group(4).strip()
if content[:1] == ':':
return "RECORD-START", source
else:
self.doc.new_block(element, attributes, content, indent)
return "SAM", source
def _codeblock_start(self, source):
line = source.currentLine
local_indent = len(line) - len(line.lstrip())
match = self.patterns['codeblock-start'].match(line)
attributes = re.compile(r'\((.*?)\)').match(match.group(2).strip())
language = attributes.group(1)
self.doc.new_block('codeblock', language, None, local_indent)
self.pre_start('')
return "CODEBLOCK", source
def _codeblock(self, source):
line = source.next_line
if self.patterns['codeblock-end'].match(line):
self.doc.new_flow(Pre(self.current_paragraph))
return "SAM", source
else:
self.pre_append(line)
return "CODEBLOCK", source
def _paragraph_start(self, source):
line = source.currentLine
local_indent = len(line) - len(line.lstrip())
self.doc.new_block('p', None, '', local_indent)
self.paragraph_start(line)
#.........這裏部分代碼省略.........
示例11: return
# 需要導入模塊: from statemachine import StateMachine [as 別名]
# 或者: from statemachine.StateMachine import set_start [as 別名]
newState = "pos_state"
elif word in negative_adjectives:
newState = "neg_state"
else:
newState = "error_state"
return (newState, txt)
elif state == "not_state":
if word in positive_adjectives:
newState = "neg_state"
elif word in negative_adjectives:
newState = "pos_state"
else:
newState = "error_state"
return (newState, txt)
if __name__ == "__main__":
m = StateMachine()
m.add_state("Start", transitions)
m.add_state("Python_state", transitions)
m.add_state("is_state", transitions)
m.add_state("not_state", transitions)
m.add_state("neg_state", None, end_state=1)
m.add_state("pos_state", None, end_state=1)
m.add_state("error_state", None, end_state=1)
m.set_start("Start")
m.run("Python is great")
"""
m.run("Python is difficult")
m.run("Perl is ugly")
"""
示例12: __init__
# 需要導入模塊: from statemachine import StateMachine [as 別名]
# 或者: from statemachine.StateMachine import set_start [as 別名]
#.........這裏部分代碼省略.........
self.no_connect()
return None
def detect_codecs(self):
if sys_name=='nt':
return 'CP866'
else:
return 'UTF8'
def parse_cmd(self,argv):
is_parse=1
i=0
cmd=''
print len(argv)
if len(argv)>1:
try:
while i<len(argv):
print argv[i],i,argv[i] in ['i','c','u']
if argv[i] in ['i','c','u']:
cmd=argv[i]
print cmd
i+=1
elif self.params.has_key(argv[i]):
self.params[argv[i]]=argv[i+1]
print argv[i+1]
i+=2
else:
print i
self.bad_parameters()
is_parse=0
break
print self.params
except:
self.bad_parameters()
is_parse=0
else:
if is_parse:
self.cmd=cmd
self.mydb=self.connect_db()
else:
self.help()
def create_state(self,m):
m.add_state('c', self.clean_db) #, 'TERM','EXT_TERM','COMMIT','SKIP'
m.add_state('cid', self.clean_db) #clean after install
m.add_state('id', self.create_db_structures)
m.add_state('d', self.create_dictionares)
m.add_state('u',self.update_db)
m.add_state('ERROR',self.error)
m.add_state('',None,end_state=1)
def run_command(self):
if self.cmd:
if self.cmd=='i':
cmd='cid'
else:
cmd=self.cmd
self.sm.set_start(cmd)
self.sm.run(cmd)
def clean_db(self,val):
import clean_db
CC=clean_db.IndexerClean()
if CC.clean(self.mydb)==1:
newState=val[1:]
else:
newState='ERROR'
return (newState, newState)
def create_db_structures(self,val):
from parse_script import ParserScript
input_file=os.path.dirname(__file__)+'\\indexer.sql'
#output_file=os.path.dirname(__file__)+'\\out.sql'
parser=ParserScript(self.mydb,input_file)
parser.run()
if parser.State=='COMPLIT':
newState=val[1:]
else:
newState='ERROR'
print "Error in create structures"
return (newState, newState)
def create_dictionares(self,val):
import dict_encode
if dict_encode.run(self.mydb)==1:
newState=val[1:]
else:
newState='ERROR'
print "Error in create dictionaries"
return (newState, newState)
def update_db(self,val):
return('','')
def error(self,val):
print 'ERROR in state '+val
newState=''
return (newState, newState)
示例13: return
# 需要導入模塊: from statemachine import StateMachine [as 別名]
# 或者: from statemachine.StateMachine import set_start [as 別名]
return (newState,restStr,detailList)
if __name__ == "__main__":
m = StateMachine()
m.add_state("start_state",start_transitions)
m.add_state("province_state",province_transitions)
m.add_state("city_state",city_transitions)
m.add_state("region_state",region_transitions)
m.add_state("state_state",state_transitions)
m.add_state("town_state",town_transitions,end_state=1)
m.add_state("street_state",street_transitions,end_state = 1)
m.add_state("doorplate_state",None,end_state = 1)
m.set_start("start_state")
#m.process("浙江杭州市西湖區城區文三路黃龍國際G座18層")
#m.process("浙江省杭州市西湖區城區文三路黃龍國際G座18層")
#m.process("北京市北三環東路8號靜安中心大廈")
#m.process("黑龍江省哈爾濱市呼蘭區南京路美蘭家園5棟2單元303")
#m.process("廣東省深圳市羅湖區金稻田路1228號理想新城9棟A單元301室")
#m.process("新疆維吾爾自治區昌吉回族自治州昌吉市昌吉市建國西路甜蜜家園9-1-301")
#m.process("北京市北京市大興區黃村鎮海子角海悅公館41號樓4單元602")
#m.process("陝西省寶雞市千陽縣南關路糧食小區")
#m.process("黑龍江省雞西市虎林市黑龍江省虎林市公安南街276號")
#m.process("遼寧省大連市金州區站前街道生輝第一城物業")
#m.process("安徽省蕪湖市無為縣高溝鎮龍庵街道")
#m.process("廣東省深圳市南山區科興科學園A3單元12樓")
#m.process("湖北省黃岡市浠水縣散花鎮塗墩村七組")
for x in open("sample_address.txt"):
示例14: go
# 需要導入模塊: from statemachine import StateMachine [as 別名]
# 或者: from statemachine.StateMachine import set_start [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()