# 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
        """
        Exports this object into a LEMS XML object
        """
        chxmlstr = ""

        for event_connection in self.event_connections:
            chxmlstr += event_connection.toxml()

        for for_each in self.for_eachs:
            chxmlstr += for_each.toxml()

        return '<ForEach instances="{0}" as="{1}">{2}</ForEach>'.format(
            self.instances, self.as_, chxmlstr
        )


class Structure(LEMSBase):
    """
    Stores structural properties of a component type.
    """

    def __init__(self):
        """
        Constructor.
        """

        self.withs = Map()
        """ Map of With statements.
        :type: Map(str -> lems.model.structure.With) """


# 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

        """
        Exports this object into a LEMS XML object
        """
        chxmlstr = ""

        for event_connection in self.event_connections:
            chxmlstr += event_connection.toxml()

        for for_each in self.for_eachs:
            chxmlstr += for_each.toxml()

        return '<ForEach instances="{0}" as="{1}">{2}</ForEach>'.format(
            self.instances, self.as_, chxmlstr
        )


class Structure(LEMSBase):
    """
    Stores structural properties of a component type.
    """

    def __init__(self):
        """
        Constructor.
        """

        self.withs = Map()
        """ Map of With statements.
        :type: Map(str -> lems.model.structure.With) """


        self.tunnels = Map()