File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818 * facilitate demes, pools, islands, etc.
1919 * @todo We should be able to have any number of systematics managers, based on various type_trait
2020 * information a that we want to track.
21+ * @todo Add a signal for DoBirth() for when a birth fails.
2122 */
2223
2324#ifndef EMP_EVO_WORLD_H
@@ -1024,7 +1025,13 @@ namespace emp {
10241025 Ptr<ORG> new_org = NewPtr<ORG>(mem);
10251026 offspring_ready_sig.Trigger (*new_org);
10261027 const OrgPosition pos = fun_add_birth (new_org, parent_pos);
1027- if (pos.IsActive ()) org_placement_sig.Trigger (pos.GetIndex ());
1028+ if (pos.IsActive ()) {
1029+ // If organism was placed right into the active population, trigger placement signal.
1030+ org_placement_sig.Trigger (pos.GetIndex ());
1031+ } else if (!pos.IsValid ()) {
1032+ // Organism failed to be placed in the population. Delete it.
1033+ new_org.Delete ();
1034+ }
10281035 // SetupOrg(*new_org, &callbacks, pos);
10291036 return pos;
10301037 }
You can’t perform that action at this time.
0 commit comments