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 % ids of cells for which the pci should remain unchanged
56 set of int: PCI_UNCHANGEABLE_CELLS;
58 % This array has the original pcis of all the cells. array is indexed by the ids
59 % of the cell. eg. ORIGINAL_PCIS[3] returns the pci of cell whose id is 3.
61 array[1..NUM_NODES] of 0..NUM_PCIS-1: ORIGINAL_PCIS;
63 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
67 % Defines the PCI for each node.
68 array[0..NUM_NODES-1] of var 0..NUM_PCIS-1: pci;
70 array[1..NUM_IGNORABLE_NEIGHBOR_LINKS] of var 0..1: used_ignorables;
72 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
74 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
78 if(length(PCI_UNCHANGEABLE_CELLS) !=0) then
79 forall(i in PCI_UNCHANGEABLE_CELLS)(
80 pci[i] == ORIGINAL_PCIS[i+1]
84 % Direct neighbors must have different PCIs for avoid **COLLISION**.
87 forall(i in 1..NUM_NEIGHBORS, j in 1..NUM_IGNORABLE_NEIGHBOR_LINKS
89 NEIGHBORS[i, 1] != IGNORABLE_NEIGHBOR_LINKS[j, 1] \/
90 NEIGHBORS[i, 2] != IGNORABLE_NEIGHBOR_LINKS[j, 2]
92 pci[NEIGHBORS[i, 1]] != pci[NEIGHBORS[i, 2]]
98 forall(i in 1..NUM_NEIGHBORS, j in 1..NUM_IGNORABLE_NEIGHBOR_LINKS
100 NEIGHBORS[i, 1] == IGNORABLE_NEIGHBOR_LINKS[j, 1] /\
101 NEIGHBORS[i, 2] == IGNORABLE_NEIGHBOR_LINKS[j, 2]
103 used_ignorables[j] >= bool2int(pci[NEIGHBORS[i, 1]] == pci[NEIGHBORS[i, 2]])
106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
110 % Total number of confusions.
111 var int: total_confusions =
112 sum([bool2int(pci[SECOND_LEVEL_NEIGHBORS[i, 1]] ==
113 pci[SECOND_LEVEL_NEIGHBORS[i, 2]])
114 | i in 1..NUM_SECOND_LEVEL_NEIGHBORS]);
116 % Total number of used ignorables links.
117 var int: total_used_ignorables = sum(used_ignorables);
119 solve :: int_search(pci, smallest, indomain_min, complete)
121 % Minimize the total number of confusions.
122 %minimize total_confusions;
124 % Minimize the total number of confusions first,
125 % then the number of used ignorables links.
126 minimize (2 * NUM_IGNORABLE_NEIGHBOR_LINKS * total_confusions) +
127 total_used_ignorables;
129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
137 "\n" ++ show(node) ++ "," ++ show(pci[node])
138 | node in 0..NUM_NODES-1
140 ["\n\nTotal used ignorables links: " ++ show(total_used_ignorables)] ++
141 ["\nUsed ignorables links: "] ++
143 "\n" ++ show(IGNORABLE_NEIGHBOR_LINKS[i, 1]) ++
144 "," ++ show(IGNORABLE_NEIGHBOR_LINKS[i, 2])
145 | i in 1..NUM_IGNORABLE_NEIGHBOR_LINKS where fix(used_ignorables[i] > 0)
147 ["\n\nConfusions"] ++
148 ["\nTotal confusions: " ++ show(total_confusions)] ++
149 ["\nConfusion pairs"] ++
151 "\n" ++ show(SECOND_LEVEL_NEIGHBORS[i, 1]) ++ "," ++
152 show(SECOND_LEVEL_NEIGHBORS[i, 2])
153 | i in 1..NUM_SECOND_LEVEL_NEIGHBORS where
154 fix(pci[SECOND_LEVEL_NEIGHBORS[i, 1]] == pci[SECOND_LEVEL_NEIGHBORS[i, 2]])