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

Method SetInflow

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

Source from the content-addressed store, hash-verified

498}
499
500void cResourceCount::SetInflow(const cString& name, const double _inflow)
501{
502 int id = GetResourceCountID(name);
503 if (id == -1) return;
504
505 inflow_rate[id] = _inflow;
506 double step_inflow = _inflow * UPDATE_STEP;
507 double step_decay = pow(decay_rate[id], UPDATE_STEP);
508
509 inflow_precalc(id, 0) = 0.0;
510 for (int i = 1; i <= PRECALC_DISTANCE; i++) {
511 inflow_precalc(id, i) = inflow_precalc(id, i-1) * step_decay + step_inflow;
512 }
513}
514
515double cResourceCount::GetDecay(const cString& name)
516{

Callers 8

SetResourceInflowMethod · 0.45
SetDemeResourceInflowMethod · 0.45
UpdateInflowMethod · 0.45
LoadResourceMethod · 0.45
LoadCellMethod · 0.45
SetResourceInflowMethod · 0.45
UpdateCellResourceMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected