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

Method SetGroupAttackInstNames

avida-core/source/main/cStats.cc:2307–2323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2305}
2306
2307void cStats::SetGroupAttackInstNames(const cString& inst_set) {
2308 cString inst;
2309 Apto::Array <cString, Apto::Smart> names;
2310 for (int i = 0; i < m_is_inst_names_map[inst_set].GetSize(); i++) {
2311 inst = m_is_inst_names_map[inst_set][i];
2312 if (inst == "attack-prey" || inst == "attack-ft-prey" || inst == "attack-prey-group" ||
2313 inst == "attack-prey-share" || inst == "attack-prey-group-share" ||
2314 inst == "attack-prey-no-share" || inst=="attack-prey-fake-share" ||
2315 inst == "attack-prey-fake-group-share") {
2316 names.Push(inst);
2317 }
2318 }
2319 m_group_attack_names[inst_set].Resize(names.GetSize());
2320 for (int i = 0; i < m_group_attack_names[inst_set].GetSize(); i++) {
2321 m_group_attack_names[inst_set][i] = names[i];
2322 }
2323}
2324
2325void cStats::PrintGroupAttackData(const cString& filename, const cString& inst_set) {
2326 Avida::Output::FilePtr df = Avida::Output::File::StaticWithPath(m_world->GetNewWorld(), (const char*)filename);

Callers 1

loadInstSetMethod · 0.80

Calls 3

GetSizeMethod · 0.45
PushMethod · 0.45
ResizeMethod · 0.45

Tested by

no test coverage detected