本文整理汇总了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
示例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
示例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
示例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
示例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()
示例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()
示例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()
示例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()
示例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()
示例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()
示例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
示例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]