Skip to content

Commit 2c70744

Browse files
adding json tree output in visualization
1 parent 8c07dc3 commit 2c70744

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

examples/symb_reg/visualization.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

include/gpcxx/config_version.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#define GPCXX_VERSION_MAJOR 0
1616
#define GPCXX_VERSION_MINOR 2
17-
#define GPCXX_VERSION_PATCH 260
18-
#define GPCXX_VERSION_SHA1 g6bbf
17+
#define GPCXX_VERSION_PATCH 261
18+
#define GPCXX_VERSION_SHA1 g8c07
1919

2020
#endif // GPCXX_CONFIG_VERSION_HPP_DEFINED

0 commit comments

Comments
 (0)