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

Method generateSol7

biteopt.h:1209–1244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1207 */
1208
1209 void generateSol7( CBiteRnd& rnd )
1210 {
1211 ptype* const Params = TmpParams;
1212
1213 const CBitePop& OldPop = OldPops[ 1 ];
1214 const int OldPopPos = OldPop.getCurPopPos();
1215
1216 static const double p[ 4 ] = { 1.5, 1.75, 2.0, 2.25 };
1217 const double pwr = p[ select( Gen7PowFacSel, rnd )];
1218 int i;
1219
1220 if( OldPopPos < 3 )
1221 {
1222 for( i = 0; i < ParamCount; i++ )
1223 {
1224 Params[ i ] = getParamsOrdered(
1225 rnd.getPowInt( pwr, CurPopSize ))[ i ];
1226 }
1227 }
1228 else
1229 {
1230 for( i = 0; i < ParamCount; i++ )
1231 {
1232 if( rnd.getBit() && rnd.getBit() )
1233 {
1234 Params[ i ] = OldPop.getParamsOrdered(
1235 rnd.getPowInt( pwr, OldPopPos ))[ i ];
1236 }
1237 else
1238 {
1239 Params[ i ] = getParamsOrdered(
1240 rnd.getPowInt( pwr, CurPopSize ))[ i ];
1241 }
1242 }
1243 }
1244 }
1245
1246 /**
1247 * Solution generator that is DE-alike in its base. It calculates a

Callers

nothing calls this directly

Calls 4

getCurPopPosMethod · 0.80
getPowIntMethod · 0.80
getBitMethod · 0.80
getParamsOrderedMethod · 0.80

Tested by

no test coverage detected