Research Article

Optimal Crop Selection Using Gravitational Search Algorithm

Algorithm 1

Gravitational search algorithm.
parameters initialization
set the initial values of gravitational constant Go,
Set the initial iteration
Initial population
For
Generate in initial population randomly, where
End for
Repeat
solution and evaluation
Evaluate the fitness function for each in the population
Assign the best worst agent in the population
Solutions update
Update the gravitational constant G
For Calculate the force acting on agent i from agent j
End for
Compute the total forces that acts on agent i,
Compute the inertial mass Mi.
Compute the acceleration of agent I
Update the velocity of the agent i
Update the position of agent I
End for
Set
until termination criteria are satisfied
produce the best solution
Return the best solution