At 1:12 PM +0100 5/3/08, Kevin Martin wrote:
I'm looking for a random distribution which allows me to generate enums with specified probabilities.
As a simple example I could have:
//The enum. typedef enum {vt_car, vt_bus, vt_walk, vt_cycle} vehicle_types;
//What I want to generate and the associated probabilities. boost::array
items = {vt_car, vt_bus, vt_walk, vt_cycle}; boost::array probabilities = {0.1, 0.2, 0.3, 0.4}
This should be pretty easy to write. I would be tempted to
pass in a "const boost::array < std::pair