//Compute the cost of each member in Population
void MBO_Object::CostFunction(vector<Agent>& ag)
{
	for (int i = 0; i < Popsize; ++i)
	{
		ag.at(i).fit = get_fit(ag.at(i).pos);
	}
}
Esempio n. 2
0
int get_fit_py(int len1, double *array, int len2, double *f, int len3, double *fit_array) {
  // A swig compatible wrapper for get_fit
  
  // Check that len1, len2, and len3 are all equal.
  if ((len1 != len2) || (len1 != len3)){ 
    return 1;
  }
  if (len1%NUM_PIECES != 0) {
    return 1;
  }
  
  get_fit(len1, array, f, fit_array);
  return 0;
}