# Path: gridsim/decorators.py
# def accepts(*atypes):
#     """
#     accepts()
# 
#     Type Enforcement. Verifies types of parameters given to the function.
#     
#     *Example:*
#     ::
# 
#         @accepts((0,int), (1,(int,float)))
#         def func(arg1, arg2):
#             return arg1 * arg2
# 
#     .. warning::
#         In a class function, the current class cannot be used (e.g.: ``self``
#         type cannot be defined with ``accepts``)
#     """
# 
#     if __debug__:
#         def check_accepts(func):
# 
#             @wraps(func)
#             def new_func(*args, **keywords):
# 
#                 if len(atypes) != 0 and type(atypes[0]) is not tuple:
#                     raise AttributeError("Missing brackets in accepts of function "
#                                          + func.__name__)
# 
#                 for atype in atypes:
# 
#                     if type(atype[0]) is tuple:
#                         for apos in atype[0]:
# 
#                             default_param = False
#                             try:
#                                 args[apos]
#                             except IndexError:
#                                 default_param = True
# 
#                             if not default_param \
#                                     and not isinstance(args[apos], atype[1]):
#                                 raise TypeError(
#                                     "In '"+func.__name__+"', "
#                                     "params value %r does not "
#                                     "match %s" % (args[apos], atype[1]))
#                     else:
# 
#                         default_param = False
#                         try:
#                             args[atype[0]]
#                         except IndexError:
#                             default_param = True
# 
#                         if not default_param \
#                                 and not isinstance(args[atype[0]], atype[1]):
#                             raise TypeError(
#                                 "In"+func.__name__+", "
#                                 "params value %r does not "
#                                 "match %s" % (args[atype[0]], atype[1]))
# 
#                 return func(*args, **keywords)
# 
#             return new_func
#     else:
#         def check_accepts(func):
#             return func
# 
#     return check_accepts
# 
# def returns(rtype=type(None)):
#     """
#     returns()
# 
#     Type Enforcement. Verifies return type of the function.
#     
#     *Example:*
#     ::
# 
#         @returns((int,float))
#         def func(arg1, arg2):
#             return arg1 * arg2
# 
#     """
#     if __debug__:
#         def check_returns(func):
# 
#             @wraps(func)
#             def new_f(*args, **keywords):
# 
#                 result = func(*args, **keywords)
#                 if not isinstance(result, rtype):
#                     raise TypeError(
#                         "return value %r does not match %s" % (result, rtype))
#                 return result
# 
#             return new_f
#     else:
#         def check_returns(func):
#             return func
# 
#     return check_returns


from .decorators import accepts, returns
        """
        attribute_name(self)

        This method should return the module's attribute name which can be used 
        in order to get the reference to the module at the main simulation
        level. If for example this string is "electrical", the reference to the
        simulation module can be retrieved using this name as the attribute
        passed to the simulation object.

        If the user wants a reference to the simulation's module, he uses::

            sim = Simulation()
            sim.<attribute_name>

        :returns: Attribute name under which the module should be accessible on 
            the main simulator object.
        :rtype: str
        """
        raise NotImplementedError('Abstract method called!')

    def all_elements(self):
        """
        all_elements(self)

        This method should return a list of all element contained in the
        module. The core simulator will use these lists in order to be able
        to retrieve objects or list of objects by certain criteria.
        """
        raise NotImplementedError('Abstract method called!')


# Path: gridsim/decorators.py
# def accepts(*atypes):
#     """
#     accepts()
# 
#     Type Enforcement. Verifies types of parameters given to the function.
#     
#     *Example:*
#     ::
# 
#         @accepts((0,int), (1,(int,float)))
#         def func(arg1, arg2):
#             return arg1 * arg2
# 
#     .. warning::
#         In a class function, the current class cannot be used (e.g.: ``self``
#         type cannot be defined with ``accepts``)
#     """
# 
#     if __debug__:
#         def check_accepts(func):
# 
#             @wraps(func)
#             def new_func(*args, **keywords):
# 
#                 if len(atypes) != 0 and type(atypes[0]) is not tuple:
#                     raise AttributeError("Missing brackets in accepts of function "
#                                          + func.__name__)
# 
#                 for atype in atypes:
# 
#                     if type(atype[0]) is tuple:
#                         for apos in atype[0]:
# 
#                             default_param = False
#                             try:
#                                 args[apos]
#                             except IndexError:
#                                 default_param = True
# 
#                             if not default_param \
#                                     and not isinstance(args[apos], atype[1]):
#                                 raise TypeError(
#                                     "In '"+func.__name__+"', "
#                                     "params value %r does not "
#                                     "match %s" % (args[apos], atype[1]))
#                     else:
# 
#                         default_param = False
#                         try:
#                             args[atype[0]]
#                         except IndexError:
#                             default_param = True
# 
#                         if not default_param \
#                                 and not isinstance(args[atype[0]], atype[1]):
#                             raise TypeError(
#                                 "In"+func.__name__+", "
#                                 "params value %r does not "
#                                 "match %s" % (args[atype[0]], atype[1]))
# 
#                 return func(*args, **keywords)
# 
#             return new_func
#     else:
#         def check_accepts(func):
#             return func
# 
#     return check_accepts
# 
# def returns(rtype=type(None)):
#     """
#     returns()
# 
#     Type Enforcement. Verifies return type of the function.
#     
#     *Example:*
#     ::
# 
#         @returns((int,float))
#         def func(arg1, arg2):
#             return arg1 * arg2
# 
#     """
#     if __debug__:
#         def check_returns(func):
# 
#             @wraps(func)
#             def new_f(*args, **keywords):
# 
#                 result = func(*args, **keywords)
#                 if not isinstance(result, rtype):
#                     raise TypeError(
#                         "return value %r does not match %s" % (result, rtype))
#                 return result
# 
#             return new_f
#     else:
#         def check_returns(func):
#             return func
# 
#     return check_returns


# Path: gridsim/core.py
from .decorators import accepts, returns

        """
        attribute_name(self)

        This method should return the module's attribute name which can be used 
        in order to get the reference to the module at the main simulation
        level. If for example this string is "electrical", the reference to the
        simulation module can be retrieved using this name as the attribute
        passed to the simulation object.

        If the user wants a reference to the simulation's module, he uses::

            sim = Simulation()
            sim.<attribute_name>

        :returns: Attribute name under which the module should be accessible on 
            the main simulator object.
        :rtype: str
        """
        raise NotImplementedError('Abstract method called!')

    def all_elements(self):
        """
        all_elements(self)

        This method should return a list of all element contained in the
        module. The core simulator will use these lists in order to be able
        to retrieve objects or list of objects by certain criteria.
        """
        raise NotImplementedError('Abstract method called!')


    @accepts((1, int), ((2, 5), (str, type(None))), ((3, 4), (type, type(None))))