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 % -------------------------------------------------------------------------
18 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19 % Parameters and its assertions
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22 % Number of cells/radios.
25 % Maximum number of Physical Cell Identifiers to be assigned to the nodes.
28 % Number of edges between neighbor nodes. There is a edge (i,j) if and only
29 % if nodes i and j are neighbors, i.e., an user equipment (UE) can make
30 % handoff between i and j. Such edges are used to avoid **CONFLICTS**, i.e.,
31 % to guarantee that nodes i and j have different PCIs.
32 int: NUM_CONFLICT_EDGES;
34 % Each line represents an edge between direct neighbors as defined before.
35 array[1..NUM_CONFLICT_EDGES, 1..2] of int: CONFLICT_EDGES;
37 % Number of undirect neighbor pairs (j, k) such that both j and k are direct
38 % neighbors of node i, i.e., (j, k) exits if and only if exists (i, j) and
39 % (i, k). Nodes (i, k) can generate "confunsions" in the network if they have
40 % the same PCI. Such edges are used to avoid/minimize **CONFUSIONS**.
41 int: NUM_CONFUSION_EDGES;
43 % Each line represents an edge between undirect neighbors as defined before.
44 array[1..NUM_CONFUSION_EDGES, 1..2] of int: CONFUSION_EDGES;
46 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 % Defines the PCI for each node.
51 array[0..NUM_NODES-1] of var 0..NUM_PCIS-1: pci;
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 % Direct neighbors must have different PCIs for avoid **CONFLICTS**.
59 forall(i in 1..NUM_CONFLICT_EDGES)(
60 pci[CONFLICT_EDGES[i, 1]] != pci[CONFLICT_EDGES[i, 2]]
63 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
67 % Total number of confusions.
68 var int: total_confusions =
69 sum([bool2int(pci[CONFUSION_EDGES[i, 1]] == pci[CONFUSION_EDGES[i, 2]])
70 | i in 1..NUM_CONFUSION_EDGES]);
72 % Minimize the total number of confusions.
73 solve :: int_search(pci, smallest, indomain_min, complete)
74 minimize total_confusions;
76 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
78 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
84 "\n" ++ show(node) ++ "," ++ show(pci[node])
85 | node in 0..NUM_NODES-1
89 ["\nTotal confusions: " ++ show(total_confusions)] ++
90 ["\nConfusion pairs"] ++
92 "\n" ++ show(CONFUSION_EDGES[i, 1]) ++ "," ++ show(CONFUSION_EDGES[i, 2])
93 | i in 1..NUM_CONFUSION_EDGES where
94 fix(pci[CONFUSION_EDGES[i, 1]] == pci[CONFUSION_EDGES[i, 2]])