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

Method GetResourceCountID

avida-core/source/main/cResourceCount.cc:483–490  ·  view source on GitHub ↗

* This is unnecessary now that a resource has an index * TODO: * - Change name to GetResourceCountIndex * - Fix anything that breaks by just using the index of the resource (not id) * - Get rid of this function */

Source from the content-addressed store, hash-verified

481 * - Get rid of this function
482 */
483int cResourceCount::GetResourceCountID(const cString& res_name)
484{
485 for (int i = 0; i < resource_name.GetSize(); i++) {
486 if (resource_name[i] == res_name) return i;
487 }
488 cerr << "Error: Unknown resource '" << res_name << "'." << endl;
489 return -1;
490}
491
492double cResourceCount::GetInflow(const cString& name)
493{

Callers 6

ProcessMethod · 0.80
ProcessMethod · 0.80
ProcessMethod · 0.80
ProcessMethod · 0.80
ProcessMethod · 0.80
operator()Method · 0.80

Calls 1

GetSizeMethod · 0.45

Tested by

no test coverage detected