当前位置: 首页>>代码示例>>Python>>正文


Python State.set_state方法代码示例

本文整理汇总了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))
开发者ID:holypriest,项目名称:editsys,代码行数:29,代码来源:manuscript.py

示例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()
开发者ID:Sashkow,项目名称:nk-network-cell-modelling,代码行数:21,代码来源:automata.py


注:本文中的state.State.set_state方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。