ConnectionIterator Class Reference

Interface for iterating over connections to be made between populations of sim objects. More...

#include <ConnectionIterator.h>

Inheritance diagram for ConnectionIterator:

Inheritance graph
[legend]
Collaboration diagram for ConnectionIterator:

Collaboration graph
[legend]

List of all members.

Interface for iterating over connections

virtual void init (const SimObjectPopulation &src, const SimObjectPopulation &dst)=0
 Tell the iterator about the populations to connect.
virtual void reset (SimObject::ID::SortedVector::const_iterator src_begin, SimObject::ID::SortedVector::const_iterator src_end, SimObject::ID::SortedVector::const_iterator dst_begin, SimObject::ID::SortedVector::const_iterator dst_end)=0
 Reset/Prepare the iterator to connect src to dst (specified by the begin and end iterators).
virtual bool next (pair< SimObject::ID, SimObject::ID > &connection)=0
 Move on to the next connection. If true is returned the connection pair is set properly.
virtual bool getIdx (size_t &src_idx, size_t &dst_idx)
 get the indices of the SimObjects in the src- and dst-population, only valid if last next() returned true
virtual size_t estimate ()
 Return an estimated number of connections which will be generated (if possible).

Random number engine interface

void setRNDEngine (RandomEngine *engine)
 Set a particular random number engine.
void unsetRNDEngine (void)
 Set default random number engine.

Public Member Functions

 ConnectionIterator ()
 Default constructor.
virtual ~ConnectionIterator ()
 Destruct me.

Protected Attributes

RandomEnginem_rnd_eng
 The engine currently to use.
pair< size_t, size_tlast_conn_idx
bool last_conn_valid


Detailed Description

Interface for iterating over connections to be made between populations of sim objects.

This interface is used by the WiringMethod implementations SimpleAllToAllWiringMethod and DistributedSyncWiringMethod

See also:
WiringMethod, SimpleAllToAllWiringMethod, DistributedSyncWiringMethod

Definition at line 30 of file ConnectionIterator.h.


Constructor & Destructor Documentation

ConnectionIterator::ConnectionIterator (  ) 

Default constructor.

Initializes the random number generator engine

Definition at line 16 of file ConnectionIterator.cpp.

References ThreadSpecificRandomEngine::get(), ThreadSpecificRandomEngine::init(), last_conn_idx, last_conn_valid, m_rnd_eng, and theThreadSpecificRandomEngine.

Here is the call graph for this function:

ConnectionIterator::~ConnectionIterator (  )  [virtual]

Destruct me.

Definition at line 26 of file ConnectionIterator.cpp.


Member Function Documentation

virtual void ConnectionIterator::init ( const SimObjectPopulation src,
const SimObjectPopulation dst 
) [pure virtual]

Reset/Prepare the iterator to connect src to dst (specified by the begin and end iterators).

Implemented in DegreeDistributionConnections, EuclideanDistanceRandomConnections, PredicateBasedConnections, RandomConnections, and RandomFixNumberConnections.

Referenced by SimpleAllToAllWiringMethod::connect(), and DistributedSyncWiringMethod::connect().

virtual bool ConnectionIterator::next ( pair< SimObject::ID, SimObject::ID > &  connection  )  [pure virtual]

Move on to the next connection. If true is returned the connection pair is set properly.

Implemented in DegreeDistributionConnections, EuclideanDistanceRandomConnections, PredicateBasedConnections, RandomConnections, and RandomFixNumberConnections.

Referenced by SimpleAllToAllWiringMethod::connect(), and DistributedSyncWiringMethod::connect().

bool ConnectionIterator::getIdx ( size_t src_idx,
size_t dst_idx 
) [virtual]

get the indices of the SimObjects in the src- and dst-population, only valid if last next() returned true

Definition at line 31 of file ConnectionIterator.cpp.

References last_conn_idx, and last_conn_valid.

Referenced by SimpleAllToAllWiringMethod::connect(), and DistributedSyncWiringMethod::connect().

virtual size_t ConnectionIterator::estimate (  )  [inline, virtual]

Return an estimated number of connections which will be generated (if possible).

Reimplemented in DegreeDistributionConnections, RandomConnections, and RandomFixNumberConnections.

Definition at line 59 of file ConnectionIterator.h.

void ConnectionIterator::setRNDEngine ( RandomEngine engine  )  [inline]

Set a particular random number engine.

Definition at line 67 of file ConnectionIterator.h.

References m_rnd_eng.

Referenced by SimpleAllToAllWiringMethod::connect(), and DistributedSyncWiringMethod::connect().

void ConnectionIterator::unsetRNDEngine ( void   )  [inline]

Set default random number engine.

Definition at line 72 of file ConnectionIterator.h.

References ThreadSpecificRandomEngine::get(), ThreadSpecificRandomEngine::init(), m_rnd_eng, and theThreadSpecificRandomEngine.

Here is the call graph for this function:


Member Data Documentation


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

Generated on Wed Jul 9 16:34:47 2008 for PCSIM by  doxygen 1.5.5