本文整理汇总了Python中state.State.set_state方法的典型用法代码示例。如果您正苦于以下问题:Python State.set_state方法的具体用法?Python State.set_state怎么用?Python State.set_state使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类state.State
的用法示例。
在下文中一共展示了State.set_state方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Manuscript
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import set_state [as 别名]
class Manuscript(object):
def __init__ (self, num, acc_date = date.today()):
self.number = num
self.state = State(acc_date)
self.eng_rev = False
def new_state(self, state, date = date.today()):
'''Indicates that the manuscript reached a new state in the
publication process'''
self.state.set_state(state, date)
def is_revised(self):
'''Returns true if the manuscript was submitted to language revision'''
return self.eng_rev
def set_revised(self):
'''Informs that a manuscript has been submitted to language revision'''
self.eng_rev = True
def __str__(self):
if self.is_revised():
eng_status = 'Abstract revised'
else:
eng_status = 'Abstract NOT revised'
return ('\n%s:\n\n%s%s\n' % (self.number, self.state, eng_status))
示例2: span_automata
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import set_state [as 别名]
def span_automata(self):
if self.state_span:
self.state_span={}
#print "Iterating automata states:"
current_state=State(0,self.N)
next_state=State(0,self.N)
for state_number in range(2**self.N):
#print "Current state:", state_number
current_state.set_state(state_number)
next_state=self.step_automata(current_state)
if self.view_states_as_binary:
self.state_span[current_state.as_string()[::]]=next_state.as_string()[::]
else:
self.state_span[current_state.as_int()]=next_state.as_int()