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

Class MySolution

examples/so-init-solutions/example_so-init-solutions.cpp:16–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14*************************************************/
15
16struct MySolution
17{
18 std::vector<double> x;
19
20 MySolution()
21 {
22 // default constructor is a must
23 }
24
25 MySolution(std::vector<double> x):
26 x(x)
27 {
28 // initialize the solution with the given vector
29 }
30
31 std::string to_string() const
32 {
33 std::ostringstream out;
34 out<<"{";
35 for(unsigned long i=0;i<x.size();i++)
36 out<<(i?",":"")<<std::setprecision(10)<<x[i];
37 out<<"}";
38 return out.str();
39 }
40};
41
42struct MyMiddleCost
43{

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected