Beispiel #1
0
void tens_comp_string::initialize_best(void)
{
	std::vector<decision_vector> best_x;

	int x_dimension = 3;
	// He and Wang
	const double x_vector[] = {0.051728, 0.357644, 11.244543};

	decision_vector x(x_dimension);
	std::copy(x_vector,x_vector + x_dimension,x.begin());
	best_x.push_back(x);

	set_best_x(best_x);
}
Beispiel #2
0
void welded_beam::initialize_best(void)
{
	std::vector<decision_vector> best_x;

	int x_dimension = 4;
	// Coello and Montes
	const double x_vector[] = {0.202369, 3.544214, 9.048210, 0.205723};

	decision_vector x(x_dimension);
	std::copy(x_vector,x_vector + x_dimension,x.begin());
	best_x.push_back(x);

	set_best_x(best_x);
}
Beispiel #3
0
/**
 * Will construct an lavor_maculan problem with hydrocarbon chain of N atoms (N-3 parameters).
 *
 * @param[in] atoms number of atoms
 *
 * @see problem::base constructors.
 */
lavor_maculan::lavor_maculan(int atoms): base(atoms - 3)
{
	if (atoms <= 0 || atoms < 4) {
		pagmo_throw(value_error, "number of atoms for lavor-maculan problem must be positive and greater than 3");
	}
	// Set bounds.
	set_lb(0.0);
	set_ub(5.0);

	// Initialise global minima vector
	std::vector<decision_vector> best_x(1);
	// Single global minimum of Lavor Maculan is a repeating sequence of
	// (1.039195303, 3.141592654, 1.039195303, 3.141592654, 1.039195303, ...)
	double rep[] = {1.039195303, 3.141592654};
	for(int i = 0; i < atoms - 3; ++i) {
		best_x[0].push_back(rep[i % 2]);
	}

	set_best_x(best_x);
}