def __init__(self, namespace=None, GOOboXmlFileName=None): DiGraph.__init__(self) self.namespace = namespace if GOOboXmlFileName != None: self.parseOboXml(GOOboXmlFileName)
def __init__(self, data=None, **keywords): """ 2013.3.5, put GraphWrapper, behind DiGraph in inheritance 2013.1.3 """ DiGraph.__init__(self, data=None, **keywords) self._undirectedG = None
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")
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)
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)
def __init__(self,G,cacheGenerator,demands,item_sources,capacities,weights,delays,warmup = 0,monitoring_rate=1.0,demand_change_rate=0,demand_min=1.0,demand_max=1.0): self.env = Environment() self.warmup =warmup self.demandstats = {} self.sw ={} self.funstats ={} self.optstats = {} self.monitoring_rate=monitoring_rate self.demand_change_rate = demand_change_rate self.demand_min = demand_min self.demand_max = demand_max DiGraph.__init__(self,G) for x in self.nodes(): self.node[x]['cache'] = cacheGenerator(capacities[x],x) self.node[x]['pipe'] = Store(self.env) for e in self.edges(): x = e[0] y = e[1] self.edge[x][y]['weight'] = weights[e] self.edge[x][y]['delay'] = delays[e] self.edge[x][y]['pipe'] = Store(self.env) self.demands = {} self.item_set = set() for d in demands: self.demands[d]={} self.demands[d]['pipe'] = Store(self.env) self.demands[d]['queries_spawned'] = 0L self.demands[d]['queries_satisfied'] = 0L self.demands[d]['queries_logged'] = 0.0 self.demands[d]['pending'] = set([]) self.demands[d]['stats'] = {} self.item_set.add(d.item) for item in item_sources: for source in item_sources[item]: self.node[source]['cache'].makePermanent(item) ###THIS NEEDS TO BE IMPLEMENTED BY THE NETWORKED CACHE for d in self.demands: self.env.process(self.spawn_queries_process(d)) self.env.process(self.demand_monitor_process(d)) if self.demand_change_rate>0.0: self.env.process(self.demand_change_process(d)) if self.demand_change_rate>0.0: self.env.process(self.compute_opt_process()) for e in self.edges(): self.env.process(self.message_pusher_process(e)) for x in self.nodes(): self.env.process(self.cache_process(x)) self.env.process(self.monitor_process())
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
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 = {}
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)
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__")
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)
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)])
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)
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)
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)
def __init__(self, trace, activity_key=xes.DEFAULT_NAME_KEY, timestamp_key=xes.DEFAULT_TIMESTAMP_KEY, u_timestamp_min=xes_keys.DEFAULT_U_TIMESTAMP_MIN_KEY, u_timestamp_max=xes_keys.DEFAULT_U_TIMESTAMP_MAX_KEY, u_missing=xes_keys.DEFAULT_U_MISSING_KEY, u_activity_key=xes_keys.DEFAULT_U_NAME_KEY): DiGraph.__init__(self) timestamps_list = [] nodes_list = [] edges_list = [] # Creates all the nodes in the graph for i, event in enumerate(trace): if u_activity_key not in event: if u_missing not in event: new_node = (i, frozenset(event[activity_key])) else: new_node = (i, frozenset([event[activity_key], None])) else: if u_missing not in event: new_node = (i, frozenset(event[u_activity_key]['children'])) else: new_node = (i, frozenset(event[u_activity_key]['children'] + [None])) nodes_list.append(new_node) # Fill in the timestamps list if u_timestamp_min not in event: timestamps_list.append( (event[timestamp_key], new_node, 'CERTAIN')) else: timestamps_list.append( (event[u_timestamp_min], new_node, 'LEFT')) timestamps_list.append( (event[u_timestamp_max], new_node, 'RIGHT')) # Sort timestamps_list by first term of its elements timestamps_list.sort() # Adding the nodes to the graph object self.add_nodes_from(nodes_list) # Applies the sweeping algorithm to the sorted list for i, timestamp1 in enumerate(timestamps_list): if timestamp1[2] != 'LEFT': for timestamp2 in timestamps_list[i + 1:]: if timestamp2[2] == 'LEFT': edges_list.append((timestamp1[1], timestamp2[1])) if timestamp2[2] == 'CERTAIN': edges_list.append((timestamp1[1], timestamp2[1])) break if timestamp2[2] == 'RIGHT': if (timestamp1[1], timestamp2[1]) in edges_list: break # Adding the edges to the graph object self.add_edges_from(edges_list)
def __init__(self, data=None, name='', file=None, **attr): """ Constructor """ DiGraph.__init__(self, data=data, name=name, **attr)
def __init__(self, storage, species, aspect=Aspects.BP): DiGraph.__init__(self, weighted=True) GOGraphBase.__init__(self, storage, species, aspect)
def __init__(self, data=None, name='', file=None, **attr): """ Constructor """ DiGraph.__init__(self, data=data,name=name,**attr)
def __init__(self, cpts): DiGraph.__init__(self) self.cpts = cpts self.build_graph()
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()
def __init__(self, data=None, **attr): DiGraph.__init__(self, data, **attr)
def __init__(self): DiGraph.__init__(self) #Call the parent class init function self.number_changed = 1 self.condition_list = []
def __init__(self, storage, species, aspect=Aspects.BP): DiGraph.__init__(self, weighted=False) GOGraphBase.__init__(self, storage, species, aspect) self.root = None self.aliases={}
def __init__(self, name=''): DiGraph.__init__(self) self.predicates = {} self.reversed = None self.atoms = set([])
def __init__(self, data=None, **attr): DiGraph.__init__(self, data, **attr) self.firstThroughNode = None
def __init__(self, storage, species, aspect=Aspects.BP): DiGraph.__init__(self, weighted=False) GOGraphBase.__init__(self, storage, species, aspect) self.root = None self.aliases = {}
def __init__(self): DiGraph.__init__(self) self.ofctl_list = {} self.weight_selection_algorithm = None self.time_stamp = 0