#include <SimObjectPopulation.h>
Public Member Functions | |
SimObjectPopulation (SimNetwork &net, SimObjectFactory &objFactory, size_t n) | |
SimObjectPopulation (SimNetwork &net, const SimObject::ID::Vector v) | |
SimObjectPopulation (SimNetwork &net, vector< SimObject::ID::Packed > const &v) | |
SimObject::ID::Packed | operator[] (int idx) const |
virtual SimObject::ID | getID (int idx) const |
SimObject * | object (int idx) const |
SimObject::ID | operator() (int idx) const |
size_t | size () const |
Return the number objects in the population. | |
const vector < SimObject::ID::Packed > & | idVector () const |
virtual | ~SimObjectPopulation () |
SimNetwork & | getNet () const |
shared_ptr< SimObjectPopulation > | subset (vector< size_t > const &subindices) const |
Return a new SimObjectPopulation which is a subset specified by the given set of indices. | |
shared_ptr< SimObjectPopulation > | localSubPopulation () |
vector< size_t > * | localIndexes () |
bool | setFieldScale (string const &fieldname, double scale) |
virtual shared_ptr < SimObjectPopulation > | record (const SimObjectFactory &recFactory, const port_t src_port=0) |
virtual shared_ptr < SimObjectPopulation > | record (const SimObjectFactory &recFactory, const string field) |
Protected Member Functions | |
SimObjectPopulation () | |
Invoked only by derived classes. | |
SimObjectPopulation (SimNetwork &net) | |
Invoked only by derived classes. | |
SimObjectPopulation (const vector< SimObject::ID::Packed > &v) | |
virtual SimObjectPopulation * | new_subset (vector< size_t > const &indices) const |
Return a new SpatialSimObjectPopulation which is a subset specified by the given set of indices. | |
Protected Attributes | |
SimObject::ID::Vector | shr_ptr_vec |
This shared pointer is the owner of the id vector if generated in the constructor. | |
const vector < SimObject::ID::Packed > * | id_vec |
This is just a pointer to the array but has nothing to do with the ownership. | |
SimNetwork * | net |
The network to which this population belongs. | |
Friends | |
class | WiringMethod |
class | OneToOneWiringMethod |
class | SimpleAllToAllWiringMethod |
class | DistributedSyncWiringMethod |
This is the simplest population class. It just holds an array of SimObjects, without any spatial coordinates or other identity attributes whatsoever. Individual SimObjects and their IDs can be retrieved by their population index number (integer value).
Definition at line 27 of file SimObjectPopulation.h.
SimObjectPopulation::SimObjectPopulation | ( | ) | [inline, protected] |
Invoked only by derived classes.
Definition at line 32 of file SimObjectPopulation.h.
Referenced by localSubPopulation(), new_subset(), and record().
SimObjectPopulation::SimObjectPopulation | ( | SimNetwork & | net | ) | [inline, protected] |
SimObjectPopulation::SimObjectPopulation | ( | SimNetwork & | net, | |
SimObjectFactory & | objFactory, | |||
size_t | n | |||
) | [inline] |
Definition at line 41 of file SimObjectPopulation.h.
References SimNetwork::add(), id_vec, and shr_ptr_vec.
SimObjectPopulation::SimObjectPopulation | ( | SimNetwork & | net, | |
const SimObject::ID::Vector | v | |||
) | [inline] |
SimObjectPopulation::SimObjectPopulation | ( | SimNetwork & | net, | |
vector< SimObject::ID::Packed > const & | v | |||
) | [inline] |
SimObjectPopulation::SimObjectPopulation | ( | const vector< SimObject::ID::Packed > & | v | ) | [inline, protected] |
Invoked internally from Wiring method. not exposed in python The vector pointed to by id_vec is not owned by the population when using this constructor.
Definition at line 71 of file SimObjectPopulation.h.
References id_vec.
virtual SimObjectPopulation::~SimObjectPopulation | ( | ) | [inline, virtual] |
Definition at line 102 of file SimObjectPopulation.h.
SimObject::ID::Packed SimObjectPopulation::operator[] | ( | int | idx | ) | const [inline] |
virtual SimObject::ID SimObjectPopulation::getID | ( | int | idx | ) | const [inline, virtual] |
Definition at line 81 of file SimObjectPopulation.h.
References id_vec.
Referenced by SphereConnectionPredicate::decide(), LateralLongRangeOrientationConnectionPredicate::decide(), LateralEuclidianDistanceConnectionPredicate::decide(), EuclidianDistanceConnectionPredicate::decide(), SpatialSimObjectPopulation::getIdAt(), and PredicateBasedConnections::next().
Definition at line 85 of file SimObjectPopulation.h.
References id_vec, net, and SimNetwork::object().
Referenced by SpatialSimObjectPopulation::objectAt().
SimObject::ID SimObjectPopulation::operator() | ( | int | idx | ) | const [inline] |
size_t SimObjectPopulation::size | ( | ) | const [inline] |
Return the number objects in the population.
Definition at line 94 of file SimObjectPopulation.h.
References id_vec.
Referenced by OneToOneWiringMethod::connect(), RetinotopicOrientationConnectionPredicate::init(), RandomFixNumberConnections::init(), localIndexes(), localSubPopulation(), record(), setFieldScale(), and CuboidGridObjectPopulation::subVolume().
const vector<SimObject::ID::Packed>& SimObjectPopulation::idVector | ( | ) | const [inline] |
Definition at line 98 of file SimObjectPopulation.h.
References id_vec.
Referenced by SimpleAllToAllWiringMethod::connect(), and DistributedSyncWiringMethod::connect().
SimNetwork& SimObjectPopulation::getNet | ( | ) | const [inline] |
Definition at line 106 of file SimObjectPopulation.h.
References net.
Referenced by AugmentedSpatialPopulation::AugmentedSpatialPopulation(), ConnectionsProjection::ConnectionsProjection(), and SpatialFamilyPopulation::SpatialFamilyPopulation().
shared_ptr<SimObjectPopulation> SimObjectPopulation::subset | ( | vector< size_t > const & | subindices | ) | const [inline] |
Return a new SimObjectPopulation which is a subset specified by the given set of indices.
Definition at line 111 of file SimObjectPopulation.h.
References new_subset().
shared_ptr< SimObjectPopulation > SimObjectPopulation::localSubPopulation | ( | ) |
Definition at line 36 of file SimObjectPopulation.cpp.
References id_vec, SimNetwork::mpi_rank(), net, SimObjectPopulation(), and size().
vector< size_t > * SimObjectPopulation::localIndexes | ( | ) |
Definition at line 48 of file SimObjectPopulation.cpp.
References id_vec, SimNetwork::mpi_rank(), net, and size().
Definition at line 69 of file SimObjectPopulation.cpp.
References SimObject::findField(), SimNetwork::getObject(), SimObject::getScalarField(), id_vec, SimNetwork::mpi_rank(), net, SimObject::setScalarField(), and size().
shared_ptr< SimObjectPopulation > SimObjectPopulation::record | ( | const SimObjectFactory & | recFactory, | |
const port_t | src_port = 0 | |||
) | [virtual] |
Definition at line 14 of file SimObjectPopulation.cpp.
References id_vec, net, SimNetwork::record(), SimObjectPopulation(), and size().
shared_ptr< SimObjectPopulation > SimObjectPopulation::record | ( | const SimObjectFactory & | recFactory, | |
const string | field | |||
) | [virtual] |
Definition at line 25 of file SimObjectPopulation.cpp.
References id_vec, net, SimNetwork::record(), SimObjectPopulation(), and size().
SimObjectPopulation * SimObjectPopulation::new_subset | ( | vector< size_t > const & | indices | ) | const [protected, virtual] |
Return a new SpatialSimObjectPopulation which is a subset specified by the given set of indices.
Reimplemented in AugmentedSpatialPopulation, SpatialFamilyPopulation, and SpatialSimObjectPopulation.
Definition at line 58 of file SimObjectPopulation.cpp.
References net, and SimObjectPopulation().
Referenced by subset().
friend class WiringMethod [friend] |
Definition at line 64 of file SimObjectPopulation.h.
friend class OneToOneWiringMethod [friend] |
Definition at line 65 of file SimObjectPopulation.h.
friend class SimpleAllToAllWiringMethod [friend] |
Definition at line 66 of file SimObjectPopulation.h.
friend class DistributedSyncWiringMethod [friend] |
Definition at line 67 of file SimObjectPopulation.h.
This shared pointer is the owner of the id vector if generated in the constructor.
Definition at line 134 of file SimObjectPopulation.h.
Referenced by AugmentedSpatialPopulation::AugmentedSpatialPopulation(), AugmentedSpatialPopulation::populate(), SimObjectPopulation(), and SpatialFamilyPopulation::SpatialFamilyPopulation().
const vector< SimObject::ID::Packed >* SimObjectPopulation::id_vec [protected] |
This is just a pointer to the array but has nothing to do with the ownership.
Definition at line 137 of file SimObjectPopulation.h.
Referenced by AugmentedSpatialPopulation::AugmentedSpatialPopulation(), getID(), idVector(), localIndexes(), localSubPopulation(), object(), operator[](), record(), setFieldScale(), SimObjectPopulation(), size(), SpatialFamilyPopulation::SpatialFamilyPopulation(), and SpatialFamilyPopulation::subPopulation().
SimNetwork* SimObjectPopulation::net [protected] |
The network to which this population belongs.
Definition at line 140 of file SimObjectPopulation.h.
Referenced by AugmentedSpatialPopulation::AugmentedSpatialPopulation(), getNet(), localIndexes(), localSubPopulation(), SpatialSimObjectPopulation::new_subset(), SpatialFamilyPopulation::new_subset(), new_subset(), AugmentedSpatialPopulation::new_subset(), object(), AugmentedSpatialPopulation::populate(), record(), setFieldScale(), SpatialFamilyPopulation::SpatialFamilyPopulation(), and CuboidGridObjectPopulation::subVolume().