本文整理匯總了Python中openalea.core.node.Node.simulate_destruction_notifications方法的典型用法代碼示例。如果您正苦於以下問題:Python Node.simulate_destruction_notifications方法的具體用法?Python Node.simulate_destruction_notifications怎麽用?Python Node.simulate_destruction_notifications使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類openalea.core.node.Node
的用法示例。
在下文中一共展示了Node.simulate_destruction_notifications方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: simulate_destruction_notifications
# 需要導入模塊: from openalea.core.node import Node [as 別名]
# 或者: from openalea.core.node.Node import simulate_destruction_notifications [as 別名]
def simulate_destruction_notifications(self):
"""emits messages as if we were adding elements to
the composite node"""
Node.simulate_destruction_notifications(self)
ids = self.vertices()
for eltid in ids:
node = self.node(eltid)
self.notify_vertex_removal(node)
for eid in self.edges():
(src_id, dst_id) = self.source(eid), self.target(eid)
etype=None
src_port_id = self.local_id(self.source_port(eid))
dst_port_id = self.local_id(self.target_port(eid))
nodeSrc = self.node(src_id)
nodeDst = self.node(dst_id)
src_port = nodeSrc.output_desc[src_port_id]
dst_port = nodeDst.input_desc[dst_port_id]
#don't notify if the edge is connected to the input or
#output nodes.
# if(src_id == self.id_in or dst_id == self.id_out):
# continue
edgedata = "default", eid
self.notify_listeners(("edge_removed", edgedata))