Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Add new lim 7 (Сумма свойств объектов соседей должна быть не больше К)
- int offset = 4;
- bdd temp1;
- for (int i = 0; i < NUMB_OF_OBJ; i++)
- {
- for (int l = 0; l < NUMB_OF_OBJ - 3; l++) // идём по всем объектам, если объект - это сосед, то запускаем цикл по комбинациям свойств
- {
- if ((i - offset == l) || (i + offset == l)) // новый сосед
- {
- temp1 = bddfalse;
- for (int j1 = 0; j1 < NUMB_OF_OBJ; j1++)
- {
- for (int j2 = 0; j2 < NUMB_OF_OBJ; j2++)
- {
- for (int j3 = 0; j3 < NUMB_OF_OBJ; j3++)
- {
- for (int j4 = 0; j4 < NUMB_OF_OBJ; j4++)
- {
- if (j1 + j2 + j3 + j4 < K)
- {
- temp1 |= p1[l][j1] & p2[l][j2] & p3[l][j3] & p4[l][j4];
- }
- }
- }
- }
- }
- mainTask &= temp1; // комплектация соседа
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement