# coding: utf-8

"""
    Amber API Server

    Boon Logic Amber API server

    OpenAPI spec version: 2.0.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

class AnalyticResults(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """
    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
        'ad': 'list[int]',
        'ah': 'list[int]',
        'aw': 'list[int]',
        'id': 'list[int]',
        'ni': 'list[int]',
        'ns': 'list[int]',
        'nw': 'list[float]',
        'om': 'list[float]',
        'ri': 'list[int]',
        'si': 'list[int]'
    }

    attribute_map = {
        'ad': 'AD',
        'ah': 'AH',
        'aw': 'AW',
        'id': 'ID',
        'ni': 'NI',
        'ns': 'NS',
        'nw': 'NW',
        'om': 'OM',
        'ri': 'RI',
        'si': 'SI'
    }

    def __init__(self, ad=None, ah=None, aw=None, id=None, ni=None, ns=None, nw=None, om=None, ri=None, si=None):
        """AnalyticResults - a model defined in Swagger"""
        self._ad = None
        self._ah = None
        self._aw = None
        self._id = None
        self._ni = None
        self._ns = None
        self._nw = None
        self._om = None
        self._ri = None
        self._si = None
        self.discriminator = None
        if ad is not None:
            self.ad = ad
        if ah is not None:
            self.ah = ah
        if aw is not None:
            self.aw = aw
        if id is not None:
            self.id = id
        if ni is not None:
            self.ni = ni
        if ns is not None:
            self.ns = ns
        if nw is not None:
            self.nw = nw
        if om is not None:
            self.om = om
        if ri is not None:
            self.ri = ri
        if si is not None:
            self.si = si

    @property
    def ad(self):
        """Gets the ad of this AnalyticResults.

        A binary array where 1 means a pattern was anomalous and 0 means normal. This value is derived by thresholding the `anomalyIndex`.

        :return: The ad of this AnalyticResults.
        :rtype: list[int]
        """
        return self._ad

    @ad.setter
    def ad(self, ad):
        """Sets the ad of this AnalyticResults.

        A binary array where 1 means a pattern was anomalous and 0 means normal. This value is derived by thresholding the `anomalyIndex`.

        :param ad: The ad of this AnalyticResults.
        :type: list[int]
        """

        self._ad = ad

    @property
    def ah(self):
        """Gets the ah of this AnalyticResults.

        The number of anomalous patterns in the last `historyWindow` samples. Specifically, this is a moving-window sum of the `anomalyDetection` array with window length `historyWindow`.

        :return: The ah of this AnalyticResults.
        :rtype: list[int]
        """
        return self._ah

    @ah.setter
    def ah(self, ah):
        """Sets the ah of this AnalyticResults.

        The number of anomalous patterns in the last `historyWindow` samples. Specifically, this is a moving-window sum of the `anomalyDetection` array with window length `historyWindow`.

        :param ah: The ah of this AnalyticResults.
        :type: list[int]
        """

        self._ah = ah

    @property
    def aw(self):
        """Gets the aw of this AnalyticResults.

        Amber warning level at each sample, a measure of the compliance of recent behavior compared to behavior observed during `Learning`. This value is derived from `recentAnomalies` and a statistical model of expectations about the usual frequency of anomalies. - `0`: OK - `1`: asset changing - `2`: asset critical

        :return: The aw of this AnalyticResults.
        :rtype: list[int]
        """
        return self._aw

    @aw.setter
    def aw(self, aw):
        """Sets the aw of this AnalyticResults.

        Amber warning level at each sample, a measure of the compliance of recent behavior compared to behavior observed during `Learning`. This value is derived from `recentAnomalies` and a statistical model of expectations about the usual frequency of anomalies. - `0`: OK - `1`: asset changing - `2`: asset critical

        :param aw: The aw of this AnalyticResults.
        :type: list[int]
        """

        self._aw = aw

    @property
    def id(self):
        """Gets the id of this AnalyticResults.

        The cluster to which each input pattern was assigned. The first pattern is assigned a `clusterId` of 1. Each pattern thereafter is either assigned to an existing cluster (if its distance from that cluster is less than `percentVariation`) or creates a new cluster (if its distance from all clusters exceeds `percentVariation`). The `clusterId` for each new cluster is the current maximum `clusterId` plus one. For example, a model with 10 clusters will have `clusterIds` 1-10, and the next new cluster will have `clusterId` 11.  During `Monitoring`, the cluster model becomes frozen and no new clusters are formed. Patterns which cannot be assigned to any existing cluster will return a negative `clusterId`. These `clusterIds` start at -1 and decreasing strictly by 1 without repeating (they can be used for root cause analysis).

        :return: The id of this AnalyticResults.
        :rtype: list[int]
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this AnalyticResults.

        The cluster to which each input pattern was assigned. The first pattern is assigned a `clusterId` of 1. Each pattern thereafter is either assigned to an existing cluster (if its distance from that cluster is less than `percentVariation`) or creates a new cluster (if its distance from all clusters exceeds `percentVariation`). The `clusterId` for each new cluster is the current maximum `clusterId` plus one. For example, a model with 10 clusters will have `clusterIds` 1-10, and the next new cluster will have `clusterId` 11.  During `Monitoring`, the cluster model becomes frozen and no new clusters are formed. Patterns which cannot be assigned to any existing cluster will return a negative `clusterId`. These `clusterIds` start at -1 and decreasing strictly by 1 without repeating (they can be used for root cause analysis).

        :param id: The id of this AnalyticResults.
        :type: list[int]
        """

        self._id = id

    @property
    def ni(self):
        """Gets the ni of this AnalyticResults.

        See Boon Docs.

        :return: The ni of this AnalyticResults.
        :rtype: list[int]
        """
        return self._ni

    @ni.setter
    def ni(self, ni):
        """Sets the ni of this AnalyticResults.

        See Boon Docs.

        :param ni: The ni of this AnalyticResults.
        :type: list[int]
        """

        self._ni = ni

    @property
    def ns(self):
        """Gets the ns of this AnalyticResults.

        See Boon Docs.

        :return: The ns of this AnalyticResults.
        :rtype: list[int]
        """
        return self._ns

    @ns.setter
    def ns(self, ns):
        """Sets the ns of this AnalyticResults.

        See Boon Docs.

        :param ns: The ns of this AnalyticResults.
        :type: list[int]
        """

        self._ns = ns

    @property
    def nw(self):
        """Gets the nw of this AnalyticResults.

        See Boon Docs.

        :return: The nw of this AnalyticResults.
        :rtype: list[float]
        """
        return self._nw

    @nw.setter
    def nw(self, nw):
        """Sets the nw of this AnalyticResults.

        See Boon Docs.

        :param nw: The nw of this AnalyticResults.
        :type: list[float]
        """

        self._nw = nw

    @property
    def om(self):
        """Gets the om of this AnalyticResults.

        See Boon Docs.

        :return: The om of this AnalyticResults.
        :rtype: list[float]
        """
        return self._om

    @om.setter
    def om(self, om):
        """Sets the om of this AnalyticResults.

        See Boon Docs.

        :param om: The om of this AnalyticResults.
        :type: list[float]
        """

        self._om = om

    @property
    def ri(self):
        """Gets the ri of this AnalyticResults.

        An integer between 0 and 1000 giving a measure of how anomalous this pattern is compared to patterns seen in the past. Values closer to 0 represent patterns which are ordinary given the data seen so far on this model, while values closer to 1000 represent anomalous patterns. Patterns with a high `anomalyIndex` belong to clusters with relatively few patterns compared to the other clusters.

        :return: The ri of this AnalyticResults.
        :rtype: list[int]
        """
        return self._ri

    @ri.setter
    def ri(self, ri):
        """Sets the ri of this AnalyticResults.

        An integer between 0 and 1000 giving a measure of how anomalous this pattern is compared to patterns seen in the past. Values closer to 0 represent patterns which are ordinary given the data seen so far on this model, while values closer to 1000 represent anomalous patterns. Patterns with a high `anomalyIndex` belong to clusters with relatively few patterns compared to the other clusters.

        :param ri: The ri of this AnalyticResults.
        :type: list[int]
        """

        self._ri = ri

    @property
    def si(self):
        """Gets the si of this AnalyticResults.

        Exponentially smoothed `anomalyIndex` over the last 15 samples. The range remains between 0 and 1000.

        :return: The si of this AnalyticResults.
        :rtype: list[int]
        """
        return self._si

    @si.setter
    def si(self, si):
        """Sets the si of this AnalyticResults.

        Exponentially smoothed `anomalyIndex` over the last 15 samples. The range remains between 0 and 1000.

        :param si: The si of this AnalyticResults.
        :type: list[int]
        """

        self._si = si

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value
        if issubclass(AnalyticResults, dict):
            for key, value in self.items():
                result[key] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, AnalyticResults):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        return not self == other
