All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RouletteWheelSelector.h
1 // Copyright (c) 2014 eeGeo. All rights reserved.
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Random.h"
7 
8 #include <vector>
9 
10 namespace Eegeo
11 {
12  namespace Helpers
13  {
20  {
21  public:
22  static RouletteWheelSelector* CreateWithFitnessValues(const std::vector<float>& fitness);
23  void UpdateFitnessValues(const std::vector<float>& fitness);
24  size_t SelectItemIndex(Random& rand) const;
25  private:
27  std::vector<float> m_cumulativeFitness;
28  };
29  }
30 }