#ifndef CPARAMS_H #define CPARAMS_H #include /** @author Antoine Rozenknop */ #include using std::string ; class CParams{ public: CParams() {} CParams( int nbargs, char * args[] ); ~CParams(); enum type_de_limite { TIME_LIMIT, PASS_LIMIT }; /** * Y a-t-il une instance à traiter ? * @return true/false */ bool hasInstance() const { return m_instance_given; } /** * Doit-on produire un analyse des données à des fins * d'observation ? * @return true/false */ bool analyse() const { return !m_optimize and m_instance_given; } /** * Doit-on résoudre le problème ? * @return true/false */ bool optimize() const { return m_optimize and m_instance_given; } /** * nom de l'instance passée en paramètres */ string getInstanceName() const { return m_instance_name; } /** * heure de début */ time_t getTimeStart() const { return s_time_start; } /** * temps imparti */ time_t getTimeLimit() const { return m_time_limit; } /** * deadline */ time_t getDeadline() const { return m_time_limit + s_time_start; } /** * stratégie d'optimisation */ strategies_t getStrategie() const { return m_strategie; } /** * méthode de calcul des variables duales sélectionnée */ duals_t getDualMethod() const { return m_dualmethod; } /** * sélecteur de colonnes choisi */ selecteur_t getSelecteur() const { return m_selecteur; } /** * filtre aval sélectionné */ filtreaval_t getFiltreAval() const { return m_filtreaval; } /** * rejet des plans existants */ bool getRejetPlansExistants() { return m_rejet_existants; } /** * rejet des plans à coût réduit positif */ bool getRejetCoutsReduitsPositifs() { return m_rejet_cr_positif; } /** * nom du fichier d'output */ string getSolutionName() const { return m_solution_name; } /** * type de limite (temps ou nombre de passes) */ type_de_limite getLimitType() const { return m_limit_type; } /** * limitation en nombre de passes */ size_t getPassLimit() const { return m_pass_limit; } /** * affichage du team_id demandé ? */ bool onDoitAfficherLeTeamId() { return m_affiche_id; } /** * multithread ? */ bool multithreaded() { return m_multithread; } private: bool m_multithread ; bool m_instance_given ; bool m_solution_given ; bool m_optimize ; strategies_t m_strategie ; duals_t m_dualmethod ; selecteur_t m_selecteur ; filtreaval_t m_filtreaval ; bool m_rejet_existants ; bool m_rejet_cr_positif ; type_de_limite m_limit_type ; size_t m_pass_limit ; time_t m_time_limit ; string m_instance_name ; string m_solution_name ; bool m_affiche_id ; static time_t s_time_start ; }; #endif