Skip to content

API Reference

The cilpy API is designed for extensibility. By implementing these core abstract classes, your custom components will integrate seamlessly with the library's ecosystem.

Problem API

The Problem interface is the standard for defining optimization problems. Any class that inherits from cilpy.problem.Problem can be passed to any cilpy solver.

Key Responsibilities:

  • Define the search space (dimensionality and bounds).
  • Implement the evaluate() method, which takes a candidate solution and returns its fitness and constraint violations.
  • Indicate whether the objectives and constraints of the problem are dynamic via the is_dynamic() method.

» View Full Problem API

Solver API

The Solver interface is the standard for implementing optimization algorithms. Any class that inherits from cilpy.solver.Solver can be used by the ExperimentRunner to solve any cilpy problem.

Key Responsibilities:

  • Accept a Problem object during initialization.
  • Implement the step() method, which executes a single iteration or generation of the algorithm.
  • Implement the get_result() method, which returns the best solution(s) found by the solver.

» View Full Solver API

Compare API

(This component is under development.)

The Compare interface will provide a standard for creating tools that analyze and visualize experiment results.

Key Responsibilities:

  • Process output data generated by the ExperimentRunner.
  • Perform statistical comparisons between solver performances.
  • Generate plots and tables to summarize results.

» View Full Compare API