コード例 #1
0
void configuration_parser::compiler_parser(const pugi::xml_node& doc)
{
   results.push_back(configuration_file());
   for(auto& node : doc)
   {
      state_machine[node.name()](node);
   }
}
コード例 #2
0
external_configuration_file::external_configuration_file(char const *filename):
												__filename(filename),
												__diversify(0),
												__intensify(0),
												__reduce(0),
												__SS(0.0),
												__SSRF(0.0),
												__save_step(0),
												__n_sample(0),
												__nVar(0),
												__nObj(0),
												__LL(0),
												__EL(0),
												__IL(0), // available values HV / HB
												__nRegions(0),
												__STM_size(0),
												__assessment(""),
												__logtype(""), // available values full/quick
												__starting_point(0.0),
												__maximum_improvements(0),
												__maximum_duplicates(0)
{

	std::cout << "external configuration file ...";
	if( FileExists(filename) )
		std::cout << " OK!"<< std::endl;
	else{
		std::cout << "NOT FOUND!!!" << std::endl;
		exit(-1000);
	}

	std::ifstream configuration_file(filename);

	if(   configuration_file.is_open() ){

		std::cout << "configuration file found! " << std::endl;

		std::cout << std::endl << "Tabu Search Options" << std::endl;
		configuration_file >> __diversify; //1
		std::cout << " 1.diversify " << __diversify << std::endl;

		configuration_file >> __intensify; //2
		std::cout << " 2.intensify " <<  __intensify<< std::endl;

		configuration_file >> __reduce ; //3
		std::cout << " 3.reduce " <<  __reduce<< std::endl;

		configuration_file >> __SS ; //4
		std::cout << " 4.SS " <<  __SS<< std::endl;
		if( __SS==0 )
			std::cout << "\t Start step(s) is assigned by user in start_step.txt file!" << std::endl;
		else
			std::cout << "\t Start step(s) (" << __SS <<")  is uniform for all variables" << std::endl;

		configuration_file >> __SSRF ; //5
		std::cout << " 5.SSRF " <<  __SSRF<< std::endl;

		configuration_file >> __save_step ; //6
		std::cout << " 6.save_step " <<  __save_step<< std::endl;

		configuration_file >> __n_sample ; //7
		std::cout << " 7.n_sample " <<  __n_sample<< std::endl;

		configuration_file >> __nVar ; //8
		std::cout << " 8.nVar " <<  __nVar<< std::endl;

		configuration_file >> __nObj ; //9
		std::cout << " 9.nObj " <<  __nObj<< std::endl;

		configuration_file >> __LL ; //10
		std::cout << " 10.n_of_loops " <<  __LL<< std::endl;

		configuration_file >> __EL ; //11
		std::cout << " 11.n_of_evaluations " <<  __EL<< std::endl;

		configuration_file >> __IL ; //12  : available values HV / HB
		std::cout << " 12.n_of_consecutive_improvements " <<  __IL<< std::endl;

		configuration_file >> __assessment ; //13
		std::cout << " 13.assessment " <<  __assessment<< std::endl;

		configuration_file >> __nRegions ; //14
		std::cout << " 14.nRegions " <<  __nRegions<< std::endl;

		configuration_file >> __STM_size ; //15
		std::cout << " 15.STM_size " <<  __STM_size<< std::endl;

		configuration_file >> __logtype ; //16 -  available values full/quick
		std::cout << " 16.LogType " <<  __logtype<< std::endl;

		configuration_file >> __starting_point ; //17
		std::cout << " 17.Starting point " <<  __starting_point << std::endl;
		if( __starting_point==0)
			std::cout << "\t Starting point is assigned randomly!" << std::endl;
		else
			std::cout << "\t Starting point is by user from the file datum_design_vector.txt" << std::endl;
		if(-1<__starting_point && __starting_point<0){
			std::cout << "\t\tInitial sampling was activated, too!" << std::endl;
		}

		configuration_file >> __maximum_improvements;
		std::cout << " 18.maximum_improvements " <<  __maximum_improvements<< std::endl;

		configuration_file >> __maximum_duplicates;
		std::cout << " 19.maximum_duplicates " <<  __maximum_duplicates<< std::endl;


		configuration_file.close();
		std::cout << "configuration file read! " << std::endl;
	}else{