# Path: lems/base/base.py
# class LEMSBase(object):
#     """
#     Base object for PyLEMS.
#     """
# 
#     def copy(self):
#         return copy.deepcopy(self)
# 
#     def toxml(self):
#         return ""
# 
# Path: lems/base/map.py
# class Map(dict, LEMSBase):
#     """
#     Map class.
# 
#     Same as dict, but iterates over values.
#     """
# 
#     def __init__(self, *params, **key_params):
#         """
#         Constructor.
#         """
# 
#         dict.__init__(self, *params, **key_params)
# 
#     def __iter__(self):
#         """
#         Returns an iterator.
#         """
# 
#         return iter(self.values())
# 
# Path: lems/base/errors.py
# class ModelError(LEMSError):
#     """
#     Exception class to signal errors in creating the model.
#     """
# 
#     pass


from lems.base.base import LEMSBase
from lems.base.map import Map
from lems.base.errors import ModelError
        self.assignments = []
        """ List of assignments included in MultiInstantiate.
        :type: list(Assign) """

    def __eq__(self, o):
        if self.component:
            flag = self.component == o.component and self.number == o.number
        else:
            flag = self.component_type == o.component_type and self.number == o.number
        return flag

    def add_assign(self, assign):
        """
        Adds an Assign to the structure.

        :param assign: Assign structure.
        :type assign: lems.model.structure.Assign
        """
        self.assignments.append(assign)

    def add(self, child):
        """
        Adds a typed child object to the structure object.

        :param child: Child object to be added.
        """

        if isinstance(child, Assign):
            self.add_assign(child)
        else:

# Path: lems/base/base.py
# class LEMSBase(object):
#     """
#     Base object for PyLEMS.
#     """
# 
#     def copy(self):
#         return copy.deepcopy(self)
# 
#     def toxml(self):
#         return ""
# 
# Path: lems/base/map.py
# class Map(dict, LEMSBase):
#     """
#     Map class.
# 
#     Same as dict, but iterates over values.
#     """
# 
#     def __init__(self, *params, **key_params):
#         """
#         Constructor.
#         """
# 
#         dict.__init__(self, *params, **key_params)
# 
#     def __iter__(self):
#         """
#         Returns an iterator.
#         """
# 
#         return iter(self.values())
# 
# Path: lems/base/errors.py
# class ModelError(LEMSError):
#     """
#     Exception class to signal errors in creating the model.
#     """
# 
#     pass


# Path: lems/model/structure.py
from lems.base.base import LEMSBase
from lems.base.map import Map
from lems.base.errors import ModelError

        self.assignments = []
        """ List of assignments included in MultiInstantiate.
        :type: list(Assign) """

    def __eq__(self, o):
        if self.component:
            flag = self.component == o.component and self.number == o.number
        else:
            flag = self.component_type == o.component_type and self.number == o.number
        return flag

    def add_assign(self, assign):
        """
        Adds an Assign to the structure.

        :param assign: Assign structure.
        :type assign: lems.model.structure.Assign
        """
        self.assignments.append(assign)

    def add(self, child):
        """
        Adds a typed child object to the structure object.

        :param child: Child object to be added.
        """

        if isinstance(child, Assign):
            self.add_assign(child)
        else:

            raise ModelError("Unsupported child element")