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

Method genInitParams

biteaux.h:2132–2193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2130 */
2131
2132 void genInitParams( CBiteRnd& rnd, ptype* const Params ) const
2133 {
2134 int i;
2135
2136 if( UseStartParams )
2137 {
2138 if( CurPopPos == 0 )
2139 {
2140 for( i = 0; i < ParamCount; i++ )
2141 {
2142 Params[ i ] = wrapParam( rnd, StartParams[ i ]);
2143 NewValues[ i ] = getRealValue( Params, i );
2144 }
2145 }
2146 else
2147 {
2148 if( (ptype) 0.25 == 0 )
2149 {
2150 for( i = 0; i < ParamCount; i++ )
2151 {
2152 Params[ i ] = wrapParam( rnd, getGaussianInt( rnd,
2153 StartSD, StartParams[ i ]));
2154
2155 NewValues[ i ] = getRealValue( Params, i );
2156 }
2157 }
2158 else
2159 {
2160 for( i = 0; i < ParamCount; i++ )
2161 {
2162 Params[ i ] = wrapParam( rnd, rnd.getGaussian() *
2163 StartSD + StartParams[ i ]);
2164
2165 NewValues[ i ] = getRealValue( Params, i );
2166 }
2167 }
2168 }
2169 }
2170 else
2171 {
2172 if( (ptype) 0.25 == 0 )
2173 {
2174 for( i = 0; i < ParamCount; i++ )
2175 {
2176 Params[ i ] = wrapParam( rnd, getGaussianInt( rnd,
2177 StartSD, IntMantMult >> 1 ));
2178
2179 NewValues[ i ] = getRealValue( Params, i );
2180 }
2181 }
2182 else
2183 {
2184 for( i = 0; i < ParamCount; i++ )
2185 {
2186 Params[ i ] = wrapParam( rnd, rnd.getGaussian() *
2187 StartSD + 0.5 );
2188
2189 NewValues[ i ] = getRealValue( Params, i );

Callers

nothing calls this directly

Calls 1

getGaussianMethod · 0.80

Tested by

no test coverage detected