nsga2
nsga2 copied to clipboard
Non-dominated Sort Genetic Algorithm II
NSGA-II Algorithm
Forked from wreszelewski/nsga2 but mostly rewritten.
Usage
cwd: Repository base.
Windows:
set PYTHONPATH=%PYTHONPATH%;%cd% && python examples
Unix:
$ export PYTHONPATH=${PYTHONPATH};$(pwd) && python examples
Changelist
The following changes have been made to the pre-fork repository:
- Compatible with > 3 objective problems.
- The original nsga2 repository was only compatible with 2-objective problems.
- Does not require the user to rescale
- The original nsga2 implementation relied on the decision vectors to be [0,1] but this implementation can take customized bounds.
- The previous implementation also required the objective space vectors to be standardized but this implementation abstracts over that.
- The visualizer can now visualize up to 3 dimensions(3 objectives)
- Removed the use of callback functions and used generators instead.
- NSGA2 now inherits from an
ioptimizerinterface which is compatible withiprobleminterfaces- This was in order to test multiple optimizers in a generic fashion.
- Python3 Compatible
- Certain uses of
sorted(cmp=)made the original repository incompatible with python3 but it now runs on python3 - Also, there is occasional use of type hinting especially around the public API
- Certain uses of
To Do
- Write test code, since debugging this was actually quite difficult.
- Remove the use of state and try to make the methods static methods.
- Matplotlib hangs