public void Run(List <CARule> rules) { this.AgentCells = AgentCells.Distinct().ToList(); // act on self: before or after? if (Parent.Settings.Subprocessing) { // NOTE: this caused an issue. We were copying the agentcells, thus we weren't making changes to the original version. foreach (var item in this.AgentCells.ToArray()) { this.GetCell(item).Run(rules); } } else { // Parallel??? for (int i = 0; i < Cells.GetLength(0); i++) { for (int j = 0; j < Cells.GetLength(1); j++) { for (int k = 0; k < Cells.GetLength(2); k++) { Cells[i, j, k].Run(rules); } } } } // for self running: USE GET COPY????? }
public void RemoveAgentCell(ValueTuple <ushort, ushort, ushort> position) { AgentCells.Remove(position); }
public void AddAgentCell(ValueTuple <ushort, ushort, ushort> position) { AgentCells.Add(position); }