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


Python Node.__init__方法代码示例

本文整理汇总了Python中Node.Node.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Node.__init__方法的具体用法?Python Node.__init__怎么用?Python Node.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Node.Node的用法示例。


在下文中一共展示了Node.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import __init__ [as 别名]
 def __init__(self, x=0.0, y=0.0, w=0.0, h=0.0):
         Translator.__init__(self)
         Node.__init__(self)
         self.x = x
         self.y = y
         self.w = w
         self.h = h
开发者ID:nbudin,项目名称:solidfuel,代码行数:9,代码来源:Box.py

示例2: __init__

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import __init__ [as 别名]
 def __init__(self, nodeType):
     Node.__init__(self, nodeType)
     self.itsVariableNames = ObjToIntMap(11)
     self.itsVariables = []
     self.itsConst = []
     self.functions = []
     self.regexps = []
开发者ID:Mitame,项目名称:pynoceros,代码行数:9,代码来源:ScriptOrFnNode.py

示例3: __init__

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import __init__ [as 别名]
    def __init__(self, LexNode):
        Node.__init__(self, LexNode)

        self.text     = self.tokens.get('STRING', "")
        self.type     = self.tokens.get('TYPE', "boolean")
        self.ID       = self.tokens.get('ID', uuid.uuid4())
        self.function = self.tokens.get('function', None)
开发者ID:guyromb,项目名称:many-ql,代码行数:9,代码来源:Question.py

示例4: __init__

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import __init__ [as 别名]
    def __init__(self, LexNode, ifChildren=None, elseChildren=None):
        Node.__init__(self, LexNode)

        self.expression = self.tokens.get('expr')

        self.ifChildren   = ifChildren or list()
        self.elseChildren = elseChildren or list()
开发者ID:guyromb,项目名称:many-ql,代码行数:9,代码来源:Branch.py

示例5: __init__

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import __init__ [as 别名]
    def __init__(self, logp,  doc, name, parents, cache_depth=2, plot=None, verbose=None, logp_partial_gradients = {}):

        self.ParentDict = ParentDict

        # This function gets used to evaluate self's value.
        self._logp_fun = logp
        self._logp_partial_gradients_functions = logp_partial_gradients


        self.errmsg = "Potential %s forbids its parents' current values"%name

        Node.__init__(  self,
                        doc=doc,
                        name=name,
                        parents=parents,
                        cache_depth = cache_depth,
                        verbose=verbose)

        

        self._plot = plot

        # self._logp.force_compute()

        # Check initial value
        if not isinstance(self.logp, float):
            raise ValueError, "Potential " + self.__name__ + "'s initial log-probability is %s, should be a float." %self.logp.__repr__()
开发者ID:jbwhit,项目名称:pymc,代码行数:29,代码来源:PyMCObjects.py

示例6: __init__

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import __init__ [as 别名]
    def __init__(self, LexNode=None, value=None, operator=None):
        Node.__init__(self, LexNode)

        self.value    = value
        self.operator = operator

        self._setOperation(operator)
开发者ID:guyromb,项目名称:many-ql,代码行数:9,代码来源:UnaryExpression.py

示例7: __init__

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import __init__ [as 别名]
 def __init__(self, function_name, given_type):
     Node.__init__(self, function_name)
     self.number_of_params = 0
     self.return_type = None
     self.type = given_type
     # We only want to allow parameters to be added to each green node one time.
     self.param_flag = False
开发者ID:tommygun101,项目名称:Code-ButternutSquash,代码行数:9,代码来源:GreenNode.py

示例8: __init__

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import __init__ [as 别名]
    def __init__(self, doc, parent, attr):
        self.doc    = doc
        self.parent = parent
        self.attr   = attr
        self.tag    = BeautifulSoup.Tag(parser = self.doc, name = 'attr')
        Node.__init__(self, doc)

        self._value = self.getValue()
开发者ID:medim,项目名称:thug,代码行数:10,代码来源:Attr.py

示例9: __init__

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import __init__ [as 别名]
    def __init__(self, lineCalc, lineDecorator, parent, name, img, x = 0, y = 0, w = 100, h = 100):
        Node.__init__(self, lineCalc, lineDecorator, parent, name, x, y, w, h)    

        self.img = img    
        if img is not None and (img.width() != self.w or img.height() != self.h):
            self.img = img.scaled(self.w, self.h)
        
        self.bitmap_lock = threading.Lock()
开发者ID:eccam,项目名称:PySideGraph,代码行数:10,代码来源:ImageNode.py

示例10: __init__

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import __init__ [as 别名]
 def __init__(self):
     """
         each child is characterized by a (decomposition, ProdNode)
         pair, and for each child they have corresponding counts which
         denotes how many times they have won in the inference process.
     """
     Node.__init__(self)
     self.__counts = 0
     self.__children = dict()
     self.__children_counts = dict()
开发者ID:danuker,项目名称:Sum-Product-Networks,代码行数:12,代码来源:SumNode.py

示例11: __init__

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import __init__ [as 别名]
	def __init__(self):
		Node.__init__(self)
		self._lights = []
		self.cameraX = self.cameraY = 0.0
		self.cameraZ = 6.0
		self.pitch = self.yaw = self.roll = 0.0
		
		glMatrixMode(GL_PROJECTION)
		glLoadIdentity()
		d = getDisplay()
		gluPerspective(45.0, float(d.w)/float(d.h), 0.1, 1000.0)
		self._projMatrix = glGetDoublev(GL_PROJECTION_MATRIX)
		glLoadMatrixd(getDisplay()._projMatrix)
		glMatrixMode(GL_MODELVIEW)
开发者ID:nbudin,项目名称:solidfuel,代码行数:16,代码来源:ThreeDScene.py

示例12: __init__

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import __init__ [as 别名]
    def __init__(self, name='no name', logger=logging, show=True):
        Node.__init__(self, name=name, logger=logger)
        self.show = show
        """ Boolean
            Can be:

              * ``True`` : This transition will be shown using the method
                           :func:`simulation <petrinet_simulator.TimedPetriNet.simulation>`
              * ``False`` : This transition won't be shown
        """
        self.tokenQueue = []
        """ List of token's lists. At each firing, only the first list is considered, then deleted after the firing.
            The transition can fire only if all the tokens given in the first list are on the places up and are enable.
        """
        self.tokenQueueAfterFire = []
        """ It's a List of dictionnary token's tuple: dictionnary. At each firing, only the first dictionnary is
开发者ID:mickael-grima,项目名称:petrinetX,代码行数:18,代码来源:Transition.py

示例13: __init__

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import __init__ [as 别名]
    def __init__(self, name='', logger=logging, withoutPriority=False, tokName=None, exit=False):
        Node.__init__(self, name=name, logger=logger)
        self.token = []
        """ List of tokens currently on the place
        """
        self.withoutPriority = withoutPriority
        """ Boolean
            Can be:

               * ``True`` : If a token arrive on this place, all its priorities are deleted
               * ``False`` : Nothing happens
        """
        self.tokName = tokName
        """ The name of the tokens that arrive on this place. Their previous name is deleted
        """
        self.exit = exit
        """ Boolean
开发者ID:mickael-grima,项目名称:petrinetX,代码行数:19,代码来源:Place.py

示例14: __init__

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import __init__ [as 别名]
    def __init__(self, node_size, user_cpd=None, prior=None, name=""):
        """
        @param node_size: number of values the node can adopt
        @type node_size: int

        @param user_cpd: optional user supplied CPD table
        @type user_cpd: numpy array

        @param prior: a prior object
        @type prior: object from L{DiscretePriors}
        """
        # Number of values the node can adopt
        self.node_size=node_size
        # Use custom CPD if present
        self.user_cpd=user_cpd
        self.arange_node_size=arange(0, node_size)
        self.prior=prior
        self.name=name
        self.counts=None
        # Parameter count
        Node.__init__(self, output_size=1, node_type="DISCRETE")
开发者ID:andersx,项目名称:fragbuilder,代码行数:23,代码来源:DiscreteNode.py

示例15: __init__

# 需要导入模块: from Node import Node [as 别名]
# 或者: from Node.Node import __init__ [as 别名]
	def __init__(self, width=None, height=None, flags=0):
		self._displayInfo = pygame.display.Info()
		Display.obj = self
		if width is None or height is None:
			flags |= FULLSCREEN
			width = self._displayInfo.current_w
			height = self._displayInfo.current_h
		self._nativeW = self.w = width
		self._nativeH = self.h = height

		pygame.display.init()
		self._flags = flags
		self.setDisplayMode()
		
		glShadeModel(GL_SMOOTH)
		glClearColor(0.0, 0.0, 0.0, 0.0)
		glClearDepth(1.0)
		glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)
		
		glEnable(GL_BLEND)
		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
		glDepthFunc(GL_LEQUAL)

		glViewport(0, 0, self.w, self.h)
		glMatrixMode(GL_PROJECTION)
		glLoadIdentity()
		glOrtho(0, self.w, 0, self.h, 6.0, 100.0)
		self._projMatrix = glGetDoublev(GL_PROJECTION_MATRIX)
		glMatrixMode(GL_MODELVIEW)
		glLoadIdentity()
		
		if config.use_anisotropic:
			try:
				glGetString(GL_EXTENSIONS).index("GL_EXT_texture_filter_anisotropic")
				glInitTextureFilterAnisotropicEXT()
			except:
				config.use_anisotropic = 0
		
		Node.__init__(self)
开发者ID:nbudin,项目名称:solidfuel,代码行数:41,代码来源:Display.py


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