MCPcopy Create free account
hub / github.com/ChunelFeng/CGraph / tutorial_condition

Function tutorial_condition

python/tutorial/T06-Condition.py:19–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17
18
19def tutorial_condition():
20 b0, b1, b2 = MyNode1("conditionNodeB0"), MyNode2("conditionNodeB1"), MyNode1("conditionNodeB2")
21 b_condition = MyCondition([b0, b1, b2])
22
23 d0, d1, d2 = MyNode1("conditionNodeD0"), MyNode1("conditionNodeD1"), MyNode1("conditionNodeD2")
24 d_condition = MyParamCondition([d0, d1, d2])
25
26 pipeline = GPipeline()
27 a, c = MyWriteParamNode(), MyReadParamNode()
28
29 pipeline.registerGElement(a, set(), "writeNodeA")
30 pipeline.registerGElement(b_condition, {a}, "conditionB")
31 pipeline.registerGElement(c, {b_condition}, "readNodeC")
32 pipeline.registerGElement(d_condition, {c}, "conditionD")
33
34 pipeline.init()
35 for i in range(0, 3):
36 status = pipeline.run()
37 print("==== tutorial_condition: loop : {0}, and run status = {1}".format(i + 1, status.getCode()))
38
39 pipeline.destroy()
40
41
42if __name__ == '__main__':

Callers 1

T06-Condition.pyFile · 0.70

Calls 11

initMethod · 0.95
runMethod · 0.95
destroyMethod · 0.95
MyNode1Class · 0.90
MyNode2Class · 0.90
MyConditionClass · 0.90
MyParamConditionClass · 0.90
MyWriteParamNodeClass · 0.90
MyReadParamNodeClass · 0.90
GPipelineClass · 0.85
getCodeMethod · 0.80

Tested by

no test coverage detected