Folder
First: Add the header file of the code you wrote in the Optimizer folder: Optimizer.h file #include <otl/optimizer/reference-nsga-ii/reference-nsga-ii.h >
Second place: Add code to the Switch.h file, and format it to mimic the contents of the file #define Export_reference_nsga_ii
The third place: Because our general code is encoded in real form, so modify the contents of the file Optimizer.h file under Optimizer.real, the format mimics the contents of the file typedef otl::optimizer::reference_nsga_ Ii::reference_nsga_ii<treal, Tdecision, Trandom &> Treference_nsga_ii;, and then add write implementation The function just in the Optimizer.h file is in the Optimizer.cpp, note here, if it is to get a quote worthy of the words, need this. def ("Getcrossover", &treference_nsga_ii:: Getcrossover, Boost::p ython::return_value_policy<boost::p ython::reference_existing_object> ()), if only a worthy word is obtained, You do not need boost::p ython::return_value_policy<boost::p ython::reference_existing_object> ()
This completes the setup of Pyotl (as a bridge between C + + and Python).
To modify the contents of the Pyoptimization:
First: Locate the optimizer folder under __init__.py, and then modify the format to mimic the pattern in its file. One is the _MAKE_XXX function and one is the MAKE_XXX function.
Second, if you need to run the code, select the outermost optimization.py, if the code is correct, C + + and Python bridge succeeds, the resulting data will be saved in the path of database under the documents file, and the path of the databases is modified by itself. If you need to modify a running parameter, modify it in the Optimization.ini file and modify the configuration in Evalution.ini if it is a review. If you need to see it, you can click Visualize.py to run it and you can see it.
Finally, if you need to evaluate, after running evalution.py, the database file (the system by default is under the documents file) in the use of the Sqliteman tool to view
310 Lab OTL Problems----Convert a well-written C + + file into a Python file and visualize the data