本文整理汇总了Python中networkx.DiGraph.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python DiGraph.__init__方法的具体用法?Python DiGraph.__init__怎么用?Python DiGraph.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类networkx.DiGraph
的用法示例。
在下文中一共展示了DiGraph.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from networkx import DiGraph [as 别名]
# 或者: from networkx.DiGraph import __init__ [as 别名]
def __init__(self, conec=[], **kwargs):
"""
Calls DiGraph constructor and checks if the graph is connected and acyclic
"""
DiGraph.__init__(self, **kwargs)
DiGraph.add_edges_from(self, conec)
#self.add_edges_from(conec) #copy maximum recursion here
if not self._is_connected(): raise ValueError("Not connected graph")
if not self._is_directed_acyclic_graph(): raise ValueError("Not acyclic graph")
示例2: __init__
# 需要导入模块: from networkx import DiGraph [as 别名]
# 或者: from networkx.DiGraph import __init__ [as 别名]
def __init__(self, data=None, name='', eNewick=None, ignore_prefix=None, id_offset=0):
# initialization here
DiGraph.__init__(self, data)
self.name = name
self._labels = {}
self._lastlabel = id_offset
self.cache = {}
if eNewick != None:
self._from_eNewick(eNewick, ignore_prefix=ignore_prefix)
示例3: __init__
# 需要导入模块: from networkx import DiGraph [as 别名]
# 或者: from networkx.DiGraph import __init__ [as 别名]
def __init__(self, styles, max_label = 4, name2URL = None,
data=None, name='', file=None, **attr):
"""
Constructor
"""
self.styles = styles
self.max_label = max_label
self.name2URL = name2URL
DiGraph.__init__(self, data=data,name=name,**attr)
示例4: __init__
# 需要导入模块: from networkx import DiGraph [as 别名]
# 或者: from networkx.DiGraph import __init__ [as 别名]
def __init__(self):
DiGraph.__init__(self)
self.ofctl_list = {}
self.route_ins_table = {}
self.route_ins_global_table = {}
self.weight_selection_algorithm = None
self.other_domain_neigh = {}
# init time stamp
self.time_stamp = 0
示例5: __init__
# 需要导入模块: from networkx import DiGraph [as 别名]
# 或者: from networkx.DiGraph import __init__ [as 别名]
def __init__(self):
"""doc"""
DiGraph.__init__(self)
self.posix_calls = {}
self.posix_calls_per_lib = {}
self.posix_calls_list = []
self.native_calls = {}
self.java_calls = {}
self.full_paths_dict = {}
self.filter_calls = []
self.timing_info = {}
self.stack_depth = {}
示例6: __init__
# 需要导入模块: from networkx import DiGraph [as 别名]
# 或者: from networkx.DiGraph import __init__ [as 别名]
def __init__(self, *args, **kwargs):
self.states = list() # list of all states in the diagram
self.top_level = list() # list of all the top-level states
self.state_names = {} # map of states by name to graph node
self.transitions = list() # dictionary of all transitions in the diagram
self.id = kwargs.pop('id', 'diagram instance')
self.logger = dlog.MakeChild('StateDiagram', self.id)
# Initialize parent class
DiGraph.__init__(self, *args, **kwargs)
示例7: __init__
# 需要导入模块: from networkx import DiGraph [as 别名]
# 或者: from networkx.DiGraph import __init__ [as 别名]
def __init__(self, debug=0):
digraph.__init__(self)
self.__debug = debug
self.__inputs = set()
self.__outputs = set()
self.__cells = set()
self.__flops = set()
self.__virtual = dict() # maps name --> gate
self.__pins = dict()
self.__flopsIn = dict()
# create input, output nodes
digraph.add_node(self, "__INPUTS__")
digraph.add_node(self, "__OUTPUTS__")
示例8: __init__
# 需要导入模块: from networkx import DiGraph [as 别名]
# 或者: from networkx.DiGraph import __init__ [as 别名]
def __init__(self, data=None, name='', p=0.5, effect_pdf=lambda x, a, b : beta(a, b).pdf(x), a=2, b=2):
"""
Effect pdf is the pdf that a causal effect is assumed to be drawn from. In the absense of a "causal_effect" that is explicitly
included in the link between two nodes, we integrate over this distribution.
"""
DiGraph.__init__(self, data=data, name=name)
Joint.__init__(self)
self.p=p
self.n=len(self.nodes())
self.support=[]
self.names=[]
self.indep_vars=[]
self.dep_vars=[]
self.effect_pdf= lambda x: effect_pdf(x, a, b)
示例9: __init__
# 需要导入模块: from networkx import DiGraph [as 别名]
# 或者: from networkx.DiGraph import __init__ [as 别名]
def __init__(self,vs=set(),es=set()):
DiGraph.__init__(self)
"""
Creates a new directed graph.
@Args:
vs, a list of Vertices
es, a list of Arcs
@Returns:
None
"""
self.add_nodes_from([v.label for v in vs])
for e in es:
self.add_signed_arc(e)
self.edge_labels=dict([((u,v,),d['label']) for u,v,d in self.edges(data=True)])
示例10: __init__
# 需要导入模块: from networkx import DiGraph [as 别名]
# 或者: from networkx.DiGraph import __init__ [as 别名]
def __init__(self, banks, graphs,
data=None, meta_data=None):
"""
@param banks: a Pair of GraphBank instances
@param graphs: a Pair of DaesoGraph or GraphStub instances
@keyword data: an object to initialize the node alignment, e.g.
another GraphPairBase instance or a list of edges
@keyword meta_data: an ElementTree Element resulting from parsing
<graph_meta_data> element
"""
GraphPairBase.__init__(self, banks, graphs, meta_data)
DiGraph.__init__(self, data=data)
示例11: __init__
# 需要导入模块: from networkx import DiGraph [as 别名]
# 或者: from networkx.DiGraph import __init__ [as 别名]
def __init__(self, data=None, name='', p=0.5, causal_effect=0.5, effect_pdf=lambda x, a, b : beta(a, b).pdf(x), a=2, b=2):
"""
Effect pdf is the pdf that a causal effect is assumed to be drawn from. In the absense of a "causal_effect" we integrate over this
distribution. This distribution is here assumed to be uniform between 0 and 1, but that can be easily changed (in future versions,
I)
"""
DiGraph.__init__(self, data=data, name=name)
Joint.__init__(self)
self.p=p
self.causal_effect=causal_effect
self.n=len(self.nodes())
self.support=[]
self.names=[]
self.indep_vars=[]
self.dep_vars=[]
self.effect_pdf= lambda x: effect_pdf(x, a, b)
示例12: __init__
# 需要导入模块: from networkx import DiGraph [as 别名]
# 或者: from networkx.DiGraph import __init__ [as 别名]
def __init__(self):
DiGraph.__init__(self) #Call the parent class init function
self.number_changed = 1
self.condition_list = []
示例13: __init__
# 需要导入模块: from networkx import DiGraph [as 别名]
# 或者: from networkx.DiGraph import __init__ [as 别名]
def __init__(self, storage, species, aspect=Aspects.BP):
DiGraph.__init__(self, weighted=False)
GOGraphBase.__init__(self, storage, species, aspect)
self.root = None
self.aliases={}
示例14: __init__
# 需要导入模块: from networkx import DiGraph [as 别名]
# 或者: from networkx.DiGraph import __init__ [as 别名]
def __init__(self, cpts):
DiGraph.__init__(self)
self.cpts = cpts
self.build_graph()
示例15: __init__
# 需要导入模块: from networkx import DiGraph [as 别名]
# 或者: from networkx.DiGraph import __init__ [as 别名]
def __init__(self, data=None, name='', **attr):
DiGraph.__init__(self, data=data, name=name, attr=attr)
self.nodeids = [] if data is None else data.nodeids
self.labels = set([] if data is None else data.labels)
self.refresh()