#include <SpatialFamilyPopulation.h>
Public Member Functions | |
SpatialFamilyPopulation (SimNetwork &net, vector< SimObjectFactory * > const &families, SpatialFamilyIDGenerator const &fidgen, shared_ptr< Point3DSet > locs) | |
Create a population by mixing objects generated from different factories. | |
SpatialFamilyPopulation (SimNetwork &net, vector< shared_ptr< SimObjectFactory > > const &families, SpatialFamilyIDGenerator const &fidgen, shared_ptr< Point3DSet > locs) | |
Create a population by mixing objects generated from different factories. | |
SpatialFamilyPopulation (SimNetwork &net, SimObjectFactory *fam0, shared_ptr< Point3DSet > locs) | |
Creates a population by generating objects from SimObjectFactory for each point in Point3DSet (all objects have family ID = 0). | |
SpatialFamilyPopulation (vector< shared_ptr< SpatialFamilyPopulation > > const &pops) | |
Creates a population by combining the objects from several populations into one population. | |
virtual | ~SpatialFamilyPopulation () |
Destruct me. | |
familyid_t | getFamilyIdAt (Point3D< double > const &p) |
Returns the family ID of the object at location Point3D. | |
familyid_t | getFamilyIdAt (double const &x, double const &y, double const &z) |
Returns the family ID of the object at location (x,y,z). | |
familyid_t | getFamilyID (size_t index) |
Returns the family ID of the object with the given index. | |
void | setFamilyID (familyid_t newID) |
Set the familyID of all objects to the given value. | |
virtual shared_ptr < SpatialFamilyPopulation > | subPopulation (vector< familyid_t > const &families) |
Creates a new SpatialFamilyPopulation defined by the set of given family IDs. | |
virtual shared_ptr< vector < shared_ptr < SpatialFamilyPopulation > > > | splitFamilies () |
Returns an array of SpatialFamilyPopulation objects, each holding objects from one family/type. | |
Protected Member Functions | |
SpatialFamilyPopulation () | |
SpatialFamilyPopulation (SimNetwork &net, shared_ptr< Point3DSet > locs) | |
SpatialFamilyPopulation (SimNetwork *net, vector< SimObject::ID::Packed > const &objIDs, vector< familyid_t > const &famIDs, shared_ptr< Point3DSet > locs) | |
Constructor used by subPopulation and subset. | |
virtual SpatialFamilyPopulation * | new_subset (vector< size_t > const &indices) const |
Return a new SpatialFamilyPopulation which is a subset specified by the given set of indices. | |
Protected Attributes | |
shared_ptr< vector< familyid_t > > | familyIDs |
This vector holds the list of family IDs. |
Extends the basic population concept by associating a location in 3D space (double triples) to each simobject in the population, as well as one integer attribute named as family ID.
For construction, an array of SimObjectFactories is provided where each SimObjectFactory defines one family of simulation objects. The SpatialFamilyIDGenerator chooses among the factories/families at each object creation step which is carried out for each location in the Point3DSet.
The family ID indicates the index of the SimObjectFactory that was used to create the particular object (useful for designating excitatory, inhibitory and other families of neurons).
Individual objects and their ID can be accessed by their index (integer or integer tuple) or by their location in space.
Also, subpopulations can be created by providing a subspace definitions, and based on family IDs.
Definition at line 43 of file SpatialFamilyPopulation.h.
SpatialFamilyPopulation::SpatialFamilyPopulation | ( | SimNetwork & | net, | |
vector< SimObjectFactory * > const & | families, | |||
SpatialFamilyIDGenerator const & | fidgen, | |||
shared_ptr< Point3DSet > | locs | |||
) |
Create a population by mixing objects generated from different factories.
For construction, an array of SimObjectFactories is provided where each SimObjectFactory defines one family of simulation objects. The SpatialFamilyIDGenerator chooses among the factories/families at each object creation step which is carried out for each location in the Point3DSet.
The network
Definition at line 60 of file SpatialFamilyPopulation.cpp.
References familyIDs, SpatialFamilyIDGenerator::generateIDs(), SimObjectPopulation::id_vec, SpatialSimObjectPopulation::locations, and SimObjectPopulation::shr_ptr_vec.
SpatialFamilyPopulation::SpatialFamilyPopulation | ( | SimNetwork & | net, | |
vector< shared_ptr< SimObjectFactory > > const & | familiesArg, | |||
SpatialFamilyIDGenerator const & | fidgen, | |||
shared_ptr< Point3DSet > | locs | |||
) |
Create a population by mixing objects generated from different factories.
For construction, an array of SimObjectFactories is provided where each SimObjectFactory defines one family of simulation objects. The SpatialFamilyIDGenerator chooses among the factories/families at each object creation step which is carried out for each location in the Point3DSet.
The network
Definition at line 80 of file SpatialFamilyPopulation.cpp.
References familyIDs, SpatialFamilyIDGenerator::generateIDs(), SimObjectPopulation::id_vec, SpatialSimObjectPopulation::locations, and SimObjectPopulation::shr_ptr_vec.
SpatialFamilyPopulation::SpatialFamilyPopulation | ( | SimNetwork & | net, | |
SimObjectFactory * | fam0, | |||
shared_ptr< Point3DSet > | locs | |||
) |
Creates a population by generating objects from SimObjectFactory for each point in Point3DSet (all objects have family ID = 0).
This constructor is just a shorthand where only one family of sim objects is needed.
The networks
Definition at line 101 of file SpatialFamilyPopulation.cpp.
References familyIDs, SimObjectPopulation::id_vec, and SimObjectPopulation::shr_ptr_vec.
SpatialFamilyPopulation::SpatialFamilyPopulation | ( | vector< shared_ptr< SpatialFamilyPopulation > > const & | pops | ) |
Creates a population by combining the objects from several populations into one population.
Here the information about the network is taken from the provided populations. An extra Point3DSet is allocated which stores the locations (copies from all inital populations) of objects. The network referenced by the initial set of populations must not be deleted until the SpatialFamilyPopulation constructed is deleted.
Definition at line 120 of file SpatialFamilyPopulation.cpp.
References familyIDs, getFamilyID(), SpatialSimObjectPopulation::getLocation(), SimObjectPopulation::getNet(), SimObjectPopulation::id_vec, SpatialSimObjectPopulation::locations, SimObjectPopulation::net, and SimObjectPopulation::shr_ptr_vec.
SpatialFamilyPopulation::~SpatialFamilyPopulation | ( | ) | [virtual] |
Destruct me.
Delete the Point3DSet if necessary
Definition at line 162 of file SpatialFamilyPopulation.cpp.
SpatialFamilyPopulation::SpatialFamilyPopulation | ( | ) | [inline, protected] |
SpatialFamilyPopulation::SpatialFamilyPopulation | ( | SimNetwork & | net, | |
shared_ptr< Point3DSet > | locs | |||
) | [protected] |
Definition at line 45 of file SpatialFamilyPopulation.cpp.
SpatialFamilyPopulation::SpatialFamilyPopulation | ( | SimNetwork * | net, | |
vector< SimObject::ID::Packed > const & | objIDs, | |||
vector< familyid_t > const & | famIDs, | |||
shared_ptr< Point3DSet > | locs | |||
) | [protected] |
Constructor used by subPopulation and subset.
ONLY USED INTERNALLY
Definition at line 27 of file SpatialFamilyPopulation.cpp.
References familyIDs, SimObjectPopulation::id_vec, and SimObjectPopulation::shr_ptr_vec.
familyid_t SpatialFamilyPopulation::getFamilyIdAt | ( | Point3D< double > const & | p | ) |
Returns the family ID of the object at location Point3D.
Definition at line 184 of file SpatialFamilyPopulation.cpp.
References familyIDs, and SpatialSimObjectPopulation::locations.
familyid_t SpatialFamilyPopulation::getFamilyIdAt | ( | double const & | x, | |
double const & | y, | |||
double const & | z | |||
) |
Returns the family ID of the object at location (x,y,z).
Definition at line 188 of file SpatialFamilyPopulation.cpp.
References familyIDs, and SpatialSimObjectPopulation::locations.
familyid_t SpatialFamilyPopulation::getFamilyID | ( | size_t | index | ) |
Returns the family ID of the object with the given index.
Definition at line 193 of file SpatialFamilyPopulation.cpp.
References familyIDs.
Referenced by AugmentedSpatialPopulation::AugmentedSpatialPopulation(), and SpatialFamilyPopulation().
void SpatialFamilyPopulation::setFamilyID | ( | familyid_t | newID | ) |
Set the familyID of all objects to the given value.
Definition at line 197 of file SpatialFamilyPopulation.cpp.
References familyIDs.
shared_ptr< SpatialFamilyPopulation > SpatialFamilyPopulation::subPopulation | ( | vector< familyid_t > const & | families | ) | [virtual] |
Creates a new SpatialFamilyPopulation defined by the set of given family IDs.
Creates a new SpatialFamilyPopulation from the objects in the population that have any of the family id values specified in the set of families.
Creates a new SpatialFamilyPopulation from the objects in the population that have any of the family id values specified in the set of families.
Definition at line 206 of file SpatialFamilyPopulation.cpp.
References familyIDs, SimObjectPopulation::id_vec, and new_subset().
shared_ptr< vector< shared_ptr< SpatialFamilyPopulation > > > SpatialFamilyPopulation::splitFamilies | ( | ) | [virtual] |
Returns an array of SpatialFamilyPopulation objects, each holding objects from one family/type.
Count family ids, this is done bcs we DO NOT assume that the family IDs are 0,1,... but can rather be arbitrary integers
Definition at line 234 of file SpatialFamilyPopulation.cpp.
References familyIDs, and new_subset().
SpatialFamilyPopulation * SpatialFamilyPopulation::new_subset | ( | vector< size_t > const & | indices | ) | const [protected, virtual] |
Return a new SpatialFamilyPopulation which is a subset specified by the given set of indices.
Reimplemented from SpatialSimObjectPopulation.
Reimplemented in AugmentedSpatialPopulation.
Definition at line 221 of file SpatialFamilyPopulation.cpp.
References SpatialSimObjectPopulation::locations, SimObjectPopulation::net, and SpatialFamilyPopulation().
Referenced by splitFamilies(), and subPopulation().
shared_ptr< vector<familyid_t> > SpatialFamilyPopulation::familyIDs [protected] |
This vector holds the list of family IDs.
Definition at line 104 of file SpatialFamilyPopulation.h.
Referenced by AugmentedSpatialPopulation::AugmentedSpatialPopulation(), getFamilyID(), getFamilyIdAt(), setFamilyID(), SpatialFamilyPopulation(), splitFamilies(), and subPopulation().