#include <CandidateMap.h>
This is a Mace-specific collection type derived from mace::hash_map<>.
A CandidateMap has functions for generating a population which is a uniformly random subset of a larger population. It does this by compacting with other candidate maps, and using the size of the population represented by each one to weigh in randomly to determine how likely it is to retain a member of a given populaiton. The result is that a properly constructed CandidateMap should be a uniformly random subset of the populations of all maps compacted with it.
Definition at line 72 of file CandidateMap.h.
Public Types | |
typedef mace::hash_map< Key, Data, SerializeMap< Key, Data > , HashFcn, EqualKey, Alloc > | base_hash_map |
type of the map derived from (to actually implement functionality) | |
Public Member Functions | |
virtual void | setMaxSize (size_t size) |
the maximum number of candidates allowed in the map | |
void | reset () |
reset the population size represented to 0 | |
size_t | aggregateCount () |
returns the population size represented by the map | |
void | compact (CandidateMap< Key, Data, HashFcn, EqualKey, Alloc > cs) |
combine elements of cs into this map, keeping a weighted random subset of them both |