MCPcopy Create free account
hub / github.com/Arash-codedev/openGA / SO_report_generation

Function SO_report_generation

examples/so-1/example_so1.cpp:104–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102std::ofstream output_file;
103
104void SO_report_generation(
105 int generation_number,
106 const EA::GenerationType<MySolution,MyMiddleCost> &last_generation,
107 const MySolution& best_genes)
108{
109 std::cout
110 <<"Generation ["<<generation_number<<"], "
111 <<"Best="<<last_generation.best_total_cost<<", "
112 <<"Average="<<last_generation.average_cost<<", "
113 <<"Best genes=("<<best_genes.to_string()<<")"<<", "
114 <<"Exe_time="<<last_generation.exe_time
115 <<std::endl;
116
117 output_file
118 <<generation_number<<"\t"
119 <<best_genes.x<<"\t"
120 <<best_genes.y<<"\t"
121 <<last_generation.average_cost<<"\t"
122 <<last_generation.best_total_cost<<"\n";
123}
124
125int main()
126{

Callers 1

report_generationMethod · 0.50

Calls 1

to_stringMethod · 0.45

Tested by

no test coverage detected