Thanks, Rob, for your prompt response. I implemented your suggestion (correctly, I hope) but a NOTE (at line131): indicates that "Constraint CHI_constraint[USL000] causes the problem to be infeasible. The MILP presolver found this problem to be infeasible." The logfile is below.
Thanks for taking a look at this,
Gene
72 Proc Optmodel;
73 options fullstimer;
74 /* Read CoverageMatrix data into index sets*/
75 set <str> stations;
76 read data work.station_id into stations=[station];
NOTE: There were 8 observations read from the data set WORK.STATION_ID.
77
78 set Station_Pairs={<'US000S','US001R'>,<'US000V','US001Q'>};
79
80 set <str> ORIENTATION_STRING=/'45/35' '90/35' '135/35' '180/35' '225/35' '270/35' '315/35' '360/35' /;
81 set ORIENTATIONS = setof {s in orientation_string}
82 <input(scan(s,1,'/'),best.),input(scan(s,2,'/'),best.)>;
83 put orientations=;
ORIENTATIONS={<45,35>,<90,35>,<135,35>,<180,35>,<225,35>,<270,35>,<315,35>,<360,35>}
84
85
86
87 set <str> Targets;
88 read data work.targets into TARGETS=[target];
NOTE: There were 195228 observations read from the data set WORK.TARGETS.
89 num Matrix {stations, ORIENTATION_string, TARGETS};
90 read data work.RoO_Matrix into [station orientation_string target]
91 Matrix=k;
NOTE: There were 12494592 observations read from the data set WORK.ROO_MATRIX.
92
93 /* Set Constants*/
94 /* optimal number of cameras covering each target*/
95 %Let k=3;
96 num k=&k;
SYMBOLGEN: Macro variable K resolves to 3
97
98 /*Declare Variables*/
99 var CHI {stations, ORIENTATIONS} binary;
100
101 var IsTriplyCovered {TARGETS} binary;
102 impvar XIT{target in TARGETS}=sum{station in stations, <a,e> in
103 orientations} matrix[station, a||'/'||e, target] *Chi[station,a,e];
104 fix CHI['USL000',45,35]=1;
105 fix CHI['USL000',90,35]=1;
106 fix CHI['USL000',135,35]=1;
107 fix CHI['USL000',180,35]=1;
108 fix CHI['USL000',225,35]=1;
109 fix CHI['USL000',270,35]=1;
110 fix CHI['USL000',315,35]=1;
111 fix CHI['USL000',360,35]=1;
112 /* Declare Model*/
113 max NumTriplyCovered=sum{t in TARGETS} IsTriplyCovered[t];
114
115 /*Subject to Following Constraints*/
116 con CHI_constraint {station in stations}:
117 sum{<a,e> in ORIENTATIONS}CHI[station,a,e] <=1;
118
119 con TriplyCoveredCon {t in TARGETS}: XIT[t] >=k * IsTriplyCovered[t];
120
121 set AZIMUTHS = setof {<a,e> in ORIENTATIONS} a;
122 put AZIMUTHS=;
AZIMUTHS={45,90,135,180,225,270,315,360}
123 set AZIMUTH_PAIRS = {a1 in AZIMUTHS, a2 in AZIMUTHS: mod(a1-a2+360,360) <= 45};
124 put AZIMUTH_PAIRS=;
AZIMUTH_PAIRS={<45,45>,<45,360>,<90,45>,<90,90>,<135,90>,<135,135>,<180,135>,<180,180>,<225,180>,<225,225>,<270,225>,<270,270>,<315,
270>,<315,315>,<360,315>,<360,360>}
125
126 con NotAdjacentAzimuths {<s1,s2> in STATION_PAIRS, <a1,a2> in AZIMUTH_PAIRS}:
127 sum {<a,e> in ORIENTATIONS: a in {a1,a2}} (CHI[s1,a,e] + CHI[s2,a,e]) <= 1;
128 /* expand; */
129
130 /* Call Solver and Save Results:*/
131 solve with milp/ heuristics=2 presolver=3 relobjgap=0.0;
NOTE: Problem generation will use 2 threads.
NOTE: The problem has 195292 variables (0 free, 8 fixed).
NOTE: The problem uses 195228 implicit variables.
NOTE: The problem has 195292 binary and 0 integer variables.
NOTE: The problem has 195268 linear constraints (40 LE, 0 EQ, 195228 GE, 0 range).
NOTE: The problem has 1142932 linear constraint coefficients.
NOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range).
NOTE: The MILP presolver value AGGRESSIVE is applied.
NOTE: Constraint CHI_constraint[USL000] causes the problem to be infeasible.
NOTE: The MILP presolver found this problem to be infeasible.
132 create data work.OptimalSolution_&RoO from
_
22
WARNING: Apparent symbolic reference ROO not resolved.
132 create data work.OptimalSolution_&RoO from
_
200
ERROR 22-322: Syntax error, expecting one of the following: (, FROM.
ERROR 200-322: The symbol is not recognized and will be ignored.
132 create data work.OptimalSolution_&RoO from
___
525
ERROR 525-782: The symbol 'RoO' is unknown.
132 create data work.OptimalSolution_&RoO from
____
525
ERROR 525-782: The symbol 'from' is unknown.
133 [station a e]={c in stations, <a,e> in orientations: CHI[c,a,e]>0.5} CHI;
_ ___
22 79
202 583
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, ',', -, .., /, <, <=, <>, =, >, ><, >=, AND, BY,
CROSS, DIFF, ELSE, IN, INTER, NOT, OR, SYMDIFF, TO, UNION, WITHIN, [, ], ^, ^=, |, ||, ~, ~=.
ERROR 79-322: Expecting a ].
ERROR 202-322: The option or parameter is not recognized and will be ignored.
ERROR 583-782: The implied subscript count does not match array 'CHI', 0 NE 3.
_______ _
525 599
ERROR 525-782: The symbol 'station' is unknown.
ERROR 599-782: The operand types for '=' are mismatched, found a number and a set.
133 ! [station a e]={c in stations, <a,e> in orientations: CHI[c,a,e]>0.5} CHI;
_
525
ERROR 525-782: The symbol 'e' is unknown.
134 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE OPTMODEL used (Total process time):
real time 42.47 seconds
user cpu time 53.38 seconds
system cpu time 2.45 seconds
memory 2419788.07k
OS Memory 2577124.00k
Timestamp 12/13/2021 08:41:55 PM
Step Count 73 Switch Count 56
Page Faults 0
Page Reclaims 743338
Page Swaps 0
Voluntary Context Switches 6196
Involuntary Context Switches 144
Block Input Operations 0
Block Output Operations 40
135 /*Print Results*/
136
136 ! proc print data=work.optimalsolution_&RoO;
WARNING: Apparent symbolic reference ROO not resolved.
136 proc print data=work.optimalsolution_&RoO;
_
22
ERROR 22-322: Syntax error, expecting one of the following: ;, (, BLANKLINE, CONTENTS, DATA, DOUBLE, GRANDTOTAL_LABEL,
GRANDTOT_LABEL, GRAND_LABEL, GTOTAL_LABEL, GTOT_LABEL, HEADING, LABEL, N, NOOBS, NOSUMLABEL, OBS, ROUND, ROWS, SPLIT,
STYLE, SUMLABEL, UNIFORM, WIDTH.
136 proc print data=work.optimalsolution_&RoO;
_
200
ERROR 200-322: The symbol is not recognized and will be ignored.
WARNING: Apparent symbolic reference ROO not resolved.
ERROR: File WORK.OPTIMALSOLUTION_.DATA does not exist.
137 Title "Optimal Solution RoO=&RoO x &RoO km";
WARNING: Apparent symbolic reference ROO not resolved.
WARNING: Apparent symbolic reference ROO not resolved.
138 run;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 225.06k
OS Memory 77412.00k
Timestamp 12/13/2021 08:41:55 PM
Step Count 74 Switch Count 1
Page Faults 0
Page Reclaims 31
Page Swaps 0
Voluntary Context Switches 10
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
139 /* Create Macro Variables for Station and Optimal Solution*/
140
140 ! data macrovariables;
141 set optimalsolution_&RoO;
_
22
200
WARNING: Apparent symbolic reference ROO not resolved.
ERROR: File WORK.OPTIMALSOLUTION_.DATA does not exist.
ERROR: File WORK.ROO.DATA does not exist.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, CUROBS, END, INDSNAME, KEY,
KEYRESET, KEYS, NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.
ERROR 200-322: The symbol is not recognized and will be ignored.
142 suffix=put(_n_,5.);
143 call symput (cats('Sta_Code',suffix),Station);
144 call symput (cats('Opt_Orientation',suffix),catx('/',a,e));
145 run;
NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
143:43
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.MACROVARIABLES may be incomplete. When this step was stopped there were 0 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 649.50k
OS Memory 77672.00k
Timestamp 12/13/2021 08:41:55 PM
Step Count 75 Switch Count 2
Page Faults 0
Page Reclaims 91
Page Swaps 0
Voluntary Context Switches 11
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
146
147 data plot;
148 set RoO_Matrix;
149 where k>=1;
150 x=input(scan(target,1,'/'),8.);
151 y=input(scan(target,2,'/'),8.);
152 z=input(scan(target,3,'/'),8.);
153 run;
NOTE: There were 947544 observations read from the data set WORK.ROO_MATRIX.
WHERE k>=1;
NOTE: The data set WORK.PLOT has 947544 observations and 7 variables.
NOTE: DATA statement used (Total process time):
real time 0.74 seconds
user cpu time 0.57 seconds
system cpu time 0.17 seconds
memory 3447.31k
OS Memory 80492.00k
Timestamp 12/13/2021 08:41:56 PM
Step Count 76 Switch Count 5
Page Faults 0
Page Reclaims 543
Page Swaps 0
Voluntary Context Switches 20
Involuntary Context Switches 158
Block Input Operations 0
Block Output Operations 133640
154 proc sort data=plot;
155 by z descending station orientation_string;
156 run;
NOTE: There were 947544 observations read from the data set WORK.PLOT.
NOTE: The data set WORK.PLOT has 947544 observations and 7 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.38 seconds
user cpu time 0.64 seconds
system cpu time 0.18 seconds
memory 132041.67k
OS Memory 208648.00k
Timestamp 12/13/2021 08:41:56 PM
Step Count 77 Switch Count 8
Page Faults 0
Page Reclaims 32131
Page Swaps 0
Voluntary Context Switches 3296
Involuntary Context Switches 12
Block Input Operations 0
Block Output Operations 133640
157 ods graphics / reset width=6.4in height=6.4in;
158 proc sgplot data=plot aspect=1;
159 by z;
160 where ((station="&Sta_Code1" and orientation_string= "&Opt_Orientation1") or
WARNING: Apparent symbolic reference STA_CODE1 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION1 not resolved.
161 (station="&Sta_Code2" and orientation_string="&Opt_Orientation2") or
WARNING: Apparent symbolic reference STA_CODE2 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION2 not resolved.
162 (station="&Sta_Code3" and orientation_string="&Opt_Orientation3") or
WARNING: Apparent symbolic reference STA_CODE3 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION3 not resolved.
163 (station="&Sta_Code4" and orientation_string="&Opt_Orientation4") or
WARNING: Apparent symbolic reference STA_CODE4 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION4 not resolved.
164 (station="&Sta_Code5" and orientation_string="&Opt_Orientation5") or
WARNING: Apparent symbolic reference STA_CODE5 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION5 not resolved.
165 (station="&Sta_Code6" and orientation_string="&Opt_Orientation6") or
WARNING: Apparent symbolic reference STA_CODE6 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION6 not resolved.
166 (station="&Sta_Code7" and orientation_string="&Opt_Orientation7") or
WARNING: Apparent symbolic reference STA_CODE7 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION7 not resolved.
167 (station="&Sta_Code8" and orientation_string="&Opt_Orientation8") or
WARNING: Apparent symbolic reference STA_CODE8 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION8 not resolved.
168 (station="&Sta_Code9" and orientation_string="&Opt_Orientation9") or
WARNING: Apparent symbolic reference STA_CODE9 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION9 not resolved.
169 (station="&Sta_Code10" and orientation_string="&Opt_Orientation10") or
WARNING: Apparent symbolic reference STA_CODE10 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION10 not resolved.
170 (station="&Sta_Code11" and orientation_string="&Opt_Orientation11") or
WARNING: Apparent symbolic reference STA_CODE11 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION11 not resolved.
171 (station="&Sta_Code12" and orientation_string="&Opt_Orientation12") or
WARNING: Apparent symbolic reference STA_CODE12 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION12 not resolved.
172 (station="&Sta_Code13" and orientation_string="&Opt_Orientation13") or
WARNING: Apparent symbolic reference STA_CODE13 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION13 not resolved.
173 (station="&Sta_Code14" and orientation_string="&Opt_Orientation14") or
WARNING: Apparent symbolic reference STA_CODE14 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION14 not resolved.
174 (station="&Sta_Code15" and orientation_string="&Opt_Orientation15"));
WARNING: Apparent symbolic reference STA_CODE15 not resolved.
WARNING: Apparent symbolic reference OPT_ORIENTATION15 not resolved.
175
176 Title "New Azimuth (N),New Elevation Angles by Level";
177 scatter x=x y=y /group=station transparency=.85 markerattrs=(symbol=circlefilled);
178 xaxis grid min=-800 max=800;
179 yaxis grid min=-800 max=800;
180 run;
NOTE: There were 0 observations read from the data set WORK.PLOT.
WHERE 0 /* an obviously FALSE WHERE clause */ ;
NOTE: PROCEDURE SGPLOT used (Total process time):
real time 0.00 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 1947.00k
OS Memory 79720.00k
Timestamp 12/13/2021 08:41:56 PM
Step Count 78 Switch Count 1
Page Faults 0
Page Reclaims 312
Page Swaps 0
Voluntary Context Switches 6
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 8
181
182
183
184 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
SYMBOLGEN: Macro variable GRAPHTERM resolves to GOPTIONS NOACCESSIBLE;
194
User: u44673568
... View more