MCPcopy Create free account
hub / github.com/devosoft/avida / UpdateQs

Method UpdateQs

avida-core/source/main/cPopulation.cc:985–1023  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

983}
984
985void cPopulation::UpdateQs(cOrganism* org, bool reproduced)
986{
987 // yank the org out of any current trace queues, as appropriate (i.e. if dead (==!reproduced) or if reproduced and splitting on divide)
988 bool split = (m_world->GetConfig().DIVIDE_METHOD.Get() == DIVIDE_METHOD_SPLIT && m_world->GetConfig().RESET_INPUTS_ON_DIVIDE.Get());
989
990 if (!reproduced || (reproduced && split)) {
991 org->GetHardware().PrintMicroTrace(org->SystematicsGroup("genotype")->ID());
992 org->GetHardware().DeleteMiniTrace(print_mini_trace_reacs, (reproduced && split));
993 }
994
995 if (org->GetHardware().IsReproTrace() && repro_q.GetSize()) {
996 for (int i = 0; i < repro_q.GetSize(); i++) {
997 if (repro_q[i] == org) {
998 if (reproduced) m_world->GetStats().PrintReproData(org);
999 if ((!reproduced || (reproduced && split)) && repro_q.GetSize()) {
1000 int last = repro_q.GetSize() - 1;
1001 repro_q.Swap(i, last);
1002 repro_q.Pop();
1003 org->GetHardware().SetReproTrace(false);
1004 }
1005 break;
1006 }
1007 }
1008 }
1009 if (org->GetHardware().IsTopNavTrace() && topnav_q.GetSize()) {
1010 for (int i = 0; i < topnav_q.GetSize(); i++) {
1011 if (topnav_q[i] == org) {
1012 if (reproduced) m_world->GetStats().UpdateTopNavTrace(org);
1013 if ((!reproduced || (reproduced && split)) && topnav_q.GetSize()) { //nav_q can be wiped in update process
1014 int last = topnav_q.GetSize() - 1;
1015 topnav_q.Swap(i, last);
1016 topnav_q.Pop();
1017 org->GetHardware().SetTopNavTrace(false);
1018 }
1019 break;
1020 }
1021 }
1022 }
1023}
1024
1025bool cPopulation::TestForParasiteInteraction(cOrganism* infected_host, cOrganism* target_host)
1026{

Callers

nothing calls this directly

Calls 15

GetConfigMethod · 0.80
PrintMicroTraceMethod · 0.80
GetHardwareMethod · 0.80
SystematicsGroupMethod · 0.80
DeleteMiniTraceMethod · 0.80
IsReproTraceMethod · 0.80
PrintReproDataMethod · 0.80
SetReproTraceMethod · 0.80
IsTopNavTraceMethod · 0.80
UpdateTopNavTraceMethod · 0.80
SetTopNavTraceMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected