# Path: gridsim/unit.py
# class _Unit(object):
#     def __init__(self):
#     def Quantity(self):
#     def Unit(self):
#     def __call__(self, *args, **kwargs):
#     def __getattr__(self, item):
#     def to_si(self, measurement_or_unit):
#     def value(self, measurement, unit=None):
#     def unit(self, measurement):
#     def dimension(self, measurement):
#     def convert(self, m, u):
# 
# Path: gridsim/util.py
# class Position(object):
#     """
#     Represents an abstract position on a three-dimensional space. The coordinate
#     system is WGS84.
#     """
# 
#     @accepts(((1, 2, 3), (int, float)))
#     def __init__(self, latitude=0, longitude=0, altitude=0):
#         """
#         Represents an abstract position on a three-dimensional space. The
#         coordinate system is WGS84.
# 
#         :param latitude: North-south point location the on the Earth's surface.
#         :type latitude: int, float
# 
#         :param longitude: East-west position of a point on the Earth's surface.
#         :type longitude: int, float
# 
#         :param altitude: Altitude. We recommend to use sea level as reference.
#         :type altitude: int, float
# 
#         *Example:*
#         ::
# 
#             from gridsim.util import Position
# 
#             # Create a point and output the coordinates.
#             office = Position(46.240301, 7.358394, 566)
#             print office
# 
#             # Create a second point.
#             home = Position(46.309180, 7.972517, 676)
# 
#             # Calculate the difference between the two points.
#             print home.distance_to(office)
# 
# 
#         *Output:*
#         ::
# 
#             Position: {
#                 latitude: 46,
#                 longitude: 7,
#                 altitude: 566
#             }
#         """
#         super(Position, self).__init__()
# 
#         self.latitude = float(latitude)
#         """Specifies the north-south point location on the Earth's surface."""
# 
#         self.longitude = float(longitude)
#         """Specifies the east-west point position of on the Earth's surface."""
# 
#         self.altitude = float(altitude)
#         """Altitude, we recommend to use the WGS84's sea level as reference."""
# 
#     def __eq__(self, other):
#         return self.latitude == other.latitude \
#             and self.longitude == other.longitude \
#             and self.altitude == other.altitude
# 
#     def __ne__(self, other):
#         return not self.__eq__(other)
# 
#     @returns(float)
#     def distance_to(self, other):
#         """
#         Calculates the distance between two points in meters [m]. It uses the
#             haversine formula to calculate the distance, so the altitude is
#             ignored completely and the distance is calculated for booth points
#             using the earth radius of 6371 km.
# 
#         :param other: The point to which the distance has to be calculated.
#         :type other: Position
# 
#         :returns: The distance between the two points in meters [m].
#         """
#         d_lat = math.pi * (self.latitude - other.latitude) / 180.
#         d_long = math.pi * (self.longitude - other.longitude) / 180.
#         a = math.sin(d_lat / 2.) * math.sin(d_lat / 2.) + \
#             math.cos(math.pi * other.latitude / 180.) * math.cos(
#                 math.pi * self.latitude) * \
#             math.sin(d_long / 2.) * math.sin(d_long / 2.)
#         return 6371000. * 2. * math.atan2(math.sqrt(a), math.sqrt(1. - a))
# 
# Path: gridsim/controller/simulation.py
# class AbstractControllerElement(AbstractSimulationElement):
# 
#     @accepts((1, str), (2, Position))
#     def __init__(self, friendly_name, position=Position()):
#         """
#         Base class of all element which can be part of a controller simulation.
# 
#         :param friendly_name: User friendly name to give to the element.
#         :type friendly_name: str, unicode
#         :param position: The position of the thermal element.
#             Defaults to [0,0,0].
#         :type position: :class:`Position`
#         """
#         super(AbstractControllerElement, self).__init__(friendly_name)
#         self.position = position


from gridsim.unit import units
from gridsim.util import Position
from gridsim.controller.simulation import AbstractControllerElement

        :type: target_temperature: temperature see :mod:`gridsim.unit`

        :param: hysteresis: The +- hysteresis in order to avoid to fast on/off
            switching.
        :type: hysteresis: delta temperature see :mod:`gridsim.unit`

        :param: thermal_process: The reference to the thermal process to
            observe.
        :type: thermal_process: :class:`.ThermalProcess`

        :param: subject: Reference to the object of which is attribute has to be
            changed depending on the temperature.
        :type: object

        :param: attribute: The name of the attribute to control as string.
        :type: str

        :param: on_value: The value to set for the attribute in order to turn
            the device "on".
        :type: on_value: any

        :param: off_on_value: The value to set for the attribute in order to
            turn the device "off".
        :type: off_value: any

        :param position: The position of the thermal element.
            Defaults to [0,0,0].
        :type position: :class:`Position`
        """
        super(Thermostat, self).__init__(friendly_name, position)

# Path: gridsim/unit.py
# class _Unit(object):
#     def __init__(self):
#     def Quantity(self):
#     def Unit(self):
#     def __call__(self, *args, **kwargs):
#     def __getattr__(self, item):
#     def to_si(self, measurement_or_unit):
#     def value(self, measurement, unit=None):
#     def unit(self, measurement):
#     def dimension(self, measurement):
#     def convert(self, m, u):
# 
# Path: gridsim/util.py
# class Position(object):
#     """
#     Represents an abstract position on a three-dimensional space. The coordinate
#     system is WGS84.
#     """
# 
#     @accepts(((1, 2, 3), (int, float)))
#     def __init__(self, latitude=0, longitude=0, altitude=0):
#         """
#         Represents an abstract position on a three-dimensional space. The
#         coordinate system is WGS84.
# 
#         :param latitude: North-south point location the on the Earth's surface.
#         :type latitude: int, float
# 
#         :param longitude: East-west position of a point on the Earth's surface.
#         :type longitude: int, float
# 
#         :param altitude: Altitude. We recommend to use sea level as reference.
#         :type altitude: int, float
# 
#         *Example:*
#         ::
# 
#             from gridsim.util import Position
# 
#             # Create a point and output the coordinates.
#             office = Position(46.240301, 7.358394, 566)
#             print office
# 
#             # Create a second point.
#             home = Position(46.309180, 7.972517, 676)
# 
#             # Calculate the difference between the two points.
#             print home.distance_to(office)
# 
# 
#         *Output:*
#         ::
# 
#             Position: {
#                 latitude: 46,
#                 longitude: 7,
#                 altitude: 566
#             }
#         """
#         super(Position, self).__init__()
# 
#         self.latitude = float(latitude)
#         """Specifies the north-south point location on the Earth's surface."""
# 
#         self.longitude = float(longitude)
#         """Specifies the east-west point position of on the Earth's surface."""
# 
#         self.altitude = float(altitude)
#         """Altitude, we recommend to use the WGS84's sea level as reference."""
# 
#     def __eq__(self, other):
#         return self.latitude == other.latitude \
#             and self.longitude == other.longitude \
#             and self.altitude == other.altitude
# 
#     def __ne__(self, other):
#         return not self.__eq__(other)
# 
#     @returns(float)
#     def distance_to(self, other):
#         """
#         Calculates the distance between two points in meters [m]. It uses the
#             haversine formula to calculate the distance, so the altitude is
#             ignored completely and the distance is calculated for booth points
#             using the earth radius of 6371 km.
# 
#         :param other: The point to which the distance has to be calculated.
#         :type other: Position
# 
#         :returns: The distance between the two points in meters [m].
#         """
#         d_lat = math.pi * (self.latitude - other.latitude) / 180.
#         d_long = math.pi * (self.longitude - other.longitude) / 180.
#         a = math.sin(d_lat / 2.) * math.sin(d_lat / 2.) + \
#             math.cos(math.pi * other.latitude / 180.) * math.cos(
#                 math.pi * self.latitude) * \
#             math.sin(d_long / 2.) * math.sin(d_long / 2.)
#         return 6371000. * 2. * math.atan2(math.sqrt(a), math.sqrt(1. - a))
# 
# Path: gridsim/controller/simulation.py
# class AbstractControllerElement(AbstractSimulationElement):
# 
#     @accepts((1, str), (2, Position))
#     def __init__(self, friendly_name, position=Position()):
#         """
#         Base class of all element which can be part of a controller simulation.
# 
#         :param friendly_name: User friendly name to give to the element.
#         :type friendly_name: str, unicode
#         :param position: The position of the thermal element.
#             Defaults to [0,0,0].
#         :type position: :class:`Position`
#         """
#         super(AbstractControllerElement, self).__init__(friendly_name)
#         self.position = position


# Path: gridsim/controller/element/thermostat.py
from gridsim.unit import units
from gridsim.util import Position
from gridsim.controller.simulation import AbstractControllerElement

        :type: target_temperature: temperature see :mod:`gridsim.unit`

        :param: hysteresis: The +- hysteresis in order to avoid to fast on/off
            switching.
        :type: hysteresis: delta temperature see :mod:`gridsim.unit`

        :param: thermal_process: The reference to the thermal process to
            observe.
        :type: thermal_process: :class:`.ThermalProcess`

        :param: subject: Reference to the object of which is attribute has to be
            changed depending on the temperature.
        :type: object

        :param: attribute: The name of the attribute to control as string.
        :type: str

        :param: on_value: The value to set for the attribute in order to turn
            the device "on".
        :type: on_value: any

        :param: off_on_value: The value to set for the attribute in order to
            turn the device "off".
        :type: off_value: any

        :param position: The position of the thermal element.
            Defaults to [0,0,0].
        :type position: :class:`Position`
        """
        super(Thermostat, self).__init__(friendly_name, position)

        self.target_temperature = units.value(target_temperature, units.kelvin)
