@@ -250,10 +250,10 @@ int main( int argc , char *argv[] )
250250
251251 // [ define_function_set
252252 auto unary_gen = gpcxx::make_uniform_symbol ( std::vector< node_type > {
253- node_type { gpcxx::sin_func {} , " s " } ,
254- node_type { gpcxx::cos_func {} , " c " } ,
255- node_type { gpcxx::exp_func {} , " e " } ,
256- node_type { gpcxx::log_func {} , " l " }
253+ node_type { gpcxx::sin_func {} , " sin " } ,
254+ node_type { gpcxx::cos_func {} , " cos " } ,
255+ node_type { gpcxx::exp_func {} , " exp " } ,
256+ node_type { gpcxx::log_func {} , " log " }
257257 } );
258258
259259 auto binary_gen = gpcxx::make_uniform_symbol ( std::vector< node_type > {
@@ -330,6 +330,9 @@ int main( int argc , char *argv[] )
330330 fitness[i] = fitness_f ( population[i] , c );
331331 }
332332
333+ std::ofstream json_out ( " example_tree.json" );
334+ json_out << gpcxx::json ( population[0 ] ) << std::endl;
335+
333336 std::cout << " Best individuals" << std::endl << gpcxx::best_individuals ( population , fitness ) << std::endl;
334337 std::cout << " Statistics : " << gpcxx::calc_population_statistics ( population ) << std::endl;
335338 std::cout << std::endl << std::endl;
0 commit comments