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


Python Element.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from element import Element [as 别名]
# 或者: from element.Element import __init__ [as 别名]
 def __init__(self, agent, element_name, trigger, element, max_retries):
     """Initialises the competence element.
     
     The log domain is set to [AgentName].CE.[element_name].
     
     @param agent: The competence element's agent.
     @type agent: L{SPOSH.Agent}
     @param element_name: The name of the competence element.
     @type element_name: string
     @param trigger: The element's trigger
     @type trigger: L{SPOSH.Trigger}
     @param element: The element to fire.
     @type element: L{SPOSH.Action}, L{SPOSH.Competence}, or
         L{SPOSH.ActionPattern}
     @param max_retries: The maximum number of retires. If this is set
         to a negative number, it is ignored.
     @type max_retries: int
     """
     Element.__init__(self, agent, "CE.%s" % element_name)
     self._name = element_name
     self._trigger = trigger
     self._element = element
     self._max_retries = max_retries
     self._retries = 0
     self.debug("Created")
开发者ID:clr,项目名称:cos570,代码行数:27,代码来源:competence.py

示例2: __init__

# 需要导入模块: from element import Element [as 别名]
# 或者: from element.Element import __init__ [as 别名]
 def __init__(self, model, xc=0, yc=0, R=1, N=0.001, layer=0, name="CircAreasink", label=None):
     Element.__init__(self, model, Nparam=1, Nunknowns=0, layers=layer, name=name, label=label)
     self.xc = float(xc)
     self.yc = float(yc)
     self.R = float(R)
     self.N = float(N)
     self.model.add_element(self)
开发者ID:mbakker7,项目名称:timml,代码行数:9,代码来源:circareasink.py

示例3: __init__

# 需要导入模块: from element import Element [as 别名]
# 或者: from element.Element import __init__ [as 别名]
 def __init__(self, model, xc=0, yc=0, label=None):
     Element.__init__(self, model, Nparam=1, Nunknowns=1, layers=range(model.aq.Naq),\
                      name='ConstantInside', label=label)
     self.xc = np.atleast_1d(xc)
     self.yc = np.atleast_1d(yc)
     self.parameters = np.zeros((1,1))
     self.model.add_element(self)
开发者ID:astraiophos,项目名称:timml,代码行数:9,代码来源:constant.py

示例4: __init__

# 需要导入模块: from element import Element [as 别名]
# 或者: from element.Element import __init__ [as 别名]
    def __init__(self,
            mark_x,
            mark_y,
            pcb_name):
        Element.__init__(self,mark_x = mark_x,mark_y = mark_y,
                         pcb_name = pcb_name)

        num_dots = 7
        dot_pitch_x = 10.16 * MM

        cathode_offset_x = 7 * MM
        cathode_offset_y = 3.2 * MM

        class Dot:
            def __init__(self,x,y,i):
                d = {'thickness':1.3 * MM,
                     'clearance':0.1 * MM,
                     'mask':0.1 * MM,
                     'drillhole':1 * MM} # FIXME: check this!

                self.anode = Pin(x = x,y = y,
                                 number = i * 2 + 1,
                                 **d)
                self.cathode = Pin(x = x + cathode_offset_x,
                                   y = y + cathode_offset_y,
                                   number = i * 2 + 2,
                                   **d)

        self.dot = []
        x = 0
        for i in range(0,7):
            self.dot.append(Dot(x,0,i))
            x += dot_pitch_x
            self.pins.append(self.dot[i].anode)
            self.pins.append(self.dot[i].cathode)
开发者ID:petertodd,项目名称:entropy-oscillator.elec,代码行数:37,代码来源:flipdot.py

示例5: __init__

# 需要导入模块: from element import Element [as 别名]
# 或者: from element.Element import __init__ [as 别名]
 def __init__(self, agent, element_name, trigger, root, max_freq):
     """Initialises the drive element.
     
     The log domain is set to [AgentName].DE.[element_name]
     
     @param agent: The element's agent.
     @type agent: L{SPOSH.Agent}
     @param element_name: The name of the drive element.
     @type element_name: string
     @param trigger: The trigger of the element.
     @type trigger: L{SPOSH.Trigger}
     @param root: The element's root element.
     @type root: L{SPOSH.Action}, L{SPOSH.Competence} or
         L{SPOSH.ActionPattern}
     @param max_freq: The maximum frequency at which is element is
         fired. The frequency is given in milliseconds between
         invocation. A negative number disables this feature.
     @type max_freq: long
     """
     Element.__init__(self, agent, "DE.%s" % element_name)
     self._name = element_name
     self._trigger = trigger
     self._root, self._element = root, root
     self._max_freq = max_freq
     # the timestamp when it was last fired
     self._last_fired = -100000l
     self.debug("Created")
开发者ID:clr,项目名称:cos570,代码行数:29,代码来源:drive.py

示例6: __init__

# 需要导入模块: from element import Element [as 别名]
# 或者: from element.Element import __init__ [as 别名]
 def __init__(self, model, slope, angle,\
              name='Uflow', label=None):
     assert model.aq.ilap, 'TimML Error: Uflow can only be added to model with background confined aquifer'
     self.storeinput(inspect.currentframe())
     Element.__init__(self, model, Nparam=2, Nunknowns=0, layers=0,\
                      name=name, label=label)
     self.slope = slope
     self.angle = angle
     self.model.add_element(self)
开发者ID:mbakker7,项目名称:timml,代码行数:11,代码来源:uflow.py

示例7: __init__

# 需要导入模块: from element import Element [as 别名]
# 或者: from element.Element import __init__ [as 别名]
    def __init__(self, content=None, parent=None):
        Element.__init__(self, content, parent)

        if isinstance(content, str):
            self._transform = Transform()
            self._computed_transform = self._transform
        else:
            self._transform = Transform(content.get("transform",None))
            self._computed_transform = self._transform
            if parent:
                self._computed_transform = self._transform + self.parent.transform
开发者ID:aimoaimo,项目名称:glumpy,代码行数:13,代码来源:transformable.py

示例8: __init__

# 需要导入模块: from element import Element [as 别名]
# 或者: from element.Element import __init__ [as 别名]
 def __init__(self, model, xw=0, yw=0, Qw=100.0, rw=0.1, \
              res=0.0, layers=0, name='WellBase', label=None):
     Element.__init__(self, model, Nparam=1, Nunknowns=0, layers=layers,\
                      name=name, label=label)
     self.Nparam = len(self.pylayers) # Defined here and not in Element as other elements can have multiple parameters per layers
     self.xw = float(xw)
     self.yw = float(yw)
     self.Qw = np.atleast_1d(Qw)
     self.rw = float(rw)
     self.res = float(res)
     self.model.add_element(self)
开发者ID:astraiophos,项目名称:timml,代码行数:13,代码来源:well.py

示例9: __init__

# 需要导入模块: from element import Element [as 别名]
# 或者: from element.Element import __init__ [as 别名]
 def __init__(self, model, xy, closed=False, layers=0, order=0, name='LineSinkStringBase', label=None, aq=None):
     Element.__init__(self, model, Nparam=1, Nunknowns=0, layers=layers, \
                      name=name, label=label)
     self.xy = np.atleast_2d(xy).astype('d')
     if closed: self.xy = np.vstack((self.xy, self.xy[0]))
     self.order = order
     self.aq = aq
     self.lslist = []
     self.x, self.y = self.xy[:,0], self.xy[:,1]
     self.Nls = len(self.x) - 1
     for i in range(self.Nls):
         self.lslist.append(LineSinkHoBase(model, \
             x1=self.x[i], y1=self.y[i], x2=self.x[i+1], y2=self.y[i+1], \
             Qls=0.0, layers=layers, order=order, label=label, addtomodel=False, aq=aq))
开发者ID:astraiophos,项目名称:timml,代码行数:16,代码来源:linesink.py

示例10: __init__

# 需要导入模块: from element import Element [as 别名]
# 或者: from element.Element import __init__ [as 别名]
 def __init__(self, model, x1=-1, y1=0, x2=1, y2=0, Qls=100.0, \
              res=0, wh=1, layers=0, name='LineSinkBase', label=None, \
              addtomodel=True):
     Element.__init__(self, model, Nparam=1, Nunknowns=0, layers=layers, \
                      name=name, label=label)
     self.Nparam = len(self.pylayers)
     self.x1 = float(x1)
     self.y1 = float(y1)
     self.x2 = float(x2)
     self.y2 = float(y2)
     self.Qls = np.atleast_1d(Qls)
     self.res = float(res)
     self.wh = wh
     self.addtomodel = addtomodel
     if self.addtomodel: self.model.add_element(self)
开发者ID:mbakker7,项目名称:timml,代码行数:17,代码来源:linesink.py

示例11: __init__

# 需要导入模块: from element import Element [as 别名]
# 或者: from element.Element import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     self.__dict__['_subnet'] = None
     Element.__init__(self, *args, **kwargs)
开发者ID:nveeser,项目名称:dino,代码行数:5,代码来源:schema.py

示例12: __init__

# 需要导入模块: from element import Element [as 别名]
# 或者: from element.Element import __init__ [as 别名]
 def __init__(self,image=None,position=(0,0)):
     Element.__init__(self,position)
     self.image = image
开发者ID:shahidgadda,项目名称:head_soccer_network,代码行数:5,代码来源:surface.py

示例13: __init__

# 需要导入模块: from element import Element [as 别名]
# 或者: from element.Element import __init__ [as 别名]
    def __init__(self, plotter, children):
	Element.__init__(self, plotter)
	assert len(children) == 0
开发者ID:sdiehl,项目名称:pymathml,代码行数:5,代码来源:mspace.py


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