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


Python ModelBase.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from model_base import ModelBase [as 别名]
# 或者: from model_base.ModelBase import __init__ [as 别名]
 def __init__(self, parent, id, arg_list, dtype=float):
     ModelBase.__init__(self, parent, id, arg_list[0], type)
     arg_list.pop(0)
     [self.raw_value] = arg_list.pop(0)
     self.dtype = dtype
     self.data = None
     return
开发者ID:will3216,项目名称:optimization,代码行数:9,代码来源:scalar.py

示例2: __init__

# 需要导入模块: from model_base import ModelBase [as 别名]
# 或者: from model_base.ModelBase import __init__ [as 别名]
 def __init__(self, parent, id, arg_list, dtype='float'):
     ModelBase.__init__(self, parent, id, arg_list[1], 'Param List')
     self.domain = arg_list.pop(0)
     self.raw_list = arg_list[-1]
     self.dtype = dtype
     self.shape = []
     self.data = array([])
     return
开发者ID:will3216,项目名称:optimization,代码行数:10,代码来源:parameter_list.py

示例3: __init__

# 需要导入模块: from model_base import ModelBase [as 别名]
# 或者: from model_base.ModelBase import __init__ [as 别名]
 def __init__(self, parent, id, arg_list, dtype='float'):
     ModelBase.__init__(self, parent, id, arg_list[1], 'Variable')
     self.domain = arg_list.pop(0)
     arg_list.pop(0)
     self.variable_type = arg_list.pop()
     self.upper_bound = 10**30
     self.lower_bound = -10**30
     self.dtype = dtype
     return
开发者ID:will3216,项目名称:optimization,代码行数:11,代码来源:variable.py

示例4: __init__

# 需要导入模块: from model_base import ModelBase [as 别名]
# 或者: from model_base.ModelBase import __init__ [as 别名]
 def __init__(self, parent, id, arg_list, dtype='float'):
     ModelBase.__init__(self, parent, id, arg_list[1], 'Table')
     self.domain = arg_list.pop(0)
     arg_list.pop(0)
     self.dtype = dtype
     arg_list.pop(0)
     self.raw_table = arg_list.pop()
     self.data = array([])
     return
开发者ID:will3216,项目名称:optimization,代码行数:11,代码来源:table.py

示例5: __init__

# 需要导入模块: from model_base import ModelBase [as 别名]
# 或者: from model_base.ModelBase import __init__ [as 别名]
    def __init__(self):
        """
        Constructor
        """
        ModelBase.__init__(self, "Components")
        
        self.AddAllowedAssociation(Unit = {"cid" : "C_DEVICE", "id" : "EACH"}, Part = {"cid" : "C_DEVICE_CHANNEL", "id" : "ANY"})
        self.AddAllowedAssociation(Unit = {"cid" : "C_DEVICE_TYPE", "id" : "EACH"}, Part = {"cid" : "C_DEVICE_CHANNEL_GROUP", "id" : "ANY"})

        self.GenerateValidator()
开发者ID:scythargon,项目名称:pce_web,代码行数:12,代码来源:model_components.py

示例6: __init__

# 需要导入模块: from model_base import ModelBase [as 别名]
# 或者: from model_base.ModelBase import __init__ [as 别名]
    def __init__(self):
        """
        Constructor
        """
        ModelBase.__init__(self, "Types")
        
        self.AddAllowedAssociation(Type = {"cid" : "C_BUS_TYPE", "id" : "ANY"}, Subject = {"cid" : "C_BUS", "id" : "EACH"}, multiplicity = 1)
        self.AddAllowedAssociation(Type = {"cid" : "C_BUS_CONTROLLER_TYPE", "id" : "ANY"}, Subject = {"cid" : "C_BUS_CONTROLLER", "id" : "EACH"}, multiplicity = 1)
        self.AddAllowedAssociation(Type = {"cid" : "C_DEVICE_TYPE", "id" : "ANY"}, Subject = {"cid" : "C_DEVICE", "id" : "EACH"}, multiplicity = 1)

        self.GenerateValidator()
开发者ID:scythargon,项目名称:pce_web,代码行数:13,代码来源:model_types.py

示例7: __init__

# 需要导入模块: from model_base import ModelBase [as 别名]
# 或者: from model_base.ModelBase import __init__ [as 别名]
    def __init__(self):
        """
        Constructor
        """
        ModelBase.__init__(self, "Responsibilities")
        
        self.AddAllowedAssociation(Responsible = {"cid" : "C_SERVER", "id" : "ANY"}, Subject = {"cid" : "C_IOC", "id" : "EACH"}, multiplicity=1)
        self.AddAllowedAssociation(Responsible = {"cid" : "C_IOC", "id" : "ANY"}, Subject = {"cid" : "C_DEVICE", "id" : "EACH"}, multiplicity=1)


        self.GenerateValidator()
开发者ID:scythargon,项目名称:pce_web,代码行数:13,代码来源:model_responsibilities.py

示例8: __init__

# 需要导入模块: from model_base import ModelBase [as 别名]
# 或者: from model_base.ModelBase import __init__ [as 别名]
    def __init__(self):
        """
        Constructor
        """
        ModelBase.__init__(self, "Tagging")
        
        self.AddAllowedAssociation(Tag = {"cid" : "C_TAG", "id" : "ANY"}, Subject = {"cid" : "C_TAG", "id" : "EACH"}, multiplicity=1)
        self.AddAllowedAssociation(Tag = {"cid" : "C_TAG", "id" : "ANY"}, Subject = {"cid" : "ANY", "id" : "ANY"})


        self.GenerateValidator()
开发者ID:scythargon,项目名称:pce_web,代码行数:13,代码来源:model_tagging.py

示例9: __init__

# 需要导入模块: from model_base import ModelBase [as 别名]
# 或者: from model_base.ModelBase import __init__ [as 别名]
    def __init__(self):
        """
        Constructor
        """
        ModelBase.__init__(self, "Physical Connections")
        
        self.AddAllowedAssociation(From = {"cid" : "C_SERVER", "id" : "EACH"}, To = {"cid" : "C_BUS_CONTROLLER", "id" : "ANY"})
        self.AddAllowedAssociation(From = {"cid" : "C_BUS_CONTROLLER", "id" : "EACH"}, To = {"cid" : "C_BUS", "id" : "ANY"})
        self.AddAllowedAssociation(From = {"cid" : "C_BUS", "id" : "EACH"}, To = {"cid" : "C_DEVICE", "id" : "ANY"})

        self.GenerateValidator()
开发者ID:scythargon,项目名称:pce_web,代码行数:13,代码来源:model_physical_connections.py

示例10: __init__

# 需要导入模块: from model_base import ModelBase [as 别名]
# 或者: from model_base.ModelBase import __init__ [as 别名]
    def __init__(self):
        """
        Constructor
        """
        ModelBase.__init__(self, "Logical Connections")
        
        self.AddAllowedAssociation(From = {"cid" : "C_DEVICE_LINK", "id" : "EACH"}, To = {"cid" : "C_DEVICE_CHANNEL", "id" : "ANY"}, multiplicity=1)

        self.specific_validator = ValidatorConnectorsMatch(self)

        self.GenerateValidator()
开发者ID:scythargon,项目名称:pce_web,代码行数:13,代码来源:model_logical_connections.py

示例11: __init__

# 需要导入模块: from model_base import ModelBase [as 别名]
# 或者: from model_base.ModelBase import __init__ [as 别名]
    def __init__(self, parent, id, args, type):
        ModelBase.__init__(self, parent, id, args[1], 'Equation')
        self.identifier = id
        self.domain = args[1]
        # These values should be of the form: (rel_path.module, function_name)
        self.imports = []
        self.eqn_slash_eqns = args[3]
        self.declared_variables = parent.declared_variables
        self.declared_parameters = parent.declared_parameters
        self.declared_equations = parent.declared_equations
        self.warning_list = []
        self.processed_eqs = []
        self.domain_checking = parent.domain_checking

        return
开发者ID:will3216,项目名称:optimization,代码行数:17,代码来源:base_equation.py

示例12: __init__

# 需要导入模块: from model_base import ModelBase [as 别名]
# 或者: from model_base.ModelBase import __init__ [as 别名]
 def __init__(self, parent, id, arg_list):
     ModelBase.__init__(self, parent, id, arg_list[0], 'Set')
     # The labels of the members of this Set
     self.labels = arg_list[1]
开发者ID:will3216,项目名称:optimization,代码行数:6,代码来源:set.py


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