def __init__(self, id, context, component_type, extends = None): """ Constructor @param id: Id/name for this component. @type id: string @param context: The context in which to create this component. @type context: lems.model.context.Context @param component_type: Type of component. @type component_type: string @param extends: Component extended by this one. @param extends: string @note: Atleast one of component_type or extends must be valid. """ Contextual.__init__(self, id, context, Context.COMPONENT) self.id = id """ Globally unique name for this component. @type: string """ self.component_type = component_type """ Type of component. @type: string """ if component_type == None and extends == None: raise ModelError('Component definition requires a component type ' + 'or a base component') self.extends = extends """ Name of component extended by this component..
def __init__(self, id_, context, component_type, extends = None): """ Constructor @param id_: Id/name for this component. @type id_: string @param context: The context in which to create this component. @type context: lems.model.context.Context @param component_type: Type of component. @type component_type: string @param extends: Component extended by this one. @param extends: string @note: Atleast one of component_type or extends must be valid. """ Contextual.__init__(self, id_, context, Context.COMPONENT) self.id = id_ """ Globally unique name for this component. @type: string """ self.component_type = component_type """ Type of component. @type: string """ if component_type == None and extends == None: raise ModelError('Component definition requires a component type ' + 'or a base component') self.extends = extends """ Name of component extended by this component..
def __init__(self, name, context, extends = None): """ Constructor @param name: Name of this component type. @type name: string @param context: The context in which to create this component type. @type context: lems.model.context.Context @param extends: Base component type extended by this type. @type extends: string """ Contextual.__init__(self, name, context, Context.COMPONENT_TYPE) self.name = name """ Name of this component type. @type: string """ self.extends = extends """ Base component type extended by this type. @type: string """ self.types = set() """ List of compatible type (base types). @type: set(string) """ self.types.add(name) self.types.add(extends)
def __init__(self, name, context, extends = None): """ Constructor @param name: Name of this component type. @type name: string @param context: The context in which to create this component type. @type context: lems.model.context.Context @param extends: Base component type extended by this type. @type extends: string """ Contextual.__init__(self, name, context, Context.COMPONENT_TYPE) self.name = name """ Name of this component type. @type: string """ self.extends = extends """ Base component type extended by this type.