Implementation

There are two methods in the problem class where you can implement constraints; they are as follows:

  • EnforceConstraints() allows you to make repairs to a candidate solution before its feasibility and fitness are evaluated. For example, when search-space boundaries are used as constraints then the repairing would consist of moving candidate solutions back between boundaries if they were overstepped. This is done by default.
  • Feasible() evaluates and returns the feasibility of a candidate solution without altering it.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset