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

Method optimize

biteopt.h:189–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187 */
188
189 int optimize( CBiteRnd& rnd, CBiteOpt* const PushOpt = NULL )
190 {
191 int i;
192
193 if( DoInitEvals )
194 {
195 ptype* const Params = getCurParams();
196
197 genInitParams( rnd, Params );
198
199 NewCosts[ 0 ] = fixCostNaN( optcost( NewValues ));
200 updateBestCost( NewCosts[ 0 ], NewValues,
201 updatePop( NewCosts[ 0 ], Params ));
202
203 if( CurPopPos == PopSize )
204 {
205 updateCentroid();
206
207 for( i = 0; i < ParPopCount; i++ )
208 {
209 ParPops[ i ] -> copy( *this );
210 }
211
212 DoInitEvals = false;
213 }
214
215 return( 0 );
216 }
217
218 DoEval = true;
219
220 const int SelMethod = select( MethodSel, rnd );
221
222 if( SelMethod == 0 )
223 {
224 generateSol2( rnd );
225 }
226 else
227 if( SelMethod == 1 )
228 {
229 const int SelM1 = select( M1Sel, rnd );
230
231 if( SelM1 == 0 )
232 {
233 const int SelM1A = select( M1ASel, rnd );
234
235 if( SelM1A == 0 )
236 {
237 generateSol2b( rnd );
238 }
239 else
240 if( SelM1A == 1 )
241 {
242 generateSol2c( rnd );
243 }
244 else
245 {
246 generateSol2d( rnd );

Callers 3

generateSolParMethod · 0.45
optimizeMethod · 0.45
biteopt_minimizeFunction · 0.45

Calls 4

getMethod · 0.80
updatePopMethod · 0.80
updateParPopMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected