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

Method generateSol13

biteopt.h:1507–1541  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1505 */
1506
1507 void generateSol13( CBiteRnd& rnd )
1508 {
1509 ptype* const Params = TmpParams;
1510
1511 const CBitePop& ParPop = selectParPop( 7, rnd );
1512 const int ParPopSize = ParPop.getCurPopSize();
1513
1514 const ptype* const rp1 = getParamsOrdered(
1515 rnd.getSqrInt( CurPopSize ));
1516
1517 const int kc = 4;
1518 const ptype* rp2[ kc ];
1519 const ptype* rp3[ kc ];
1520 int i;
1521
1522 for( i = 0; i < kc; i++ )
1523 {
1524 rp2[ i ] = ParPop.getParamsOrdered(
1525 rnd.getLogInt( ParPopSize ));
1526
1527 rp3[ i ] = ParPop.getParamsOrdered( ParPopSize - 1 -
1528 rnd.getLogInt( ParPopSize ));
1529 }
1530
1531 for( i = 0; i < ParamCount; i++ )
1532 {
1533 const int j = rnd.getInt( ParamCount );
1534 const int k = rnd.getInt( kc );
1535
1536 Params[ i ] = (ptype) (( getRealValue( rp1, i ) +
1537 ( getRealValue( rp2[ k ], j ) -
1538 getRealValue( rp3[ k ], j )) * 0.5 - MinValues[ i ]) *
1539 DiffValuesI[ i ]);
1540 }
1541 }
1542
1543 /**
1544 * Solution generator that obtains solution from an independently-running

Callers

nothing calls this directly

Calls 5

getCurPopSizeMethod · 0.80
getSqrIntMethod · 0.80
getParamsOrderedMethod · 0.80
getLogIntMethod · 0.80
getIntMethod · 0.80

Tested by

no test coverage detected