예제 #1
0
 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?????
 }
예제 #2
0
 public void RemoveAgentCell(ValueTuple <ushort, ushort, ushort> position)
 {
     AgentCells.Remove(position);
 }
예제 #3
0
 public void AddAgentCell(ValueTuple <ushort, ushort, ushort> position)
 {
     AgentCells.Add(position);
 }