Skip to content

Commit 0657f03

Browse files
committed
little comment tweaks and such
1 parent 45edaf7 commit 0657f03

5 files changed

Lines changed: 10 additions & 6 deletions

File tree

core/individual.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,6 +1989,7 @@ EidosValue *Individual::GetProperty_Accelerated_cachedFitness(EidosGlobalStringI
19891989
EidosValue *Individual::GetProperty_Accelerated_reproductiveOutput(EidosGlobalStringID p_property_id, EidosObject **p_values, size_t p_values_size)
19901990
{
19911991
#pragma unused (p_property_id)
1992+
// FIXME: This could be called for a vector of individuals of mixed species, so this check is inadequate, right?
19921993
if ((p_values_size > 0) && !((Individual *)(p_values[0]))->subpopulation_->species_.PedigreesEnabledByUser())
19931994
EIDOS_TERMINATION << "ERROR (Individual::GetProperty): property reproductiveOutput is not available because pedigree recording has not been enabled." << EidosTerminate();
19941995

core/species.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8345,7 +8345,7 @@ void Species::SetCurrentNewIndividual(__attribute__((unused))Individual *p_indiv
83458345
EIDOS_TERMINATION << "ERROR (Species::SetCurrentNewIndividual): (internal error) tree sequence recording method called with recording off." << EidosTerminate();
83468346
#endif
83478347

8348-
// This is called by code where new individuals are created
8348+
// This is called by code where new individuals are created, when treeseq recording is enabled
83498349

83508350
// Remember the new individual being defined; we don't need this right now,
83518351
// but it seems to keep coming back, so I've kept the code for it...
@@ -8375,7 +8375,8 @@ void Species::SetCurrentNewIndividual(__attribute__((unused))Individual *p_indiv
83758375
// this code is not thread-safe! The design is this way because the size of HaplosomeMetadataRec
83768376
// is determined dynamically at runtime, depending on the number of chromosomes in the model.
83778377
// (If we want this to run in parallel across chromosomes eventually, we could keep separate
8378-
// copies of the default haplosome metadata for each chromosome, to make this thread-safe...)
8378+
// copies of the default haplosome metadata for each chromosome, to make this thread-safe...
8379+
// but this code adds entries to the shared node table, so that would also need locking, etc.)
83798380
THREAD_SAFETY_IN_ACTIVE_PARALLEL();
83808381
static_assert(sizeof(HaplosomeMetadataRec) == 9, "HaplosomeMetadataRec has changed size; this code probably needs to be updated");
83818382
HaplosomeMetadataRec *metadata1, *metadata2;
@@ -8410,8 +8411,6 @@ void Species::SetCurrentNewIndividual(__attribute__((unused))Individual *p_indiv
84108411
// The individual remembers the tskid of the first node (which is the same across all haplosomes
84118412
// in 1st position). For haplosomes in 2nd position, it is first_tsk_node_id + 1.
84128413
p_individual->SetTskitNodeIdBase(nodeTSKID1);
8413-
8414-
// The haplosome metadata is presently all zero. FinalizeCurrentNewIndividual() will clean it up.
84158414
}
84168415

84178416
void Species::RetractNewIndividual()

core/species.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@
4040
#include "mutation_run.h"
4141
#include "mutation_block.h"
4242

43-
//TREE SEQUENCE
44-
//INCLUDE JEROME's TABLES API
43+
// TREE SEQUENCE RECORDING
4544
#ifdef __cplusplus
4645
extern "C" {
4746
#endif

core/subpopulation.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ void Subpopulation::GenerateParentsToFit(slim_age_t p_initial_age, double p_sex_
414414
}
415415
}
416416

417+
#if DEBUG
417418
void Subpopulation::CheckIndividualIntegrity(void) const
418419
{
419420
ClearErrorPosition();
@@ -1120,6 +1121,7 @@ void Subpopulation::CheckIndividualIntegrity(void) const
11201121
}
11211122
}
11221123
}
1124+
#endif
11231125

11241126
Subpopulation::Subpopulation(Population &p_population, slim_objectid_t p_subpopulation_id, slim_popsize_t p_subpop_size, bool p_record_in_treeseq, bool p_haploid) :
11251127
self_symbol_(EidosStringRegistry::GlobalStringIDForString(SLiMEidosScript::IDStringWithPrefix('p', p_subpopulation_id)), EidosValue_SP(new (gEidosValuePool->AllocateChunk()) EidosValue_Object(this, gSLiM_Subpopulation_Class))),

core/subpopulation.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,10 @@ class Subpopulation : public EidosDictionaryUnretained
377377
}
378378

379379
void GenerateParentsToFit(slim_age_t p_initial_age, double p_sex_ratio, bool p_allow_zero_size, bool p_require_both_sexes, bool p_record_in_treeseq, bool p_haploid, float p_mean_parent_age); // given the set subpop size and requested sex ratio, make new haplosomes and individuals to fit
380+
381+
#if DEBUG
380382
void CheckIndividualIntegrity(void) const;
383+
#endif
381384

382385
// this is called by Population::RecalculateFitness(); first it expresses demand for traits that have direct fitness effects, then it recalculates fitness values
383386
void UpdateFitness(const std::vector<SLiMEidosBlock*> &p_subpop_mutationEffect_callbacks, const std::vector<SLiMEidosBlock*> &p_subpop_fitnessEffect_callbacks, const std::vector<slim_trait_index_t> &p_direct_effect_trait_indices, bool p_force_trait_recalculation);

0 commit comments

Comments
 (0)