예제 #1
0
파일: robust.cpp 프로젝트: DinCahill/pagmo
robust::robust(const base & p, unsigned int trials, const double param_rho, unsigned int seed):
	base_stochastic((int)p.get_dimension(),
		 p.get_i_dimension(),
		 p.get_f_dimension(),
		 p.get_c_dimension(),
		 p.get_ic_dimension(),
		 p.get_c_tol(), seed),
	m_original_problem(p.clone()),
	m_normal_dist(0, 1),
	m_uniform_dist(0, 1),
	m_trials(trials),
	m_rho(param_rho)
{
	if(param_rho < 0){
		pagmo_throw(value_error, "Rho should be greater than 0");
	}
	set_bounds(p.get_lb(),p.get_ub());
}
예제 #2
0
noisy::noisy(const base & p, unsigned int trials, const double param_first, const double param_second, noise_type distribution, unsigned int seed):
	base_stochastic((int)p.get_dimension(),
		 p.get_i_dimension(),
		 p.get_f_dimension(),
		 p.get_c_dimension(),
		 p.get_ic_dimension(),
		 p.get_c_tol(), seed),
	m_original_problem(p.clone()),
	m_trials(trials),
	m_normal_dist(0.0,1.0),
	m_uniform_dist(0.0,1.0),
	m_decision_vector_hash(),
	m_param_first(param_first),
	m_param_second(param_second),
	m_noise_type(distribution)
{
	if(distribution == UNIFORM && param_first > param_second){
		pagmo_throw(value_error, "Bounds specified for the uniform noise are not valid.");
	}
	set_bounds(p.get_lb(),p.get_ub());
}