# 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


import os
import matplotlib.pyplot as plot
from gridsim.decorators import accepts, returns
    :align: center

.. figure:: ../../demo/output/fig2.png
    :align: center

.. figure:: ../../demo/output/fig3.png
    :align: center

* On line 72, we use a second saver to save in a csv file the a recorder we
  already saved, here the 20th first lines:

.. literalinclude:: ../../demo/output/fig2.csv
    :linenos:
    :lines: 1-20

"""




class AttributesGetter(object):

    def __init__(self):
        """
        __init__(self)

        This is the based class for all data which have to be saved.
        """
        super(AttributesGetter, self).__init__()


# 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/iodata/output.py
import os
import matplotlib.pyplot as plot
from gridsim.decorators import accepts, returns

    :align: center

.. figure:: ../../demo/output/fig2.png
    :align: center

.. figure:: ../../demo/output/fig3.png
    :align: center

* On line 72, we use a second saver to save in a csv file the a recorder we
  already saved, here the 20th first lines:

.. literalinclude:: ../../demo/output/fig2.csv
    :linenos:
    :lines: 1-20

"""




class AttributesGetter(object):

    def __init__(self):
        """
        __init__(self)

        This is the based class for all data which have to be saved.
        """
        super(AttributesGetter, self).__init__()


    @returns(list)