本文整理汇总了Python中state.State.evaluate方法的典型用法代码示例。如果您正苦于以下问题:Python State.evaluate方法的具体用法?Python State.evaluate怎么用?Python State.evaluate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类state.State
的用法示例。
在下文中一共展示了State.evaluate方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_eu_loop
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import evaluate [as 别名]
def test_eu_loop():
t = Transition([0], [0])
p = PetriNet([t])
s1 = State([1], p)
prop = EUProposition(TrueProposition(), FalseProposition())
s1.evaluate(prop) # should terminate
assert len(p._states_cache) == 1
示例2: test_eg_loop
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import evaluate [as 别名]
def test_eg_loop():
t = Transition([0], [0])
p = PetriNet([t])
s1 = State([1], p)
prop = EGProposition(TrueProposition())
assert s1.evaluate(prop) == True
assert len(p._states_cache) == 1
示例3: test_eu_proposition_2
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import evaluate [as 别名]
def test_eu_proposition_2():
t = Transition([0], [1])
p = PetriNet([t])
s1 = State([0,2], p)
prop = EUProposition(LessProposition(NumericExpression(0),
VariableExpression(0)), TrueProposition())
assert s1.evaluate(prop) == True
示例4: test_ex_proposition
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import evaluate [as 别名]
def test_ex_proposition():
t1 = Transition([0], [1])
t2 = Transition([1], [2])
p = PetriNet([t1, t2])
s1 = State([1,1,0], p)
prop = EXProposition(EqualsProposition(VariableExpression(0), NumericExpression(0)))
assert s1.evaluate(prop) == True
示例5: test_eu_proposition_1
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import evaluate [as 别名]
def test_eu_proposition_1():
t = Transition([0], [1])
p = PetriNet([t])
s1 = State([0,2], p)
prop = EUProposition(LessProposition(NumericExpression(0),
VariableExpression(0)), EqualsProposition(VariableExpression(1), NumericExpression(3)))
assert s1.evaluate(prop) == False
示例6: test_dual_loop
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import evaluate [as 别名]
def test_dual_loop():
t1 = Transition([0], [1])
t2 = Transition([1], [0])
p = PetriNet([t1, t2])
s1 = State([0, 1], p)
prop = EGProposition(TrueProposition())
assert s1.evaluate(prop) == True
示例7: test_eu_proposition_3
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import evaluate [as 别名]
def test_eu_proposition_3():
p = PetriNet([])
s = State([], p)
prop = EUProposition(TrueProposition(), FalseProposition())
assert s.evaluate(prop) == False
示例8: test_petri_net_with_propositions
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import evaluate [as 别名]
def test_petri_net_with_propositions():
t = Transition([0], [1])
p = PetriNet([t])
s1 = State([1,0], p)
assert s1.evaluate(AndProposition(EqualsProposition(VariableExpression(0), NumericExpression(1)),
EqualsProposition(VariableExpression(1), NumericExpression(0))))
示例9: test_eg_five
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import evaluate [as 别名]
def test_eg_five():
t = Transition([0], [1])
p = PetriNet([t])
s1 = State([5,0], p)
prop = EGProposition(LessProposition(NumericExpression(0), VariableExpression(0)))
assert s1.evaluate(prop) == False
示例10: test_mark_continuation_true
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import evaluate [as 别名]
def test_mark_continuation_true():
p = TrueProposition()
s1 = State([1])
assert s1.evaluate(p) == True
assert p.label() not in s1.labels
示例11: test_mark_continuation_false
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import evaluate [as 别名]
def test_mark_continuation_false():
p = FalseProposition()
s1 = State([1])
assert s1.evaluate(p) == False
assert p.label() not in s1.labels