#ifndef CLUSTER_NORMALIZED_CLASSIFIER_HH
# define CLUSTER_NORMALIZED_CLASSIFIER_HH

# include "NormalizedBase.hh"

/** @brief Normalized device classifier.
 *
 * This class implements a generic classifier that grab data fropm devices,
 * normalize it (using vn[i] = (v[i]-avg[i])/sd[i]) and then find the
 * closest cluster using the specified Metric.
 *
 * @note This class can be used "as this" to declare a new classifier. Indeed
 * the "mfox" classifier is declared as a NormalizedClassifier<ScalarMetric>
 *
 * @param Metric metric to use to compare vectors
 *
 * @author Frederic Py <fpy@mbari.org>
 */
template<class Metric>
class NormalizedClassifier: public NormalizedBase {
public:
  /** @brief Constructor
   * @param args parameters extracted from the configuration file
   *
   * Create the classifier loading the normalization parameters avg et
   * sd and the set of existing clusters
   */
  NormalizedClassifier(ArgList const &args)
    :NormalizedBase(args) {}
  /** @brief Destructor
   */
  virtual ~NormalizedClassifier() {}

private:
  Metric m_dist;

  virtual dist_type distance(StateVector const &a, StateVector const &b) const {
    return m_dist(a,b);
  }

}; // NormalizedClassifier<>

#endif // CLUSTER_NORMALIZED_CLASSIFIER_HH
