// Autogenerated by tools\build\make_containers.py
// from tools\build\container_templates\container\MinimumClassnameScore.h
// Do not edit - any changes will be lost!

/**
 *  \file IMP/container/MinimumSingletonScore.h
 *  \brief Define SingletonScore.
 *
 *  Copyright 2007-2021 IMP Inventors. All rights reserved.
 */

#ifndef IMPCONTAINER_MINIMUM_SINGLETON_SCORE_H
#define IMPCONTAINER_MINIMUM_SINGLETON_SCORE_H

#include <IMP/container/container_config.h>
#include <IMP/SingletonScore.h>
#include <IMP/singleton_macros.h>

IMPCONTAINER_BEGIN_NAMESPACE

//! Evaluate the min or max n particle scores of the passed set
/** Each of the set of SingletonScores is evaluated and the sum of the
    minimum n is returned.
*/
class IMPCONTAINEREXPORT MinimumSingletonScore : public SingletonScore {
  SingletonScores scores_;
  unsigned int n_;

 public:
  MinimumSingletonScore(const SingletonScoresTemp &scores, unsigned int n = 1,
                        std::string name = "SingletonScore %1%");
  virtual double evaluate_index(Model *m, ParticleIndex vt,
                                DerivativeAccumulator *da) const IMP_OVERRIDE;
  virtual ModelObjectsTemp do_get_inputs(
      Model *m, const ParticleIndexes &pis) const IMP_OVERRIDE;
  IMP_SINGLETON_SCORE_METHODS(MinimumSingletonScore);
  IMP_OBJECT_METHODS(MinimumSingletonScore);

  Restraints do_create_current_decomposition(Model *m,
                                             ParticleIndex vt) const
      IMP_OVERRIDE;
};

IMP_OBJECTS(MinimumSingletonScore, MinimumSingletonScores);

IMPCONTAINER_END_NAMESPACE

#endif /* IMPCONTAINER_MINIMUM_SINGLETON_SCORE_H */
