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

Method PrintResourceLocData

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

Source from the content-addressed store, hash-verified

1579}
1580
1581void cStats::PrintResourceLocData(const cString& filename, cAvidaContext& ctx)
1582{
1583 Avida::Output::FilePtr df = Avida::Output::File::StaticWithPath(m_world->GetNewWorld(), (const char*)filename);
1584
1585 df->WriteComment("Avida resource location data");
1586 df->WriteTimeStamp();
1587 df->WriteComment("First column gives the current update, all further columns give the cell id");
1588 df->WriteComment("for center of gradient resources at that update.");
1589
1590 df->Write(m_update, "Update");
1591
1592 const cResourceLib& resLib = m_world->GetEnvironment().GetResourceLib();
1593 for (int i = 0; i < resLib.GetSize(); i++) {
1594 if (resLib.GetResource(i)->GetGradient()) {
1595 df->Write(m_world->GetPopulation().GetCurrPeakX(ctx, i) + (m_world->GetPopulation().GetCurrPeakY(ctx, i) * m_world->GetConfig().WORLD_X.Get()), "CellID");
1596 }
1597 }
1598 df->Endl();
1599}
1600
1601void cStats::PrintResWallLocData(const cString& filename, cAvidaContext& ctx)
1602{

Callers 1

ProcessMethod · 0.80

Calls 12

GetNewWorldMethod · 0.80
WriteCommentMethod · 0.80
WriteTimeStampMethod · 0.80
WriteMethod · 0.80
GetGradientMethod · 0.80
GetConfigMethod · 0.80
EndlMethod · 0.80
GetSizeMethod · 0.45
GetResourceMethod · 0.45
GetCurrPeakXMethod · 0.45
GetCurrPeakYMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected