| 866 | */ |
| 867 | |
| 868 | void generateSol2d( CBiteRnd& rnd ) |
| 869 | { |
| 870 | const CBitePop& OldPop = OldPops[ select( OldPopSel, rnd )]; |
| 871 | |
| 872 | if( OldPop.getCurPopPos() < 3 ) |
| 873 | { |
| 874 | generateSol2c( rnd ); |
| 875 | return; |
| 876 | } |
| 877 | |
| 878 | ptype* const Params = TmpParams; |
| 879 | |
| 880 | const ptype* const rp1 = getParamsOrdered( |
| 881 | rnd.getSqrInt( CurPopSize )); |
| 882 | |
| 883 | const ptype* const rp2 = getParamsOrdered( |
| 884 | rnd.getInt( CurPopSize )); |
| 885 | |
| 886 | const ptype* const rp3 = OldPop.getParamsOrdered( |
| 887 | rnd.getInt( OldPop.getCurPopPos() )); |
| 888 | |
| 889 | const int Mode = select( Gen2dModeSel, rnd ); |
| 890 | int i; |
| 891 | |
| 892 | if( Mode == 0 ) |
| 893 | { |
| 894 | for( i = 0; i < ParamCount; i++ ) |
| 895 | { |
| 896 | Params[ i ] = rp1[ i ] + (( rp2[ i ] - rp3[ i ]) >> 1 ); |
| 897 | } |
| 898 | } |
| 899 | else |
| 900 | { |
| 901 | const ptype* const rp1b = getParamsOrdered( |
| 902 | rnd.getSqrInt( CurPopSize )); |
| 903 | |
| 904 | for( i = 0; i < ParamCount; i++ ) |
| 905 | { |
| 906 | Params[ i ] = (( rp1[ i ] + rp1b[ i ]) + |
| 907 | ( rp2[ i ] - rp3[ i ])) >> 1; |
| 908 | } |
| 909 | } |
| 910 | } |
| 911 | |
| 912 | /** |
| 913 | * "Centroid mix with DE" solution generator, works well for convex |
nothing calls this directly
no test coverage detected