MCPcopy Create free account
hub / github.com/avaneev/biteopt / main

Function main

example.cpp:43–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41};
42
43int main()
44{
45 CBiteRnd rnd;
46 rnd.init( 1 ); // Needs to be seeded with different values on each run.
47
48 CTestOpt opt;
49 opt.init( rnd );
50
51 int i;
52
53 for( i = 0; i < 10000; i++ )
54 {
55 opt.optimize( rnd );
56
57 if( opt.getBestCost() < 0.000001 )
58 {
59 break;
60 }
61 }
62
63 printf( "IterCount: %i\n", i );
64 printf( "BestCost: %f\n", opt.getBestCost() );
65 printf( "%f ", opt.getBestParams()[ 0 ]);
66 printf( "%f\n", opt.getBestParams()[ 1 ]);
67
68 return( 0 );
69}

Callers

nothing calls this directly

Calls 4

initMethod · 0.45
optimizeMethod · 0.45
getBestCostMethod · 0.45
getBestParamsMethod · 0.45

Tested by

no test coverage detected