/*
 * FitPotentialAction.def
 *
 *  Created on: Apr 08, 2013
 *      Author: heber
 */

// all includes and forward declarations necessary for non-integral types below
#include <boost/filesystem/path.hpp>
#include <string>
#include <vector>

#include "Parameters/Validators/DummyValidator.hpp"
#include "Parameters/Validators/GenericValidators.hpp"
#include "Parameters/Validators/Ops_Validator.hpp"
#include "Parameters/Validators/RangeValidator.hpp"
#include "Parameters/Validators/STLVectorValidator.hpp"
#include "Parameters/Validators/Specific/ElementValidator.hpp"
#include "Parameters/Validators/Specific/EmptyStringValidator.hpp"
#include "Parameters/Validators/Specific/FileSuffixValidator.hpp"
#include "Parameters/Validators/Specific/FilePresentValidator.hpp"
#include "Parameters/Validators/Specific/FileSuffixValidator.hpp"
#include "Parameters/Validators/Specific/PotentialTypeValidator.hpp"

// i.e. there is an integer with variable name Z that can be found in
// ValueStorage by the token "Z" -> first column: int, Z, "Z"
// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
#define paramtypes (boost::filesystem::path)(boost::filesystem::path)(std::string)(std::vector<const element *>)(std::vector<const element *>)(unsigned int)(double)
#define paramtokens ("training-file")("potential-file")("potential-type")("potential-charges")("fragment-charges")("take-best-of")("set-threshold")
#define paramdescriptions ("optional file to write training data to")("optional potential file to wrote resulting potentials to")("potential type to fit")("charges specifying the potential")("charges specifying the fragment")("take the best among this many approximations")("Require L2 error to be smaller than threshold, overrides number of attempts")
#define paramdefaults (PARAM_DEFAULT(""))(PARAM_DEFAULT(""))(NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT(3))(PARAM_DEFAULT(1.))
#define paramreferences (training_file)(potential_file)(potentialtype)(charges)(fragment)(best_of_howmany)(threshold)
#define paramvalids \
(DummyValidator<boost::filesystem::path>()) \
(!FilePresentValidator() || FileSuffixValidator("potentials")) \
(PotentialTypeValidator()) \
(STLVectorValidator< std::vector<const element *> >(0,99, ElementValidator())) \
(STLVectorValidator< std::vector<const element *> >(1,99, ElementValidator())) \
(PositiveValidator<unsigned int>()) \
(PositiveValidator<double>())

#undef statetypes
#undef statereferences

// some defines for all the names, you may use ACTION, STATE and PARAMS
#define CATEGORY Potential
#define MENUNAME "potential"
#define MENUPOSITION 3
#define ACTIONNAME FitPotential
#define TOKEN "fit-potential"


// finally the information stored in the ActionTrait specialization
#define DESCRIPTION "fit an empirical potential to the given part of a specified fragment"
#undef SHORTFORM
