00001 00011 #ifndef RATIOBASEDFAMILIES_H 00012 #define RATIOBASEDFAMILIES_H 00013 00014 #include "Point3DSet.h" 00015 #include "SimNetwork.h" 00016 00017 #include "SpatialFamilyIDGenerator.h" 00018 #include "RandomDistribution.h" 00019 00021 00026 class RatioBasedFamilies : public SpatialFamilyIDGenerator { 00027 public: 00028 00030 RatioBasedFamilies( vector<double> const& ratios ); 00031 00033 virtual shared_ptr< vector<familyid_t> > generateIDs( SimNetwork &net, vector<SimObjectFactory *> const& families, Point3DSet const& locs ) const; 00034 00035 private: 00036 00038 vector<double> probabilities; 00039 00041 vector<double> cumsum; 00042 00044 static UniformDistribution prob_zero_one; 00045 00046 }; 00047 00048 #endif