mace::CandidateMap< Key, Data, HashFcn, EqualKey, Alloc > Class Template Reference
[Collections]

#include <CandidateMap.h>

Inheritance diagram for mace::CandidateMap< Key, Data, HashFcn, EqualKey, Alloc >:

Inheritance graph
[legend]
Collaboration diagram for mace::CandidateMap< Key, Data, HashFcn, EqualKey, Alloc >:

Collaboration graph
[legend]

List of all members.


Detailed Description

template<class Key, class Data, class HashFcn = __gnu_cxx::hash<Key>, class EqualKey = std::equal_to<Key>, class Alloc = std::allocator<Data>>
class mace::CandidateMap< Key, Data, HashFcn, EqualKey, Alloc >

Provides support for candidate sets as described in the AMMO/RanSub papers.

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

The documentation for this class was generated from the following file:

Generated on Sat Oct 4 21:30:36 2008 for Mace Library by  doxygen 1.5.5