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

Method Inst_RotateEventCell

avida-core/source/cpu/cHardwareCPU.cc:6476–6489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6474}
6475
6476bool cHardwareCPU::Inst_RotateEventCell(cAvidaContext& ctx)
6477{
6478 const int reg_used = FindModifiedRegister(REG_BX);
6479
6480 for (int i = 0; i < m_organism->GetNeighborhoodSize(); i++) {
6481 if (m_organism->GetCellData() > 0) { // event in faced cell
6482 GetRegister(reg_used) = 1;
6483 return true;
6484 }
6485 m_organism->Rotate(ctx, 1); // continue to rotate
6486 }
6487 GetRegister(reg_used) = 0;
6488 return true;
6489}
6490
6491bool cHardwareCPU::Inst_RotateUphill(cAvidaContext& ctx)
6492{

Callers

nothing calls this directly

Calls 3

GetNeighborhoodSizeMethod · 0.80
GetCellDataMethod · 0.45
RotateMethod · 0.45

Tested by

no test coverage detected