Professional Documents
Culture Documents
Asdf
Asdf
Program execution
begins and ends there.
//
using std::vector;
using std::cin;
using std::cout;
using std::endl;
*/
// this should be edited by user
//-----------------------------------------------------------------------------
-
double F = factor.at(0);
double DC = factor.at(1);
double PO = factor.at(2);
double N = factor.at(3);
double GS = factor.at(4);
double output;
//-----------------------------------------------------------------------------
-
return output;
}
double initializedelement{};
srand((unsigned)time(NULL)); // seeding the random numbers
cout << "The Randomly initialized matrix is given as follows: \n\n";
cout << "The procedure followed in obtaining the first variable in the first
hawk of the population is shown below\n";
return randommatrix;
}
// This objective function is the function used for the particular output parameter
that is being optimized and should be edited to suit
cout << "Obtaining the energy E of the prey...The required values are as
follows" << endl;
cout << "Eo = " << initial_energy << " - t = 0 (first iteration) - T (Maximum
Iteration) = " << maxIter << endl;
cout << "E = " << E << endl;
return E;
}
float getRandomFloat(int x) {
// Seed the random number generator
std::srand(static_cast<unsigned int>(x));
return randomFloat;
}
int main()
{
cout << "\t\t\t\tHARRIS HAWK OPTIMIZATION ALGORITHM\n\n";
vector<vector<double>> factorBoundaries;
factorBoundaries = { {5.0, 20.0}, {4.5, 6.0}, {60.0, 90.0}, {3.0, 6.0}, {15.0,
30.0} };
vector<vector<double>> Population = randomInitializer(factorBoundaries,
population);
//Displaying the values and the steps for the first hawk
cout << endl << endl;
cout << "Initializing the values of Eo & J for the first wolf\n";
cout << "Eo = 2rand() - 1\n";
cout << "random number (between 0 & 1) = " << randomNumberE <<
endl;
cout << "Eo = 2*" << randomNumberE << " -1 = " << Eo << endl;
currentIter++;
}
}