Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.95 KB | None | 0 0
  1. //Add new lim 7 (Сумма свойств объектов соседей должна быть не больше К)
  2.     int offset = 4;
  3.     bdd temp1;
  4.  
  5.     for (int i = 0; i < NUMB_OF_OBJ; i++)
  6.     {
  7.         for (int l = 0; l < NUMB_OF_OBJ - 3; l++) // идём по всем объектам, если объект - это сосед, то запускаем цикл по комбинациям свойств
  8.         {
  9.             if ((i - offset == l) || (i + offset == l)) // новый сосед
  10.             {
  11.                 temp1 = bddfalse;
  12.  
  13.                 for (int j1 = 0; j1 < NUMB_OF_OBJ; j1++)
  14.                 {
  15.                     for (int j2 = 0; j2 < NUMB_OF_OBJ; j2++)
  16.                     {
  17.                         for (int j3 = 0; j3 < NUMB_OF_OBJ; j3++)
  18.                         {
  19.                             for (int j4 = 0; j4 < NUMB_OF_OBJ; j4++)
  20.                             {
  21.                                 if (j1 + j2 + j3 + j4 < K)
  22.                                 {
  23.                                     temp1 |= p1[l][j1] & p2[l][j2] & p3[l][j3] & p4[l][j4];
  24.                                 }
  25.                             }
  26.                         }
  27.                     }
  28.                 }
  29.                 mainTask &= temp1; // комплектация соседа
  30.             }
  31.         }
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement