public void solveSectorToMove(Bulk bulk) { for (int line = 0; line < countLine; ++line) { for (int column = 0; column < countColumn; ++column) { sector_map[line, column].findPriority(bulk); } } for (int line = 0; line < countLine; ++line) { for (int column = 0; column < countColumn; ++column) { sector_map[line, column].updatePriority( basePriorityForSector(line + 1, column, 2) + basePriorityForSector(line - 1, column, 2) + basePriorityForSector(line, column + 1, 2) + basePriorityForSector(line, column - 1, 2) + basePriorityForSector(line + 1, column + 1, 3) + basePriorityForSector(line - 1, column - 1, 3) + basePriorityForSector(line - 1, column + 1, 3) + basePriorityForSector(line + 1, column - 1, 3) ); } } }
public void findPriority(Bulk current_bulk) { foreach (Bulk bulk in bulkes) { if (bulk != current_bulk) { if (bulk.getRadius() < current_bulk.getRadius() - Settings.BulkOffsetRadius) { sumFeed += bulk.getFeed(); } else { basePriority += BIG_BULK; } } } basePriority += (int)Math.Min(Settings.MaxTotalFeed / sumFeed, EMPTY); }
public void checkBulk(Bulk bulk) { bulkes.Add(bulk); }