1326{
1328 unsigned int size_fem = patch->
size(
FEM, AGE);
1329 unsigned int size_mal = patch->
size(
MAL, AGE);
1330 unsigned int sample_size;
1331
1332 int* sample = NULL;
1333
1334
1336
1337 if( sample_size != 0) {
1338
1339 sample = new int[sample_size];
1340
1342
1343 for(unsigned int j = 0; j < sample_size; ++j) {
1344
1345 ind = patch->
get(
FEM, AGE, sample[j]);
1346
1348 <<
" " <<
FEM <<
" " << AGE <<
" " << ind->
getHome()+1
1349 <<
" " << patch->
getID()+1 << endl;
1350 }
1351 }
1352
1353
1355
1356 if( sample_size != 0) {
1357
1358 if(sample) delete [] sample;
1359
1360 sample = new int[sample_size];
1361
1363
1364 for(unsigned int j = 0; j < sample_size; ++j) {
1365
1366 ind = patch->
get(
MAL, AGE, sample[j]);
1367
1369 <<
" " <<
MAL <<
" " << AGE <<
" " << ind->
getHome()+1
1370 <<
" " << patch->
getID()+1 << endl;
1371 }
1372 }
1373
1374 if(sample) delete [] sample;
1375}
This class contains traits along with other individual information (sex, pedigree,...
Definition: individual.h:49
unsigned long getID()
Definition: individual.h:122
unsigned short getHome()
Definition: individual.h:128
unsigned long getMotherID()
Definition: individual.h:125
unsigned long getFatherID()
Definition: individual.h:124
unsigned int size(age_t AGE)
Returns the size of the container of the appropriate age class(es) for both sexes.
Definition: metapop.h:496
unsigned int getID()
Definition: metapop.h:478
Individual * get(sex_t SEX, age_idx AGE, unsigned int at)
Returns a pointer to the individual sitting at the index passed.
Definition: metapop.h:532
static void Sample(const int from, const int to, const unsigned int num, int *result, bool replace)
Creates a sample of integers within range [from, to), with or without replacement.
Definition: Uniform.h:714
@ FEM
Definition: types.h:37
@ MAL
Definition: types.h:37