When many solutions are possible, an optimization process needs a way to judge which ones are promising. A fitness function provides that evaluation: it scores candidate solutions against the goals of the problem. In a genetic algorithm, fitness evaluation helps determine which candidates are selected to produce the next generation. section 2.5
Choosing delivery plans
Suppose a manufacturer needs to deliver products to retailers. Candidate plans vary in routes, resource allocation, and schedules. Evaluating each plan by delivery time, cost, and other relevant factors makes it possible to rank the candidates. Parts of stronger plans can then be combined through crossover—for example, a faster route from one plan with the resource allocation of another. Mutation introduces occasional random changes, and evaluation continues across generations until improvement stops or a set number of cycles is reached. section 2.5
The choice of what to measure matters: a plan can be fast without being inexpensive. The delivery example identifies criteria but does not prescribe a numerical formula or rule for balancing them. Related evaluation functions in smart-agent systems can measure progress toward a shared goal or an individual agent’s goal, and those functions may change over time. section 2.5 section 4.1





