Applying Termination Criteria to the Cargo Problem

Learn how you can apply the termination criteria to the cargo problem.

Deciding the best termination criteria

With three possible means of determining when to stop, we need to decide which one works best for the cargo problem. The simplest is to stop after a certain number of generations. Of course, we could use a temperature mechanism, but that’s too complicated for the task at hand.

For our problem, firstly, ensure the terminate? callback in the Problem module is set up to accept a generation argument. Additionally, ensure that the run and evolve functions are configured to track generations:

Get hands-on with 1200+ tech skills courses.