00001 00011 #ifndef EUCLIDEANDISTANCERANDOMCONNECTIONS_H 00012 #define EUCLIDEANDISTANCERANDOMCONNECTIONS_H 00013 00014 #include <ConnectionIterator.h> 00015 #include "SpatialSimObjectPopulation.h" 00016 00018 00024 class EuclideanDistanceRandomConnections : public ConnectionIterator { 00025 00026 public: 00027 00029 EuclideanDistanceRandomConnections( const double C, const double lambda); 00030 00032 EuclideanDistanceRandomConnections( const double C, const double lambda, MPI::Intracomm const& mpiComm ); 00033 00034 virtual ~EuclideanDistanceRandomConnections() {}; 00035 00036 virtual void init(const SimObjectPopulation &srcPopulation, const SimObjectPopulation &destPopulation); 00037 00038 virtual void reset(SimObject::ID::SortedVector::const_iterator src_begin_it, 00039 SimObject::ID::SortedVector::const_iterator src_end_it, 00040 SimObject::ID::SortedVector::const_iterator dest_begin_it, 00041 SimObject::ID::SortedVector::const_iterator dest_end_it); 00042 00043 virtual bool next( pair<SimObject::ID, SimObject::ID> &connection ); 00044 00045 private: 00046 const SpatialSimObjectPopulation * src_popul; 00047 const SpatialSimObjectPopulation * dst_popul; 00048 double maxConnProb; 00049 double lambda; 00050 UniformDistribution unirnd; 00051 00052 int curr_src_idx; 00053 int curr_dst_idx; 00054 00055 int max_src_idx; 00056 int max_dst_idx; 00057 00058 SimObject::ID::SortedVector::const_iterator src_begin_it; 00059 SimObject::ID::SortedVector::const_iterator dst_begin_it; 00060 00061 }; 00062 00063 #endif