IS YOUR OPTIMIZER CORRECT?
A verification harness for optimization code
Computational Labs | Michael Carter, Ph.D. | computationallabs.com


START HERE
    Open "How to Use check_optimizer.pdf". It explains everything, and it
    assumes no Python experience.


THE SHORT VERSION
    1. Keep all of these files in ONE FOLDER. This matters -- the harness is
       imported by name, so it has to sit beside whatever is using it.

    2. Open a terminal in this folder and run:

           python example_pso.py

       (On Mac or Linux, use python3 instead of python.)

       If you use Spyder, IDLE or VS Code, open the file and RUN THE WHOLE
       FILE -- F5 in Spyder and IDLE. Do not run a selection, and do not
       paste code into the console. Both change which folder Python searches
       and the import will fail.

    3. You will see two reports. The first is a particle swarm with one
       ordinary bug. The second is the same code with the bug fixed. Compare
       them -- note that the buggy version passes every PERFORMANCE check
       while being wrong.

    4. To test your own optimizer, see section 3 of the PDF. It is about
       five lines of glue code.


WHAT IS IN HERE
    README.txt                       this file
    How to Use check_optimizer.pdf   the full guide, 8 pages
    check_optimizer.py               the harness -- do not edit
    example_pso.py                   worked example, before and after


REQUIREMENTS
    Python 3.6 or newer. Nothing else. No packages to install, no internet
    connection needed.


LICENCE
    Free to use, modify, and share, including inside commercial work.
    Attribution appreciated but not required. Provided as-is, without
    warranty of any kind. (c) Michael Carter, Computational Labs.


    More free worked examples, hand calculations, a notation reference and
    an algorithm selection guide:  computationallabs.com/resources
