Пример #1
0
 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)
                 );
         }
     }
 }
Пример #2
0
 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);
 }
Пример #3
0
 public void checkBulk(Bulk bulk)
 {
     bulkes.Add(bulk);
 }