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


Python DiGraph.__init__方法代码示例

本文整理汇总了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")
开发者ID:mrkwjc,项目名称:ffnet,代码行数:11,代码来源:graphs.py

示例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)
开发者ID:bielcardona,项目名称:PhyloNetworks,代码行数:11,代码来源:classes.py

示例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)
开发者ID:SGo-Go,项目名称:nxUML,代码行数:11,代码来源:brownie_doc.py

示例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
开发者ID:Brunorscc,项目名称:OpenWiMesh,代码行数:12,代码来源:net_graph.py

示例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 = {}
开发者ID:columbia,项目名称:libtrack,代码行数:14,代码来源:trace_graphs.py

示例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)
开发者ID:pengtianyue,项目名称:Solvay_test,代码行数:15,代码来源:StateModel.py

示例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__")
开发者ID:yellekelyk,项目名称:strip,代码行数:17,代码来源:DAGCircuit.py

示例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)
开发者ID:jac2130,项目名称:DiversityMeasures,代码行数:17,代码来源:BayesNets.py

示例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)])
开发者ID:jac2130,项目名称:causal-model-constructor,代码行数:17,代码来源:ConstructObjects.py

示例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)
开发者ID:emsrc,项目名称:daeso-framework,代码行数:17,代码来源:graphpair.py

示例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)
开发者ID:jac2130,项目名称:ThinkBayes,代码行数:19,代码来源:thinkbayes.py

示例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 = []
开发者ID:dansand,项目名称:slippy2,代码行数:6,代码来源:material_graph.py

示例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={}
开发者ID:aswarren,项目名称:GOGranny,代码行数:7,代码来源:GODiGraph.py

示例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()
开发者ID:anhDean,项目名称:AI_Assignments,代码行数:6,代码来源:Assignment_4_bayNet.py

示例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()
开发者ID:alvations,项目名称:pydelphin,代码行数:7,代码来源:util.py


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