1 % -------------------------------------------------------------------------
2 % Copyright (c) 2018 AT&T Intellectual Property
4 % Licensed under the Apache License, Version 2.0 (the "License");
5 % you may not use this file except in compliance with the License.
6 % You may obtain a copy of the License at
8 % http://www.apache.org/licenses/LICENSE-2.0
10 % Unless required by applicable law or agreed to in writing, software
11 % distributed under the License is distributed on an "AS IS" BASIS,
12 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 % See the License for the specific language governing permissions and
14 % limitations under the License.
16 % -------------------------------------------------------------------------
19 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20 % Parameters and its assertions
21 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23 % Number of cells/radios.
26 % Maximum number of Physical Cell Identifiers to be assigned to the nodes.
29 % Number of edges between neighbor nodes. There is a edge (i,j) if and only
30 % if nodes i and j are neighbors, i.e., an user equipment (UE) can make
31 % handoff between i and j. Such edges are used to avoid **COLLISION**, i.e.,
32 % to guarantee that nodes i and j have different PCIs.
35 % Each line represents an edge between direct neighbors as defined before.
36 array[1..NUM_NEIGHBORS, 1..2] of int: NEIGHBORS;
38 % Number of undirect neighbor pairs (j, k) such that both j and k are direct
39 % neighbors of node i, i.e., (j, k) exits if and only if exists (i, j) and
40 % (i, k). Nodes (i, k) can generate "confunsions" in the network if they have
41 % the same PCI. Such edges are used to avoid/minimize **CONFUSIONS**.
42 int: NUM_SECOND_LEVEL_NEIGHBORS;
44 % Each line represents an edge between undirect neighbors as defined before.
45 array[1..NUM_SECOND_LEVEL_NEIGHBORS, 1..2] of int: SECOND_LEVEL_NEIGHBORS;
47 % Number of ignorable neighbor links. Such links can be ignored during
48 % optimization if needed.
49 int: NUM_IGNORABLE_NEIGHBOR_LINKS;
51 % The links that can be ignored if needed. Each line represents the two ends
52 % of the links, like the previous structures.
53 array[1..NUM_IGNORABLE_NEIGHBOR_LINKS, 1..2] of int: IGNORABLE_NEIGHBOR_LINKS;
55 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59 % Defines the PCI for each node.
60 array[0..NUM_NODES-1] of var 0..NUM_PCIS-1: pci;
62 array[1..NUM_IGNORABLE_NEIGHBOR_LINKS] of var 0..1: used_ignorables;
64 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
68 % Direct neighbors must have different PCIs for avoid **COLLISION**.
71 forall(i in 1..NUM_NEIGHBORS, j in 1..NUM_IGNORABLE_NEIGHBOR_LINKS
73 NEIGHBORS[i, 1] != IGNORABLE_NEIGHBOR_LINKS[j, 1] \/
74 NEIGHBORS[i, 2] != IGNORABLE_NEIGHBOR_LINKS[j, 2]
76 pci[NEIGHBORS[i, 1]] != pci[NEIGHBORS[i, 2]]
82 forall(i in 1..NUM_NEIGHBORS, j in 1..NUM_IGNORABLE_NEIGHBOR_LINKS
84 NEIGHBORS[i, 1] == IGNORABLE_NEIGHBOR_LINKS[j, 1] /\
85 NEIGHBORS[i, 2] == IGNORABLE_NEIGHBOR_LINKS[j, 2]
87 used_ignorables[j] >= bool2int(pci[NEIGHBORS[i, 1]] == pci[NEIGHBORS[i, 2]])
90 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
94 % Total number of confusions.
95 var int: total_confusions =
96 sum([bool2int(pci[SECOND_LEVEL_NEIGHBORS[i, 1]] ==
97 pci[SECOND_LEVEL_NEIGHBORS[i, 2]])
98 | i in 1..NUM_SECOND_LEVEL_NEIGHBORS]);
100 % Total number of used ignorables links.
101 var int: total_used_ignorables = sum(used_ignorables);
103 solve :: int_search(pci, smallest, indomain_min, complete)
105 % Minimize the total number of confusions.
106 %minimize total_confusions;
108 % Minimize the total number of confusions first,
109 % then the number of used ignorables links.
110 minimize (2 * NUM_IGNORABLE_NEIGHBOR_LINKS * total_confusions) +
111 total_used_ignorables;
113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
121 "\n" ++ show(node) ++ "," ++ show(pci[node])
122 | node in 0..NUM_NODES-1
124 ["\n\nTotal used ignorables links: " ++ show(total_used_ignorables)] ++
125 ["\nUsed ignorables links: "] ++
127 "\n" ++ show(IGNORABLE_NEIGHBOR_LINKS[i, 1]) ++
128 "," ++ show(IGNORABLE_NEIGHBOR_LINKS[i, 2])
129 | i in 1..NUM_IGNORABLE_NEIGHBOR_LINKS where fix(used_ignorables[i] > 0)
131 ["\n\nConfusions"] ++
132 ["\nTotal confusions: " ++ show(total_confusions)] ++
133 ["\nConfusion pairs"] ++
135 "\n" ++ show(SECOND_LEVEL_NEIGHBORS[i, 1]) ++ "," ++
136 show(SECOND_LEVEL_NEIGHBORS[i, 2])
137 | i in 1..NUM_SECOND_LEVEL_NEIGHBORS where
138 fix(pci[SECOND_LEVEL_NEIGHBORS[i, 1]] == pci[SECOND_LEVEL_NEIGHBORS[i, 2]])