本文整理汇总了C++中Keymap::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ Keymap::Get方法的具体用法?C++ Keymap::Get怎么用?C++ Keymap::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Keymap
的用法示例。
在下文中一共展示了Keymap::Get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fillPartialPayoffs
void Landscape::fillPartialPayoffs( int kTotal )
/* fills the "payoffs" vector, which is all the individual choices' fitness levels */
{
// cout << "fillPartialPayoffs called..." << endl;
double randomTemp = 0;
string configuration;
unsigned short int ii = 0, jj = 0;
for ( ii = 0 ; ii < itsN ; ii++ ){
payoffs.push_back( vector < Payoff >() ); // adds an empty vector
for ( jj = 0 ; jj < pow(2,kTotal+1) ; jj++ )
{
configuration = key.Get(ii, jj); // gets the key corresponding to d_ii, for configuration jj
randomTemp = (double)rand() / ((double)(RAND_MAX)+(double)(1)); // random float bewteen 0 and 1
payoffs[ii].push_back(Payoff(configuration, randomTemp)); // filling the map with keys from 0 to n^(k+1), and values [0,1]l;
// cout << "payoffs[" << ii << "][" << jj << "]: " << configuration << "," << randomTemp << ":" << payoffs[ii][jj].GetFitness() << endl;
}
}
// cout << "fillPartialPayoffs finished..." << endl;
}