#  MINLP written by GAMS Convert at 04/21/18 13:52:42
#
#  Equation counts
#      Total        E        G        L        N        X        C        B
#        318      234        0       84        0        0        0        0
#
#  Variable counts
#                   x        b        i      s1s      s2s       sc       si
#      Total     cont   binary  integer     sos1     sos2    scont     sint
#        352      184      168        0        0        0        0        0
#  FX      0        0        0        0        0        0        0        0
#
#  Nonzero counts
#      Total    const       NL      DLL
#       3385      521     2864        0
#
#  Reformulation has removed 1 variable and 1 equation

from pyomo.environ import *

model = m = ConcreteModel()

m.x1 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x2 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x3 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x4 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x5 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x6 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x7 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x8 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x9 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x10 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x11 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x12 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x13 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x14 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x15 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x16 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x17 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x18 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x19 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x20 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x21 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x22 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x23 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x24 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x25 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x26 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x27 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x28 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x29 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x30 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x31 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x32 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x33 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x34 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x35 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x36 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x37 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x38 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x39 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x40 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x41 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x42 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x43 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x44 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x45 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x46 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x47 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x48 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x49 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x50 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x51 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x52 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x53 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x54 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x55 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x56 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x57 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x58 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x59 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x60 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x61 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x62 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x63 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x64 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x65 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x66 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x67 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x68 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x69 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x70 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x71 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x72 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x73 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x74 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x75 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x76 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x77 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x78 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x79 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x80 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x81 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x82 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x83 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x84 = Var(within=Reals,bounds=(0,None),initialize=0.0892857142857143)
m.x85 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x86 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x87 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x88 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x89 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x90 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x91 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x92 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x93 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x94 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x95 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x96 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x97 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x98 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x99 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x100 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x101 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x102 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x103 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x104 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x105 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x106 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x107 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x108 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x109 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x110 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x111 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x112 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x113 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x114 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x115 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x116 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x117 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x118 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x119 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x120 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x121 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x122 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x123 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x124 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x125 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x126 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x127 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x128 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x129 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x130 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x131 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x132 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x133 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x134 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x135 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x136 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x137 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x138 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x139 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x140 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x141 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x142 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x143 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x144 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x145 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x146 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x147 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x148 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x149 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x150 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x151 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x152 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x153 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x154 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x155 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x156 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x157 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x158 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x159 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x160 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x161 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x162 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x163 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x164 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x165 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x166 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x167 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x168 = Var(within=Reals,bounds=(0,None),initialize=1.25)
m.x169 = Var(within=Reals,bounds=(0,None),initialize=0.956145)
m.x170 = Var(within=Reals,bounds=(0,None),initialize=0.956145)
m.x171 = Var(within=Reals,bounds=(0,None),initialize=0.956145)
m.x172 = Var(within=Reals,bounds=(0,None),initialize=0.956145)
m.x173 = Var(within=Reals,bounds=(0,None),initialize=0.956145)
m.x174 = Var(within=Reals,bounds=(0,None),initialize=0.956145)
m.b175 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b176 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b177 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b178 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b179 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b180 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b181 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b182 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b183 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b184 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b185 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b186 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b187 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b188 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b189 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b190 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b191 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b192 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b193 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b194 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b195 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b196 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b197 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b198 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b199 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b200 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b201 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b202 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b203 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b204 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b205 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b206 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b207 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b208 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b209 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b210 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b211 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b212 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b213 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b214 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b215 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b216 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b217 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b218 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b219 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b220 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b221 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b222 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b223 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b224 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b225 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b226 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b227 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b228 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b229 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b230 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b231 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b232 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b233 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b234 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b235 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b236 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b237 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b238 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b239 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b240 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b241 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b242 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b243 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b244 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b245 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b246 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b247 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b248 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b249 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b250 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b251 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b252 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b253 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b254 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b255 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b256 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b257 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b258 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b259 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b260 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b261 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b262 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b263 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b264 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b265 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b266 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b267 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b268 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b269 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b270 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b271 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b272 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b273 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b274 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b275 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b276 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b277 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b278 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b279 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b280 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b281 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b282 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b283 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b284 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b285 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b286 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b287 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b288 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b289 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b290 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b291 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b292 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b293 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b294 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b295 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b296 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b297 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b298 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b299 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b300 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b301 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b302 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b303 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b304 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b305 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b306 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b307 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b308 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b309 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b310 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b311 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b312 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b313 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b314 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b315 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b316 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b317 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b318 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b319 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b320 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b321 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b322 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b323 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b324 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b325 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b326 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b327 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b328 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b329 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b330 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b331 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b332 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b333 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b334 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b335 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b336 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b337 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b338 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b339 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b340 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b341 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.b342 = Var(within=Binary,bounds=(0,1),initialize=0.0714285714285714)
m.x344 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x345 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x346 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x347 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x348 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x349 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x350 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x351 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x352 = Var(within=Reals,bounds=(None,None),initialize=0)

m.obj = Objective(expr= - m.x174, sense=minimize)

m.c2 = Constraint(expr=   0.5*m.b175 + m.b187 + m.b199 + m.b211 + m.b223 + m.b235 + 0.5*m.b247 + m.b259 + m.b271
                        + m.b283 + 0.5*m.b295 + m.b307 + m.b319 + 0.5*m.b331 == 1)

m.c3 = Constraint(expr=   0.5*m.b176 + m.b188 + m.b200 + m.b212 + m.b224 + m.b236 + 0.5*m.b248 + m.b260 + m.b272
                        + m.b284 + 0.5*m.b296 + m.b308 + m.b320 + 0.5*m.b332 == 1)

m.c4 = Constraint(expr=   0.5*m.b177 + m.b189 + m.b201 + m.b213 + m.b225 + m.b237 + 0.5*m.b249 + m.b261 + m.b273
                        + m.b285 + 0.5*m.b297 + m.b309 + m.b321 + 0.5*m.b333 == 1)

m.c5 = Constraint(expr=   0.5*m.b178 + m.b190 + m.b202 + m.b214 + m.b226 + m.b238 + 0.5*m.b250 + m.b262 + m.b274
                        + m.b286 + 0.5*m.b298 + m.b310 + m.b322 + 0.5*m.b334 == 1)

m.c6 = Constraint(expr=   0.5*m.b179 + m.b191 + m.b203 + m.b215 + m.b227 + m.b239 + 0.5*m.b251 + m.b263 + m.b275
                        + m.b287 + 0.5*m.b299 + m.b311 + m.b323 + 0.5*m.b335 == 1)

m.c7 = Constraint(expr=   0.5*m.b180 + m.b192 + m.b204 + m.b216 + m.b228 + m.b240 + 0.5*m.b252 + m.b264 + m.b276
                        + m.b288 + 0.5*m.b300 + m.b312 + m.b324 + 0.5*m.b336 == 1)

m.c8 = Constraint(expr=   0.5*m.b181 + m.b193 + m.b205 + m.b217 + m.b229 + m.b241 + 0.5*m.b253 + m.b265 + m.b277
                        + m.b289 + 0.5*m.b301 + m.b313 + m.b325 + 0.5*m.b337 == 1)

m.c9 = Constraint(expr=   0.5*m.b182 + m.b194 + m.b206 + m.b218 + m.b230 + m.b242 + 0.5*m.b254 + m.b266 + m.b278
                        + m.b290 + 0.5*m.b302 + m.b314 + m.b326 + 0.5*m.b338 == 1)

m.c10 = Constraint(expr=   0.5*m.b183 + m.b195 + m.b207 + m.b219 + m.b231 + m.b243 + 0.5*m.b255 + m.b267 + m.b279
                         + m.b291 + 0.5*m.b303 + m.b315 + m.b327 + 0.5*m.b339 == 1)

m.c11 = Constraint(expr=   0.5*m.b184 + m.b196 + m.b208 + m.b220 + m.b232 + m.b244 + 0.5*m.b256 + m.b268 + m.b280
                         + m.b292 + 0.5*m.b304 + m.b316 + m.b328 + 0.5*m.b340 == 1)

m.c12 = Constraint(expr=   0.5*m.b185 + m.b197 + m.b209 + m.b221 + m.b233 + m.b245 + 0.5*m.b257 + m.b269 + m.b281
                         + m.b293 + 0.5*m.b305 + m.b317 + m.b329 + 0.5*m.b341 == 1)

m.c13 = Constraint(expr=   0.5*m.b186 + m.b198 + m.b210 + m.b222 + m.b234 + m.b246 + 0.5*m.b258 + m.b270 + m.b282
                         + m.b294 + 0.5*m.b306 + m.b318 + m.b330 + 0.5*m.b342 == 1)

m.c14 = Constraint(expr=   m.b175 + m.b176 + m.b177 + m.b178 + m.b179 + m.b180 + m.b181 + m.b182 + m.b183 + m.b184
                         + m.b185 + m.b186 == 1)

m.c15 = Constraint(expr=   m.b187 + m.b188 + m.b189 + m.b190 + m.b191 + m.b192 + m.b193 + m.b194 + m.b195 + m.b196
                         + m.b197 + m.b198 == 1)

m.c16 = Constraint(expr=   m.b199 + m.b200 + m.b201 + m.b202 + m.b203 + m.b204 + m.b205 + m.b206 + m.b207 + m.b208
                         + m.b209 + m.b210 == 1)

m.c17 = Constraint(expr=   m.b211 + m.b212 + m.b213 + m.b214 + m.b215 + m.b216 + m.b217 + m.b218 + m.b219 + m.b220
                         + m.b221 + m.b222 == 1)

m.c18 = Constraint(expr=   m.b223 + m.b224 + m.b225 + m.b226 + m.b227 + m.b228 + m.b229 + m.b230 + m.b231 + m.b232
                         + m.b233 + m.b234 == 1)

m.c19 = Constraint(expr=   m.b235 + m.b236 + m.b237 + m.b238 + m.b239 + m.b240 + m.b241 + m.b242 + m.b243 + m.b244
                         + m.b245 + m.b246 == 1)

m.c20 = Constraint(expr=   m.b247 + m.b248 + m.b249 + m.b250 + m.b251 + m.b252 + m.b253 + m.b254 + m.b255 + m.b256
                         + m.b257 + m.b258 == 1)

m.c21 = Constraint(expr=   m.b259 + m.b260 + m.b261 + m.b262 + m.b263 + m.b264 + m.b265 + m.b266 + m.b267 + m.b268
                         + m.b269 + m.b270 == 1)

m.c22 = Constraint(expr=   m.b271 + m.b272 + m.b273 + m.b274 + m.b275 + m.b276 + m.b277 + m.b278 + m.b279 + m.b280
                         + m.b281 + m.b282 == 1)

m.c23 = Constraint(expr=   m.b283 + m.b284 + m.b285 + m.b286 + m.b287 + m.b288 + m.b289 + m.b290 + m.b291 + m.b292
                         + m.b293 + m.b294 == 1)

m.c24 = Constraint(expr=   m.b295 + m.b296 + m.b297 + m.b298 + m.b299 + m.b300 + m.b301 + m.b302 + m.b303 + m.b304
                         + m.b305 + m.b306 == 1)

m.c25 = Constraint(expr=   m.b307 + m.b308 + m.b309 + m.b310 + m.b311 + m.b312 + m.b313 + m.b314 + m.b315 + m.b316
                         + m.b317 + m.b318 == 1)

m.c26 = Constraint(expr=   m.b319 + m.b320 + m.b321 + m.b322 + m.b323 + m.b324 + m.b325 + m.b326 + m.b327 + m.b328
                         + m.b329 + m.b330 == 1)

m.c27 = Constraint(expr=   m.b331 + m.b332 + m.b333 + m.b334 + m.b335 + m.b336 + m.b337 + m.b338 + m.b339 + m.b340
                         + m.b341 + m.b342 == 1)

m.c28 = Constraint(expr=-(m.b178*m.x344 + m.b179*m.x345 + m.b180*m.x346 + m.b181*m.x347 + m.b182*m.x348 + m.b183*m.x349
                         + m.b184*m.x350 + m.b185*m.x351 + m.b186*m.x352) + m.x85 - 1.25*m.b175 - 1.25*m.b176
                         - 1.25*m.b177 == 0)

m.c29 = Constraint(expr=-(m.b190*m.x344 + m.b191*m.x345 + m.b192*m.x346 + m.b193*m.x347 + m.b194*m.x348 + m.b195*m.x349
                         + m.b196*m.x350 + m.b197*m.x351 + m.b198*m.x352) + m.x91 - 1.25*m.b187 - 1.25*m.b188
                         - 1.25*m.b189 == 0)

m.c30 = Constraint(expr=-(m.b202*m.x344 + m.b203*m.x345 + m.b204*m.x346 + m.b205*m.x347 + m.b206*m.x348 + m.b207*m.x349
                         + m.b208*m.x350 + m.b209*m.x351 + m.b210*m.x352) + m.x97 - 1.25*m.b199 - 1.25*m.b200
                         - 1.25*m.b201 == 0)

m.c31 = Constraint(expr=-(m.b214*m.x344 + m.b215*m.x345 + m.b216*m.x346 + m.b217*m.x347 + m.b218*m.x348 + m.b219*m.x349
                         + m.b220*m.x350 + m.b221*m.x351 + m.b222*m.x352) + m.x103 - 1.25*m.b211 - 1.25*m.b212
                         - 1.25*m.b213 == 0)

m.c32 = Constraint(expr=-(m.b226*m.x344 + m.b227*m.x345 + m.b228*m.x346 + m.b229*m.x347 + m.b230*m.x348 + m.b231*m.x349
                         + m.b232*m.x350 + m.b233*m.x351 + m.b234*m.x352) + m.x109 - 1.25*m.b223 - 1.25*m.b224
                         - 1.25*m.b225 == 0)

m.c33 = Constraint(expr=-(m.b238*m.x344 + m.b239*m.x345 + m.b240*m.x346 + m.b241*m.x347 + m.b242*m.x348 + m.b243*m.x349
                         + m.b244*m.x350 + m.b245*m.x351 + m.b246*m.x352) + m.x115 - 1.25*m.b235 - 1.25*m.b236
                         - 1.25*m.b237 == 0)

m.c34 = Constraint(expr=-(m.b250*m.x344 + m.b251*m.x345 + m.b252*m.x346 + m.b253*m.x347 + m.b254*m.x348 + m.b255*m.x349
                         + m.b256*m.x350 + m.b257*m.x351 + m.b258*m.x352) + m.x121 - 1.25*m.b247 - 1.25*m.b248
                         - 1.25*m.b249 == 0)

m.c35 = Constraint(expr=-(m.b262*m.x344 + m.b263*m.x345 + m.b264*m.x346 + m.b265*m.x347 + m.b266*m.x348 + m.b267*m.x349
                         + m.b268*m.x350 + m.b269*m.x351 + m.b270*m.x352) + m.x127 - 1.25*m.b259 - 1.25*m.b260
                         - 1.25*m.b261 == 0)

m.c36 = Constraint(expr=-(m.b274*m.x344 + m.b275*m.x345 + m.b276*m.x346 + m.b277*m.x347 + m.b278*m.x348 + m.b279*m.x349
                         + m.b280*m.x350 + m.b281*m.x351 + m.b282*m.x352) + m.x133 - 1.25*m.b271 - 1.25*m.b272
                         - 1.25*m.b273 == 0)

m.c37 = Constraint(expr=-(m.b286*m.x344 + m.b287*m.x345 + m.b288*m.x346 + m.b289*m.x347 + m.b290*m.x348 + m.b291*m.x349
                         + m.b292*m.x350 + m.b293*m.x351 + m.b294*m.x352) + m.x139 - 1.25*m.b283 - 1.25*m.b284
                         - 1.25*m.b285 == 0)

m.c38 = Constraint(expr=-(m.b298*m.x344 + m.b299*m.x345 + m.b300*m.x346 + m.b301*m.x347 + m.b302*m.x348 + m.b303*m.x349
                         + m.b304*m.x350 + m.b305*m.x351 + m.b306*m.x352) + m.x145 - 1.25*m.b295 - 1.25*m.b296
                         - 1.25*m.b297 == 0)

m.c39 = Constraint(expr=-(m.b310*m.x344 + m.b311*m.x345 + m.b312*m.x346 + m.b313*m.x347 + m.b314*m.x348 + m.b315*m.x349
                         + m.b316*m.x350 + m.b317*m.x351 + m.b318*m.x352) + m.x151 - 1.25*m.b307 - 1.25*m.b308
                         - 1.25*m.b309 == 0)

m.c40 = Constraint(expr=-(m.b322*m.x344 + m.b323*m.x345 + m.b324*m.x346 + m.b325*m.x347 + m.b326*m.x348 + m.b327*m.x349
                         + m.b328*m.x350 + m.b329*m.x351 + m.b330*m.x352) + m.x157 - 1.25*m.b319 - 1.25*m.b320
                         - 1.25*m.b321 == 0)

m.c41 = Constraint(expr=-(m.b334*m.x344 + m.b335*m.x345 + m.b336*m.x346 + m.b337*m.x347 + m.b338*m.x348 + m.b339*m.x349
                         + m.b340*m.x350 + m.b341*m.x351 + m.b342*m.x352) + m.x163 - 1.25*m.b331 - 1.25*m.b332
                         - 1.25*m.b333 == 0)

m.c42 = Constraint(expr=0.701*m.x85*m.x1 + 0.2*m.x91*m.x7 + 0.023*m.x97*m.x13 + 0.007*m.x103*m.x19 + 0.039*m.x121*m.x37
                         + 0.02*m.x127*m.x43 + 0.003*m.x145*m.x61 - m.x1*m.x169 == 0)

m.c43 = Constraint(expr=0.701*m.x86*m.x2 + 0.2*m.x92*m.x8 + 0.023*m.x98*m.x14 + 0.007*m.x104*m.x20 + 0.039*m.x122*m.x38
                         + 0.02*m.x128*m.x44 + 0.003*m.x146*m.x62 - m.x2*m.x170 == 0)

m.c44 = Constraint(expr=0.701*m.x87*m.x3 + 0.2*m.x93*m.x9 + 0.023*m.x99*m.x15 + 0.007*m.x105*m.x21 + 0.039*m.x123*m.x39
                         + 0.02*m.x129*m.x45 + 0.003*m.x147*m.x63 - m.x3*m.x171 == 0)

m.c45 = Constraint(expr=0.701*m.x88*m.x4 + 0.2*m.x94*m.x10 + 0.023*m.x100*m.x16 + 0.007*m.x106*m.x22 + 0.039*m.x124*
                        m.x40 + 0.02*m.x130*m.x46 + 0.003*m.x148*m.x64 - m.x4*m.x172 == 0)

m.c46 = Constraint(expr=0.701*m.x89*m.x5 + 0.2*m.x95*m.x11 + 0.023*m.x101*m.x17 + 0.007*m.x107*m.x23 + 0.039*m.x125*
                        m.x41 + 0.02*m.x131*m.x47 + 0.003*m.x149*m.x65 - m.x5*m.x173 == 0)

m.c47 = Constraint(expr=0.701*m.x90*m.x6 + 0.2*m.x96*m.x12 + 0.023*m.x102*m.x18 + 0.007*m.x108*m.x24 + 0.039*m.x126*
                        m.x42 + 0.02*m.x132*m.x48 + 0.003*m.x150*m.x66 - m.x6*m.x174 == 0)

m.c48 = Constraint(expr=0.1*m.x85*m.x1 + 0.662*m.x91*m.x7 + 0.088*m.x97*m.x13 + 0.015*m.x103*m.x19 + 0.007*m.x109*m.x25
                         + 0.071*m.x121*m.x37 + 0.037*m.x127*m.x43 + 0.01*m.x133*m.x49 + 0.007*m.x145*m.x61 + 0.003*
                        m.x151*m.x67 - m.x7*m.x169 == 0)

m.c49 = Constraint(expr=0.1*m.x86*m.x2 + 0.662*m.x92*m.x8 + 0.088*m.x98*m.x14 + 0.015*m.x104*m.x20 + 0.007*m.x110*m.x26
                         + 0.071*m.x122*m.x38 + 0.037*m.x128*m.x44 + 0.01*m.x134*m.x50 + 0.007*m.x146*m.x62 + 0.003*
                        m.x152*m.x68 - m.x8*m.x170 == 0)

m.c50 = Constraint(expr=0.1*m.x87*m.x3 + 0.662*m.x93*m.x9 + 0.088*m.x99*m.x15 + 0.015*m.x105*m.x21 + 0.007*m.x111*m.x27
                         + 0.071*m.x123*m.x39 + 0.037*m.x129*m.x45 + 0.01*m.x135*m.x51 + 0.007*m.x147*m.x63 + 0.003*
                        m.x153*m.x69 - m.x9*m.x171 == 0)

m.c51 = Constraint(expr=0.1*m.x88*m.x4 + 0.662*m.x94*m.x10 + 0.088*m.x100*m.x16 + 0.015*m.x106*m.x22 + 0.007*m.x112*
                        m.x28 + 0.071*m.x124*m.x40 + 0.037*m.x130*m.x46 + 0.01*m.x136*m.x52 + 0.007*m.x148*m.x64 + 0.003
                        *m.x154*m.x70 - m.x10*m.x172 == 0)

m.c52 = Constraint(expr=0.1*m.x89*m.x5 + 0.662*m.x95*m.x11 + 0.088*m.x101*m.x17 + 0.015*m.x107*m.x23 + 0.007*m.x113*
                        m.x29 + 0.071*m.x125*m.x41 + 0.037*m.x131*m.x47 + 0.01*m.x137*m.x53 + 0.007*m.x149*m.x65 + 0.003
                        *m.x155*m.x71 - m.x11*m.x173 == 0)

m.c53 = Constraint(expr=0.1*m.x90*m.x6 + 0.662*m.x96*m.x12 + 0.088*m.x102*m.x18 + 0.015*m.x108*m.x24 + 0.007*m.x114*
                        m.x30 + 0.071*m.x126*m.x42 + 0.037*m.x132*m.x48 + 0.01*m.x138*m.x54 + 0.007*m.x150*m.x66 + 0.003
                        *m.x156*m.x72 - m.x12*m.x174 == 0)

m.c54 = Constraint(expr=0.015*m.x85*m.x1 + 0.102*m.x91*m.x7 + 0.619*m.x97*m.x13 + 0.085*m.x103*m.x19 + 0.015*m.x109*
                        m.x25 + 0.007*m.x115*m.x31 + 0.036*m.x121*m.x37 + 0.064*m.x127*m.x43 + 0.029*m.x133*m.x49 + 0.01
                        *m.x139*m.x55 + 0.008*m.x145*m.x61 + 0.007*m.x151*m.x67 + 0.003*m.x157*m.x73 - m.x13*m.x169
                         == 0)

m.c55 = Constraint(expr=0.015*m.x86*m.x2 + 0.102*m.x92*m.x8 + 0.619*m.x98*m.x14 + 0.085*m.x104*m.x20 + 0.015*m.x110*
                        m.x26 + 0.007*m.x116*m.x32 + 0.036*m.x122*m.x38 + 0.064*m.x128*m.x44 + 0.029*m.x134*m.x50 + 0.01
                        *m.x140*m.x56 + 0.008*m.x146*m.x62 + 0.007*m.x152*m.x68 + 0.003*m.x158*m.x74 - m.x14*m.x170
                         == 0)

m.c56 = Constraint(expr=0.015*m.x87*m.x3 + 0.102*m.x93*m.x9 + 0.619*m.x99*m.x15 + 0.085*m.x105*m.x21 + 0.015*m.x111*
                        m.x27 + 0.007*m.x117*m.x33 + 0.036*m.x123*m.x39 + 0.064*m.x129*m.x45 + 0.029*m.x135*m.x51 + 0.01
                        *m.x141*m.x57 + 0.008*m.x147*m.x63 + 0.007*m.x153*m.x69 + 0.003*m.x159*m.x75 - m.x15*m.x171
                         == 0)

m.c57 = Constraint(expr=0.015*m.x88*m.x4 + 0.102*m.x94*m.x10 + 0.619*m.x100*m.x16 + 0.085*m.x106*m.x22 + 0.015*m.x112*
                        m.x28 + 0.007*m.x118*m.x34 + 0.036*m.x124*m.x40 + 0.064*m.x130*m.x46 + 0.029*m.x136*m.x52 + 0.01
                        *m.x142*m.x58 + 0.008*m.x148*m.x64 + 0.007*m.x154*m.x70 + 0.003*m.x160*m.x76 - m.x16*m.x172
                         == 0)

m.c58 = Constraint(expr=0.015*m.x89*m.x5 + 0.102*m.x95*m.x11 + 0.619*m.x101*m.x17 + 0.085*m.x107*m.x23 + 0.015*m.x113*
                        m.x29 + 0.007*m.x119*m.x35 + 0.036*m.x125*m.x41 + 0.064*m.x131*m.x47 + 0.029*m.x137*m.x53 + 0.01
                        *m.x143*m.x59 + 0.008*m.x149*m.x65 + 0.007*m.x155*m.x71 + 0.003*m.x161*m.x77 - m.x17*m.x173
                         == 0)

m.c59 = Constraint(expr=0.015*m.x90*m.x6 + 0.102*m.x96*m.x12 + 0.619*m.x102*m.x18 + 0.085*m.x108*m.x24 + 0.015*m.x114*
                        m.x30 + 0.007*m.x120*m.x36 + 0.036*m.x126*m.x42 + 0.064*m.x132*m.x48 + 0.029*m.x138*m.x54 + 0.01
                        *m.x144*m.x60 + 0.008*m.x150*m.x66 + 0.007*m.x156*m.x72 + 0.003*m.x162*m.x78 - m.x18*m.x174
                         == 0)

m.c60 = Constraint(expr=0.022*m.x91*m.x7 + 0.085*m.x97*m.x13 + 0.616*m.x103*m.x19 + 0.085*m.x109*m.x25 + 0.015*m.x115*
                        m.x31 + 0.01*m.x121*m.x37 + 0.039*m.x127*m.x43 + 0.064*m.x133*m.x49 + 0.029*m.x139*m.x55 + 0.008
                        *m.x151*m.x67 + 0.007*m.x157*m.x73 - m.x19*m.x169 == 0)

m.c61 = Constraint(expr=0.022*m.x92*m.x8 + 0.085*m.x98*m.x14 + 0.616*m.x104*m.x20 + 0.085*m.x110*m.x26 + 0.015*m.x116*
                        m.x32 + 0.01*m.x122*m.x38 + 0.039*m.x128*m.x44 + 0.064*m.x134*m.x50 + 0.029*m.x140*m.x56 + 0.008
                        *m.x152*m.x68 + 0.007*m.x158*m.x74 - m.x20*m.x170 == 0)

m.c62 = Constraint(expr=0.022*m.x93*m.x9 + 0.085*m.x99*m.x15 + 0.616*m.x105*m.x21 + 0.085*m.x111*m.x27 + 0.015*m.x117*
                        m.x33 + 0.01*m.x123*m.x39 + 0.039*m.x129*m.x45 + 0.064*m.x135*m.x51 + 0.029*m.x141*m.x57 + 0.008
                        *m.x153*m.x69 + 0.007*m.x159*m.x75 - m.x21*m.x171 == 0)

m.c63 = Constraint(expr=0.022*m.x94*m.x10 + 0.085*m.x100*m.x16 + 0.616*m.x106*m.x22 + 0.085*m.x112*m.x28 + 0.015*m.x118*
                        m.x34 + 0.01*m.x124*m.x40 + 0.039*m.x130*m.x46 + 0.064*m.x136*m.x52 + 0.029*m.x142*m.x58 + 0.008
                        *m.x154*m.x70 + 0.007*m.x160*m.x76 - m.x22*m.x172 == 0)

m.c64 = Constraint(expr=0.022*m.x95*m.x11 + 0.085*m.x101*m.x17 + 0.616*m.x107*m.x23 + 0.085*m.x113*m.x29 + 0.015*m.x119*
                        m.x35 + 0.01*m.x125*m.x41 + 0.039*m.x131*m.x47 + 0.064*m.x137*m.x53 + 0.029*m.x143*m.x59 + 0.008
                        *m.x155*m.x71 + 0.007*m.x161*m.x77 - m.x23*m.x173 == 0)

m.c65 = Constraint(expr=0.022*m.x96*m.x12 + 0.085*m.x102*m.x18 + 0.616*m.x108*m.x24 + 0.085*m.x114*m.x30 + 0.015*m.x120*
                        m.x36 + 0.01*m.x126*m.x42 + 0.039*m.x132*m.x48 + 0.064*m.x138*m.x54 + 0.029*m.x144*m.x60 + 0.008
                        *m.x156*m.x72 + 0.007*m.x162*m.x78 - m.x24*m.x174 == 0)

m.c66 = Constraint(expr=0.015*m.x97*m.x13 + 0.085*m.x103*m.x19 + 0.616*m.x109*m.x25 + 0.085*m.x115*m.x31 + 0.007*m.x121*
                        m.x37 + 0.01*m.x127*m.x43 + 0.036*m.x133*m.x49 + 0.064*m.x139*m.x55 + 0.003*m.x145*m.x61 + 0.008
                        *m.x157*m.x73 - m.x25*m.x169 == 0)

m.c67 = Constraint(expr=0.015*m.x98*m.x14 + 0.085*m.x104*m.x20 + 0.616*m.x110*m.x26 + 0.085*m.x116*m.x32 + 0.007*m.x122*
                        m.x38 + 0.01*m.x128*m.x44 + 0.036*m.x134*m.x50 + 0.064*m.x140*m.x56 + 0.003*m.x146*m.x62 + 0.008
                        *m.x158*m.x74 - m.x26*m.x170 == 0)

m.c68 = Constraint(expr=0.015*m.x99*m.x15 + 0.085*m.x105*m.x21 + 0.616*m.x111*m.x27 + 0.085*m.x117*m.x33 + 0.007*m.x123*
                        m.x39 + 0.01*m.x129*m.x45 + 0.036*m.x135*m.x51 + 0.064*m.x141*m.x57 + 0.003*m.x147*m.x63 + 0.008
                        *m.x159*m.x75 - m.x27*m.x171 == 0)

m.c69 = Constraint(expr=0.015*m.x100*m.x16 + 0.085*m.x106*m.x22 + 0.616*m.x112*m.x28 + 0.085*m.x118*m.x34 + 0.007*m.x124
                        *m.x40 + 0.01*m.x130*m.x46 + 0.036*m.x136*m.x52 + 0.064*m.x142*m.x58 + 0.003*m.x148*m.x64 +
                        0.008*m.x160*m.x76 - m.x28*m.x172 == 0)

m.c70 = Constraint(expr=0.015*m.x101*m.x17 + 0.085*m.x107*m.x23 + 0.616*m.x113*m.x29 + 0.085*m.x119*m.x35 + 0.007*m.x125
                        *m.x41 + 0.01*m.x131*m.x47 + 0.036*m.x137*m.x53 + 0.064*m.x143*m.x59 + 0.003*m.x149*m.x65 +
                        0.008*m.x161*m.x77 - m.x29*m.x173 == 0)

m.c71 = Constraint(expr=0.015*m.x102*m.x18 + 0.085*m.x108*m.x24 + 0.616*m.x114*m.x30 + 0.085*m.x120*m.x36 + 0.007*m.x126
                        *m.x42 + 0.01*m.x132*m.x48 + 0.036*m.x138*m.x54 + 0.064*m.x144*m.x60 + 0.003*m.x150*m.x66 +
                        0.008*m.x162*m.x78 - m.x30*m.x174 == 0)

m.c72 = Constraint(expr=0.015*m.x103*m.x19 + 0.085*m.x109*m.x25 + 0.616*m.x115*m.x31 + 0.007*m.x127*m.x43 + 0.01*m.x133*
                        m.x49 + 0.036*m.x139*m.x55 + 0.003*m.x151*m.x67 - m.x31*m.x169 == 0)

m.c73 = Constraint(expr=0.015*m.x104*m.x20 + 0.085*m.x110*m.x26 + 0.616*m.x116*m.x32 + 0.007*m.x128*m.x44 + 0.01*m.x134*
                        m.x50 + 0.036*m.x140*m.x56 + 0.003*m.x152*m.x68 - m.x32*m.x170 == 0)

m.c74 = Constraint(expr=0.015*m.x105*m.x21 + 0.085*m.x111*m.x27 + 0.616*m.x117*m.x33 + 0.007*m.x129*m.x45 + 0.01*m.x135*
                        m.x51 + 0.036*m.x141*m.x57 + 0.003*m.x153*m.x69 - m.x33*m.x171 == 0)

m.c75 = Constraint(expr=0.015*m.x106*m.x22 + 0.085*m.x112*m.x28 + 0.616*m.x118*m.x34 + 0.007*m.x130*m.x46 + 0.01*m.x136*
                        m.x52 + 0.036*m.x142*m.x58 + 0.003*m.x154*m.x70 - m.x34*m.x172 == 0)

m.c76 = Constraint(expr=0.015*m.x107*m.x23 + 0.085*m.x113*m.x29 + 0.616*m.x119*m.x35 + 0.007*m.x131*m.x47 + 0.01*m.x137*
                        m.x53 + 0.036*m.x143*m.x59 + 0.003*m.x155*m.x71 - m.x35*m.x173 == 0)

m.c77 = Constraint(expr=0.015*m.x108*m.x24 + 0.085*m.x114*m.x30 + 0.616*m.x120*m.x36 + 0.007*m.x132*m.x48 + 0.01*m.x138*
                        m.x54 + 0.036*m.x144*m.x60 + 0.003*m.x156*m.x72 - m.x36*m.x174 == 0)

m.c78 = Constraint(expr=0.046*m.x85*m.x1 + 0.128*m.x91*m.x7 + 0.065*m.x97*m.x13 + 0.013*m.x103*m.x19 + 0.007*m.x109*
                        m.x25 + 0.56*m.x121*m.x37 + 0.119*m.x127*m.x43 + 0.016*m.x133*m.x49 + 0.029*m.x145*m.x61 + 0.014
                        *m.x151*m.x67 + 0.003*m.x163*m.x79 - m.x37*m.x169 == 0)

m.c79 = Constraint(expr=0.046*m.x86*m.x2 + 0.128*m.x92*m.x8 + 0.065*m.x98*m.x14 + 0.013*m.x104*m.x20 + 0.007*m.x110*
                        m.x26 + 0.56*m.x122*m.x38 + 0.119*m.x128*m.x44 + 0.016*m.x134*m.x50 + 0.029*m.x146*m.x62 + 0.014
                        *m.x152*m.x68 + 0.003*m.x164*m.x80 - m.x38*m.x170 == 0)

m.c80 = Constraint(expr=0.046*m.x87*m.x3 + 0.128*m.x93*m.x9 + 0.065*m.x99*m.x15 + 0.013*m.x105*m.x21 + 0.007*m.x111*
                        m.x27 + 0.56*m.x123*m.x39 + 0.119*m.x129*m.x45 + 0.016*m.x135*m.x51 + 0.029*m.x147*m.x63 + 0.014
                        *m.x153*m.x69 + 0.003*m.x165*m.x81 - m.x39*m.x171 == 0)

m.c81 = Constraint(expr=0.046*m.x88*m.x4 + 0.128*m.x94*m.x10 + 0.065*m.x100*m.x16 + 0.013*m.x106*m.x22 + 0.007*m.x112*
                        m.x28 + 0.56*m.x124*m.x40 + 0.119*m.x130*m.x46 + 0.016*m.x136*m.x52 + 0.029*m.x148*m.x64 + 0.014
                        *m.x154*m.x70 + 0.003*m.x166*m.x82 - m.x40*m.x172 == 0)

m.c82 = Constraint(expr=0.046*m.x89*m.x5 + 0.128*m.x95*m.x11 + 0.065*m.x101*m.x17 + 0.013*m.x107*m.x23 + 0.007*m.x113*
                        m.x29 + 0.56*m.x125*m.x41 + 0.119*m.x131*m.x47 + 0.016*m.x137*m.x53 + 0.029*m.x149*m.x65 + 0.014
                        *m.x155*m.x71 + 0.003*m.x167*m.x83 - m.x41*m.x173 == 0)

m.c83 = Constraint(expr=0.046*m.x90*m.x6 + 0.128*m.x96*m.x12 + 0.065*m.x102*m.x18 + 0.013*m.x108*m.x24 + 0.007*m.x114*
                        m.x30 + 0.56*m.x126*m.x42 + 0.119*m.x132*m.x48 + 0.016*m.x138*m.x54 + 0.029*m.x150*m.x66 + 0.014
                        *m.x156*m.x72 + 0.003*m.x168*m.x84 - m.x42*m.x174 == 0)

m.c84 = Constraint(expr=0.01*m.x85*m.x1 + 0.044*m.x91*m.x7 + 0.078*m.x97*m.x13 + 0.032*m.x103*m.x19 + 0.01*m.x109*m.x25
                         + 0.007*m.x115*m.x31 + 0.056*m.x121*m.x37 + 0.589*m.x127*m.x43 + 0.056*m.x133*m.x49 + 0.008*
                        m.x139*m.x55 + 0.056*m.x145*m.x61 + 0.037*m.x151*m.x67 + 0.007*m.x157*m.x73 + 0.007*m.x163*m.x79
                         - m.x43*m.x169 == 0)

m.c85 = Constraint(expr=0.01*m.x86*m.x2 + 0.044*m.x92*m.x8 + 0.078*m.x98*m.x14 + 0.032*m.x104*m.x20 + 0.01*m.x110*m.x26
                         + 0.007*m.x116*m.x32 + 0.056*m.x122*m.x38 + 0.589*m.x128*m.x44 + 0.056*m.x134*m.x50 + 0.008*
                        m.x140*m.x56 + 0.056*m.x146*m.x62 + 0.037*m.x152*m.x68 + 0.007*m.x158*m.x74 + 0.007*m.x164*m.x80
                         - m.x44*m.x170 == 0)

m.c86 = Constraint(expr=0.01*m.x87*m.x3 + 0.044*m.x93*m.x9 + 0.078*m.x99*m.x15 + 0.032*m.x105*m.x21 + 0.01*m.x111*m.x27
                         + 0.007*m.x117*m.x33 + 0.056*m.x123*m.x39 + 0.589*m.x129*m.x45 + 0.056*m.x135*m.x51 + 0.008*
                        m.x141*m.x57 + 0.056*m.x147*m.x63 + 0.037*m.x153*m.x69 + 0.007*m.x159*m.x75 + 0.007*m.x165*m.x81
                         - m.x45*m.x171 == 0)

m.c87 = Constraint(expr=0.01*m.x88*m.x4 + 0.044*m.x94*m.x10 + 0.078*m.x100*m.x16 + 0.032*m.x106*m.x22 + 0.01*m.x112*
                        m.x28 + 0.007*m.x118*m.x34 + 0.056*m.x124*m.x40 + 0.589*m.x130*m.x46 + 0.056*m.x136*m.x52 +
                        0.008*m.x142*m.x58 + 0.056*m.x148*m.x64 + 0.037*m.x154*m.x70 + 0.007*m.x160*m.x76 + 0.007*m.x166
                        *m.x82 - m.x46*m.x172 == 0)

m.c88 = Constraint(expr=0.01*m.x89*m.x5 + 0.044*m.x95*m.x11 + 0.078*m.x101*m.x17 + 0.032*m.x107*m.x23 + 0.01*m.x113*
                        m.x29 + 0.007*m.x119*m.x35 + 0.056*m.x125*m.x41 + 0.589*m.x131*m.x47 + 0.056*m.x137*m.x53 +
                        0.008*m.x143*m.x59 + 0.056*m.x149*m.x65 + 0.037*m.x155*m.x71 + 0.007*m.x161*m.x77 + 0.007*m.x167
                        *m.x83 - m.x47*m.x173 == 0)

m.c89 = Constraint(expr=0.01*m.x90*m.x6 + 0.044*m.x96*m.x12 + 0.078*m.x102*m.x18 + 0.032*m.x108*m.x24 + 0.01*m.x114*
                        m.x30 + 0.007*m.x120*m.x36 + 0.056*m.x126*m.x42 + 0.589*m.x132*m.x48 + 0.056*m.x138*m.x54 +
                        0.008*m.x144*m.x60 + 0.056*m.x150*m.x66 + 0.037*m.x156*m.x72 + 0.007*m.x162*m.x78 + 0.007*m.x168
                        *m.x84 - m.x48*m.x174 == 0)

m.c90 = Constraint(expr=0.01*m.x91*m.x7 + 0.043*m.x97*m.x13 + 0.064*m.x103*m.x19 + 0.029*m.x109*m.x25 + 0.01*m.x115*
                        m.x31 + 0.008*m.x121*m.x37 + 0.063*m.x127*m.x43 + 0.563*m.x133*m.x49 + 0.056*m.x139*m.x55 +
                        0.029*m.x145*m.x61 + 0.056*m.x151*m.x67 + 0.029*m.x157*m.x73 + 0.008*m.x163*m.x79 - m.x49*m.x169
                         == 0)

m.c91 = Constraint(expr=0.01*m.x92*m.x8 + 0.043*m.x98*m.x14 + 0.064*m.x104*m.x20 + 0.029*m.x110*m.x26 + 0.01*m.x116*
                        m.x32 + 0.008*m.x122*m.x38 + 0.063*m.x128*m.x44 + 0.563*m.x134*m.x50 + 0.056*m.x140*m.x56 +
                        0.029*m.x146*m.x62 + 0.056*m.x152*m.x68 + 0.029*m.x158*m.x74 + 0.008*m.x164*m.x80 - m.x50*m.x170
                         == 0)

m.c92 = Constraint(expr=0.01*m.x93*m.x9 + 0.043*m.x99*m.x15 + 0.064*m.x105*m.x21 + 0.029*m.x111*m.x27 + 0.01*m.x117*
                        m.x33 + 0.008*m.x123*m.x39 + 0.063*m.x129*m.x45 + 0.563*m.x135*m.x51 + 0.056*m.x141*m.x57 +
                        0.029*m.x147*m.x63 + 0.056*m.x153*m.x69 + 0.029*m.x159*m.x75 + 0.008*m.x165*m.x81 - m.x51*m.x171
                         == 0)

m.c93 = Constraint(expr=0.01*m.x94*m.x10 + 0.043*m.x100*m.x16 + 0.064*m.x106*m.x22 + 0.029*m.x112*m.x28 + 0.01*m.x118*
                        m.x34 + 0.008*m.x124*m.x40 + 0.063*m.x130*m.x46 + 0.563*m.x136*m.x52 + 0.056*m.x142*m.x58 +
                        0.029*m.x148*m.x64 + 0.056*m.x154*m.x70 + 0.029*m.x160*m.x76 + 0.008*m.x166*m.x82 - m.x52*m.x172
                         == 0)

m.c94 = Constraint(expr=0.01*m.x95*m.x11 + 0.043*m.x101*m.x17 + 0.064*m.x107*m.x23 + 0.029*m.x113*m.x29 + 0.01*m.x119*
                        m.x35 + 0.008*m.x125*m.x41 + 0.063*m.x131*m.x47 + 0.563*m.x137*m.x53 + 0.056*m.x143*m.x59 +
                        0.029*m.x149*m.x65 + 0.056*m.x155*m.x71 + 0.029*m.x161*m.x77 + 0.008*m.x167*m.x83 - m.x53*m.x173
                         == 0)

m.c95 = Constraint(expr=0.01*m.x96*m.x12 + 0.043*m.x102*m.x18 + 0.064*m.x108*m.x24 + 0.029*m.x114*m.x30 + 0.01*m.x120*
                        m.x36 + 0.008*m.x126*m.x42 + 0.063*m.x132*m.x48 + 0.563*m.x138*m.x54 + 0.056*m.x144*m.x60 +
                        0.029*m.x150*m.x66 + 0.056*m.x156*m.x72 + 0.029*m.x162*m.x78 + 0.008*m.x168*m.x84 - m.x54*m.x174
                         == 0)

m.c96 = Constraint(expr=0.01*m.x97*m.x13 + 0.036*m.x103*m.x19 + 0.064*m.x109*m.x25 + 0.029*m.x115*m.x31 + 0.015*m.x127*
                        m.x43 + 0.056*m.x133*m.x49 + 0.56*m.x139*m.x55 + 0.007*m.x145*m.x61 + 0.032*m.x151*m.x67 + 0.056
                        *m.x157*m.x73 - m.x55*m.x169 == 0)

m.c97 = Constraint(expr=0.01*m.x98*m.x14 + 0.036*m.x104*m.x20 + 0.064*m.x110*m.x26 + 0.029*m.x116*m.x32 + 0.015*m.x128*
                        m.x44 + 0.056*m.x134*m.x50 + 0.56*m.x140*m.x56 + 0.007*m.x146*m.x62 + 0.032*m.x152*m.x68 + 0.056
                        *m.x158*m.x74 - m.x56*m.x170 == 0)

m.c98 = Constraint(expr=0.01*m.x99*m.x15 + 0.036*m.x105*m.x21 + 0.064*m.x111*m.x27 + 0.029*m.x117*m.x33 + 0.015*m.x129*
                        m.x45 + 0.056*m.x135*m.x51 + 0.56*m.x141*m.x57 + 0.007*m.x147*m.x63 + 0.032*m.x153*m.x69 + 0.056
                        *m.x159*m.x75 - m.x57*m.x171 == 0)

m.c99 = Constraint(expr=0.01*m.x100*m.x16 + 0.036*m.x106*m.x22 + 0.064*m.x112*m.x28 + 0.029*m.x118*m.x34 + 0.015*m.x130*
                        m.x46 + 0.056*m.x136*m.x52 + 0.56*m.x142*m.x58 + 0.007*m.x148*m.x64 + 0.032*m.x154*m.x70 + 0.056
                        *m.x160*m.x76 - m.x58*m.x172 == 0)

m.c100 = Constraint(expr=0.01*m.x101*m.x17 + 0.036*m.x107*m.x23 + 0.064*m.x113*m.x29 + 0.029*m.x119*m.x35 + 0.015*m.x131
                         *m.x47 + 0.056*m.x137*m.x53 + 0.56*m.x143*m.x59 + 0.007*m.x149*m.x65 + 0.032*m.x155*m.x71 +
                         0.056*m.x161*m.x77 - m.x59*m.x173 == 0)

m.c101 = Constraint(expr=0.01*m.x102*m.x18 + 0.036*m.x108*m.x24 + 0.064*m.x114*m.x30 + 0.029*m.x120*m.x36 + 0.015*m.x132
                         *m.x48 + 0.056*m.x138*m.x54 + 0.56*m.x144*m.x60 + 0.007*m.x150*m.x66 + 0.032*m.x156*m.x72 +
                         0.056*m.x162*m.x78 - m.x60*m.x174 == 0)

m.c102 = Constraint(expr=0.003*m.x85*m.x1 + 0.014*m.x91*m.x7 + 0.016*m.x97*m.x13 + 0.014*m.x103*m.x19 + 0.006*m.x109*
                         m.x25 + 0.029*m.x121*m.x37 + 0.112*m.x127*m.x43 + 0.058*m.x133*m.x49 + 0.007*m.x139*m.x55 +
                         0.56*m.x145*m.x61 + 0.112*m.x151*m.x67 + 0.016*m.x157*m.x73 + 0.029*m.x163*m.x79 - m.x61*m.x169
                          == 0)

m.c103 = Constraint(expr=0.003*m.x86*m.x2 + 0.014*m.x92*m.x8 + 0.016*m.x98*m.x14 + 0.014*m.x104*m.x20 + 0.006*m.x110*
                         m.x26 + 0.029*m.x122*m.x38 + 0.112*m.x128*m.x44 + 0.058*m.x134*m.x50 + 0.007*m.x140*m.x56 +
                         0.56*m.x146*m.x62 + 0.112*m.x152*m.x68 + 0.016*m.x158*m.x74 + 0.029*m.x164*m.x80 - m.x62*m.x170
                          == 0)

m.c104 = Constraint(expr=0.003*m.x87*m.x3 + 0.014*m.x93*m.x9 + 0.016*m.x99*m.x15 + 0.014*m.x105*m.x21 + 0.006*m.x111*
                         m.x27 + 0.029*m.x123*m.x39 + 0.112*m.x129*m.x45 + 0.058*m.x135*m.x51 + 0.007*m.x141*m.x57 +
                         0.56*m.x147*m.x63 + 0.112*m.x153*m.x69 + 0.016*m.x159*m.x75 + 0.029*m.x165*m.x81 - m.x63*m.x171
                          == 0)

m.c105 = Constraint(expr=0.003*m.x88*m.x4 + 0.014*m.x94*m.x10 + 0.016*m.x100*m.x16 + 0.014*m.x106*m.x22 + 0.006*m.x112*
                         m.x28 + 0.029*m.x124*m.x40 + 0.112*m.x130*m.x46 + 0.058*m.x136*m.x52 + 0.007*m.x142*m.x58 +
                         0.56*m.x148*m.x64 + 0.112*m.x154*m.x70 + 0.016*m.x160*m.x76 + 0.029*m.x166*m.x82 - m.x64*m.x172
                          == 0)

m.c106 = Constraint(expr=0.003*m.x89*m.x5 + 0.014*m.x95*m.x11 + 0.016*m.x101*m.x17 + 0.014*m.x107*m.x23 + 0.006*m.x113*
                         m.x29 + 0.029*m.x125*m.x41 + 0.112*m.x131*m.x47 + 0.058*m.x137*m.x53 + 0.007*m.x143*m.x59 +
                         0.56*m.x149*m.x65 + 0.112*m.x155*m.x71 + 0.016*m.x161*m.x77 + 0.029*m.x167*m.x83 - m.x65*m.x173
                          == 0)

m.c107 = Constraint(expr=0.003*m.x90*m.x6 + 0.014*m.x96*m.x12 + 0.016*m.x102*m.x18 + 0.014*m.x108*m.x24 + 0.006*m.x114*
                         m.x30 + 0.029*m.x126*m.x42 + 0.112*m.x132*m.x48 + 0.058*m.x138*m.x54 + 0.007*m.x144*m.x60 +
                         0.56*m.x150*m.x66 + 0.112*m.x156*m.x72 + 0.016*m.x162*m.x78 + 0.029*m.x168*m.x84 - m.x66*m.x174
                          == 0)

m.c108 = Constraint(expr=0.003*m.x91*m.x7 + 0.007*m.x97*m.x13 + 0.015*m.x103*m.x19 + 0.003*m.x115*m.x31 + 0.007*m.x121*
                         m.x37 + 0.037*m.x127*m.x43 + 0.063*m.x133*m.x49 + 0.032*m.x139*m.x55 + 0.056*m.x145*m.x61 +
                         0.589*m.x151*m.x67 + 0.056*m.x157*m.x73 + 0.056*m.x163*m.x79 - m.x67*m.x169 == 0)

m.c109 = Constraint(expr=0.003*m.x92*m.x8 + 0.007*m.x98*m.x14 + 0.015*m.x104*m.x20 + 0.003*m.x116*m.x32 + 0.007*m.x122*
                         m.x38 + 0.037*m.x128*m.x44 + 0.063*m.x134*m.x50 + 0.032*m.x140*m.x56 + 0.056*m.x146*m.x62 +
                         0.589*m.x152*m.x68 + 0.056*m.x158*m.x74 + 0.056*m.x164*m.x80 - m.x68*m.x170 == 0)

m.c110 = Constraint(expr=0.003*m.x93*m.x9 + 0.007*m.x99*m.x15 + 0.015*m.x105*m.x21 + 0.003*m.x117*m.x33 + 0.007*m.x123*
                         m.x39 + 0.037*m.x129*m.x45 + 0.063*m.x135*m.x51 + 0.032*m.x141*m.x57 + 0.056*m.x147*m.x63 +
                         0.589*m.x153*m.x69 + 0.056*m.x159*m.x75 + 0.056*m.x165*m.x81 - m.x69*m.x171 == 0)

m.c111 = Constraint(expr=0.003*m.x94*m.x10 + 0.007*m.x100*m.x16 + 0.015*m.x106*m.x22 + 0.003*m.x118*m.x34 + 0.007*m.x124
                         *m.x40 + 0.037*m.x130*m.x46 + 0.063*m.x136*m.x52 + 0.032*m.x142*m.x58 + 0.056*m.x148*m.x64 +
                         0.589*m.x154*m.x70 + 0.056*m.x160*m.x76 + 0.056*m.x166*m.x82 - m.x70*m.x172 == 0)

m.c112 = Constraint(expr=0.003*m.x95*m.x11 + 0.007*m.x101*m.x17 + 0.015*m.x107*m.x23 + 0.003*m.x119*m.x35 + 0.007*m.x125
                         *m.x41 + 0.037*m.x131*m.x47 + 0.063*m.x137*m.x53 + 0.032*m.x143*m.x59 + 0.056*m.x149*m.x65 +
                         0.589*m.x155*m.x71 + 0.056*m.x161*m.x77 + 0.056*m.x167*m.x83 - m.x71*m.x173 == 0)

m.c113 = Constraint(expr=0.003*m.x96*m.x12 + 0.007*m.x102*m.x18 + 0.015*m.x108*m.x24 + 0.003*m.x120*m.x36 + 0.007*m.x126
                         *m.x42 + 0.037*m.x132*m.x48 + 0.063*m.x138*m.x54 + 0.032*m.x144*m.x60 + 0.056*m.x150*m.x66 +
                         0.589*m.x156*m.x72 + 0.056*m.x162*m.x78 + 0.056*m.x168*m.x84 - m.x72*m.x174 == 0)

m.c114 = Constraint(expr=0.003*m.x97*m.x13 + 0.007*m.x103*m.x19 + 0.008*m.x109*m.x25 + 0.007*m.x127*m.x43 + 0.036*m.x133
                         *m.x49 + 0.056*m.x139*m.x55 + 0.008*m.x145*m.x61 + 0.063*m.x151*m.x67 + 0.563*m.x157*m.x73 +
                         0.029*m.x163*m.x79 - m.x73*m.x169 == 0)

m.c115 = Constraint(expr=0.003*m.x98*m.x14 + 0.007*m.x104*m.x20 + 0.008*m.x110*m.x26 + 0.007*m.x128*m.x44 + 0.036*m.x134
                         *m.x50 + 0.056*m.x140*m.x56 + 0.008*m.x146*m.x62 + 0.063*m.x152*m.x68 + 0.563*m.x158*m.x74 +
                         0.029*m.x164*m.x80 - m.x74*m.x170 == 0)

m.c116 = Constraint(expr=0.003*m.x99*m.x15 + 0.007*m.x105*m.x21 + 0.008*m.x111*m.x27 + 0.007*m.x129*m.x45 + 0.036*m.x135
                         *m.x51 + 0.056*m.x141*m.x57 + 0.008*m.x147*m.x63 + 0.063*m.x153*m.x69 + 0.563*m.x159*m.x75 +
                         0.029*m.x165*m.x81 - m.x75*m.x171 == 0)

m.c117 = Constraint(expr=0.003*m.x100*m.x16 + 0.007*m.x106*m.x22 + 0.008*m.x112*m.x28 + 0.007*m.x130*m.x46 + 0.036*
                         m.x136*m.x52 + 0.056*m.x142*m.x58 + 0.008*m.x148*m.x64 + 0.063*m.x154*m.x70 + 0.563*m.x160*
                         m.x76 + 0.029*m.x166*m.x82 - m.x76*m.x172 == 0)

m.c118 = Constraint(expr=0.003*m.x101*m.x17 + 0.007*m.x107*m.x23 + 0.008*m.x113*m.x29 + 0.007*m.x131*m.x47 + 0.036*
                         m.x137*m.x53 + 0.056*m.x143*m.x59 + 0.008*m.x149*m.x65 + 0.063*m.x155*m.x71 + 0.563*m.x161*
                         m.x77 + 0.029*m.x167*m.x83 - m.x77*m.x173 == 0)

m.c119 = Constraint(expr=0.003*m.x102*m.x18 + 0.007*m.x108*m.x24 + 0.008*m.x114*m.x30 + 0.007*m.x132*m.x48 + 0.036*
                         m.x138*m.x54 + 0.056*m.x144*m.x60 + 0.008*m.x150*m.x66 + 0.063*m.x156*m.x72 + 0.563*m.x162*
                         m.x78 + 0.029*m.x168*m.x84 - m.x78*m.x174 == 0)

m.c120 = Constraint(expr=0.007*m.x109*m.x25 + 0.003*m.x121*m.x37 + 0.014*m.x127*m.x43 + 0.016*m.x133*m.x49 + 0.007*
                         m.x139*m.x55 + 0.029*m.x145*m.x61 + 0.112*m.x151*m.x67 + 0.058*m.x157*m.x73 + 0.56*m.x163*m.x79
                          - m.x79*m.x169 == 0)

m.c121 = Constraint(expr=0.007*m.x110*m.x26 + 0.003*m.x122*m.x38 + 0.014*m.x128*m.x44 + 0.016*m.x134*m.x50 + 0.007*
                         m.x140*m.x56 + 0.029*m.x146*m.x62 + 0.112*m.x152*m.x68 + 0.058*m.x158*m.x74 + 0.56*m.x164*m.x80
                          - m.x80*m.x170 == 0)

m.c122 = Constraint(expr=0.007*m.x111*m.x27 + 0.003*m.x123*m.x39 + 0.014*m.x129*m.x45 + 0.016*m.x135*m.x51 + 0.007*
                         m.x141*m.x57 + 0.029*m.x147*m.x63 + 0.112*m.x153*m.x69 + 0.058*m.x159*m.x75 + 0.56*m.x165*m.x81
                          - m.x81*m.x171 == 0)

m.c123 = Constraint(expr=0.007*m.x112*m.x28 + 0.003*m.x124*m.x40 + 0.014*m.x130*m.x46 + 0.016*m.x136*m.x52 + 0.007*
                         m.x142*m.x58 + 0.029*m.x148*m.x64 + 0.112*m.x154*m.x70 + 0.058*m.x160*m.x76 + 0.56*m.x166*m.x82
                          - m.x82*m.x172 == 0)

m.c124 = Constraint(expr=0.007*m.x113*m.x29 + 0.003*m.x125*m.x41 + 0.014*m.x131*m.x47 + 0.016*m.x137*m.x53 + 0.007*
                         m.x143*m.x59 + 0.029*m.x149*m.x65 + 0.112*m.x155*m.x71 + 0.058*m.x161*m.x77 + 0.56*m.x167*m.x83
                          - m.x83*m.x173 == 0)

m.c125 = Constraint(expr=0.007*m.x114*m.x30 + 0.003*m.x126*m.x42 + 0.014*m.x132*m.x48 + 0.016*m.x138*m.x54 + 0.007*
                         m.x144*m.x60 + 0.029*m.x150*m.x66 + 0.112*m.x156*m.x72 + 0.058*m.x162*m.x78 + 0.56*m.x168*m.x84
                          - m.x84*m.x174 == 0)

m.c126 = Constraint(expr=-(m.x85 - 0.15288*m.x85*m.x1) + m.x86 == 0)

m.c127 = Constraint(expr=-(m.x86 - 0.15288*m.x86*m.x2) + m.x87 == 0)

m.c128 = Constraint(expr=-(m.x87 - 0.15288*m.x87*m.x3) + m.x88 == 0)

m.c129 = Constraint(expr=-(m.x88 - 0.15288*m.x88*m.x4) + m.x89 == 0)

m.c130 = Constraint(expr=-(m.x89 - 0.15288*m.x89*m.x5) + m.x90 == 0)

m.c131 = Constraint(expr=-(m.x91 - 0.15288*m.x91*m.x7) + m.x92 == 0)

m.c132 = Constraint(expr=-(m.x92 - 0.15288*m.x92*m.x8) + m.x93 == 0)

m.c133 = Constraint(expr=-(m.x93 - 0.15288*m.x93*m.x9) + m.x94 == 0)

m.c134 = Constraint(expr=-(m.x94 - 0.15288*m.x94*m.x10) + m.x95 == 0)

m.c135 = Constraint(expr=-(m.x95 - 0.15288*m.x95*m.x11) + m.x96 == 0)

m.c136 = Constraint(expr=-(m.x97 - 0.15288*m.x97*m.x13) + m.x98 == 0)

m.c137 = Constraint(expr=-(m.x98 - 0.15288*m.x98*m.x14) + m.x99 == 0)

m.c138 = Constraint(expr=-(m.x99 - 0.15288*m.x99*m.x15) + m.x100 == 0)

m.c139 = Constraint(expr=-(m.x100 - 0.15288*m.x100*m.x16) + m.x101 == 0)

m.c140 = Constraint(expr=-(m.x101 - 0.15288*m.x101*m.x17) + m.x102 == 0)

m.c141 = Constraint(expr=-(m.x103 - 0.15288*m.x103*m.x19) + m.x104 == 0)

m.c142 = Constraint(expr=-(m.x104 - 0.15288*m.x104*m.x20) + m.x105 == 0)

m.c143 = Constraint(expr=-(m.x105 - 0.15288*m.x105*m.x21) + m.x106 == 0)

m.c144 = Constraint(expr=-(m.x106 - 0.15288*m.x106*m.x22) + m.x107 == 0)

m.c145 = Constraint(expr=-(m.x107 - 0.15288*m.x107*m.x23) + m.x108 == 0)

m.c146 = Constraint(expr=-(m.x109 - 0.15288*m.x109*m.x25) + m.x110 == 0)

m.c147 = Constraint(expr=-(m.x110 - 0.15288*m.x110*m.x26) + m.x111 == 0)

m.c148 = Constraint(expr=-(m.x111 - 0.15288*m.x111*m.x27) + m.x112 == 0)

m.c149 = Constraint(expr=-(m.x112 - 0.15288*m.x112*m.x28) + m.x113 == 0)

m.c150 = Constraint(expr=-(m.x113 - 0.15288*m.x113*m.x29) + m.x114 == 0)

m.c151 = Constraint(expr=-(m.x115 - 0.15288*m.x115*m.x31) + m.x116 == 0)

m.c152 = Constraint(expr=-(m.x116 - 0.15288*m.x116*m.x32) + m.x117 == 0)

m.c153 = Constraint(expr=-(m.x117 - 0.15288*m.x117*m.x33) + m.x118 == 0)

m.c154 = Constraint(expr=-(m.x118 - 0.15288*m.x118*m.x34) + m.x119 == 0)

m.c155 = Constraint(expr=-(m.x119 - 0.15288*m.x119*m.x35) + m.x120 == 0)

m.c156 = Constraint(expr=-(m.x121 - 0.15288*m.x121*m.x37) + m.x122 == 0)

m.c157 = Constraint(expr=-(m.x122 - 0.15288*m.x122*m.x38) + m.x123 == 0)

m.c158 = Constraint(expr=-(m.x123 - 0.15288*m.x123*m.x39) + m.x124 == 0)

m.c159 = Constraint(expr=-(m.x124 - 0.15288*m.x124*m.x40) + m.x125 == 0)

m.c160 = Constraint(expr=-(m.x125 - 0.15288*m.x125*m.x41) + m.x126 == 0)

m.c161 = Constraint(expr=-(m.x127 - 0.15288*m.x127*m.x43) + m.x128 == 0)

m.c162 = Constraint(expr=-(m.x128 - 0.15288*m.x128*m.x44) + m.x129 == 0)

m.c163 = Constraint(expr=-(m.x129 - 0.15288*m.x129*m.x45) + m.x130 == 0)

m.c164 = Constraint(expr=-(m.x130 - 0.15288*m.x130*m.x46) + m.x131 == 0)

m.c165 = Constraint(expr=-(m.x131 - 0.15288*m.x131*m.x47) + m.x132 == 0)

m.c166 = Constraint(expr=-(m.x133 - 0.15288*m.x133*m.x49) + m.x134 == 0)

m.c167 = Constraint(expr=-(m.x134 - 0.15288*m.x134*m.x50) + m.x135 == 0)

m.c168 = Constraint(expr=-(m.x135 - 0.15288*m.x135*m.x51) + m.x136 == 0)

m.c169 = Constraint(expr=-(m.x136 - 0.15288*m.x136*m.x52) + m.x137 == 0)

m.c170 = Constraint(expr=-(m.x137 - 0.15288*m.x137*m.x53) + m.x138 == 0)

m.c171 = Constraint(expr=-(m.x139 - 0.15288*m.x139*m.x55) + m.x140 == 0)

m.c172 = Constraint(expr=-(m.x140 - 0.15288*m.x140*m.x56) + m.x141 == 0)

m.c173 = Constraint(expr=-(m.x141 - 0.15288*m.x141*m.x57) + m.x142 == 0)

m.c174 = Constraint(expr=-(m.x142 - 0.15288*m.x142*m.x58) + m.x143 == 0)

m.c175 = Constraint(expr=-(m.x143 - 0.15288*m.x143*m.x59) + m.x144 == 0)

m.c176 = Constraint(expr=-(m.x145 - 0.15288*m.x145*m.x61) + m.x146 == 0)

m.c177 = Constraint(expr=-(m.x146 - 0.15288*m.x146*m.x62) + m.x147 == 0)

m.c178 = Constraint(expr=-(m.x147 - 0.15288*m.x147*m.x63) + m.x148 == 0)

m.c179 = Constraint(expr=-(m.x148 - 0.15288*m.x148*m.x64) + m.x149 == 0)

m.c180 = Constraint(expr=-(m.x149 - 0.15288*m.x149*m.x65) + m.x150 == 0)

m.c181 = Constraint(expr=-(m.x151 - 0.15288*m.x151*m.x67) + m.x152 == 0)

m.c182 = Constraint(expr=-(m.x152 - 0.15288*m.x152*m.x68) + m.x153 == 0)

m.c183 = Constraint(expr=-(m.x153 - 0.15288*m.x153*m.x69) + m.x154 == 0)

m.c184 = Constraint(expr=-(m.x154 - 0.15288*m.x154*m.x70) + m.x155 == 0)

m.c185 = Constraint(expr=-(m.x155 - 0.15288*m.x155*m.x71) + m.x156 == 0)

m.c186 = Constraint(expr=-(m.x157 - 0.15288*m.x157*m.x73) + m.x158 == 0)

m.c187 = Constraint(expr=-(m.x158 - 0.15288*m.x158*m.x74) + m.x159 == 0)

m.c188 = Constraint(expr=-(m.x159 - 0.15288*m.x159*m.x75) + m.x160 == 0)

m.c189 = Constraint(expr=-(m.x160 - 0.15288*m.x160*m.x76) + m.x161 == 0)

m.c190 = Constraint(expr=-(m.x161 - 0.15288*m.x161*m.x77) + m.x162 == 0)

m.c191 = Constraint(expr=-(m.x163 - 0.15288*m.x163*m.x79) + m.x164 == 0)

m.c192 = Constraint(expr=-(m.x164 - 0.15288*m.x164*m.x80) + m.x165 == 0)

m.c193 = Constraint(expr=-(m.x165 - 0.15288*m.x165*m.x81) + m.x166 == 0)

m.c194 = Constraint(expr=-(m.x166 - 0.15288*m.x166*m.x82) + m.x167 == 0)

m.c195 = Constraint(expr=-(m.x167 - 0.15288*m.x167*m.x83) + m.x168 == 0)

m.c196 = Constraint(expr=0.5*m.x85*m.x1 + m.x91*m.x7 + m.x97*m.x13 + m.x103*m.x19 + m.x109*m.x25 + m.x115*m.x31 + 0.5*
                         m.x121*m.x37 + m.x127*m.x43 + m.x133*m.x49 + m.x139*m.x55 + 0.5*m.x145*m.x61 + m.x151*m.x67 +
                         m.x157*m.x73 + 0.5*m.x163*m.x79 == 1)

m.c197 = Constraint(expr=0.5*m.x86*m.x2 + m.x92*m.x8 + m.x98*m.x14 + m.x104*m.x20 + m.x110*m.x26 + m.x116*m.x32 + 0.5*
                         m.x122*m.x38 + m.x128*m.x44 + m.x134*m.x50 + m.x140*m.x56 + 0.5*m.x146*m.x62 + m.x152*m.x68 +
                         m.x158*m.x74 + 0.5*m.x164*m.x80 == 1)

m.c198 = Constraint(expr=0.5*m.x87*m.x3 + m.x93*m.x9 + m.x99*m.x15 + m.x105*m.x21 + m.x111*m.x27 + m.x117*m.x33 + 0.5*
                         m.x123*m.x39 + m.x129*m.x45 + m.x135*m.x51 + m.x141*m.x57 + 0.5*m.x147*m.x63 + m.x153*m.x69 +
                         m.x159*m.x75 + 0.5*m.x165*m.x81 == 1)

m.c199 = Constraint(expr=0.5*m.x88*m.x4 + m.x94*m.x10 + m.x100*m.x16 + m.x106*m.x22 + m.x112*m.x28 + m.x118*m.x34 + 0.5*
                         m.x124*m.x40 + m.x130*m.x46 + m.x136*m.x52 + m.x142*m.x58 + 0.5*m.x148*m.x64 + m.x154*m.x70 +
                         m.x160*m.x76 + 0.5*m.x166*m.x82 == 1)

m.c200 = Constraint(expr=0.5*m.x89*m.x5 + m.x95*m.x11 + m.x101*m.x17 + m.x107*m.x23 + m.x113*m.x29 + m.x119*m.x35 + 0.5*
                         m.x125*m.x41 + m.x131*m.x47 + m.x137*m.x53 + m.x143*m.x59 + 0.5*m.x149*m.x65 + m.x155*m.x71 +
                         m.x161*m.x77 + 0.5*m.x167*m.x83 == 1)

m.c201 = Constraint(expr=0.5*m.x90*m.x6 + m.x96*m.x12 + m.x102*m.x18 + m.x108*m.x24 + m.x114*m.x30 + m.x120*m.x36 + 0.5*
                         m.x126*m.x42 + m.x132*m.x48 + m.x138*m.x54 + m.x144*m.x60 + 0.5*m.x150*m.x66 + m.x156*m.x72 +
                         m.x162*m.x78 + 0.5*m.x168*m.x84 == 1)

m.c202 = Constraint(expr=m.x85*m.x1 <= 0.15)

m.c203 = Constraint(expr=m.x86*m.x2 <= 0.15)

m.c204 = Constraint(expr=m.x87*m.x3 <= 0.15)

m.c205 = Constraint(expr=m.x88*m.x4 <= 0.15)

m.c206 = Constraint(expr=m.x89*m.x5 <= 0.15)

m.c207 = Constraint(expr=m.x90*m.x6 <= 0.15)

m.c208 = Constraint(expr=m.x91*m.x7 <= 0.15)

m.c209 = Constraint(expr=m.x92*m.x8 <= 0.15)

m.c210 = Constraint(expr=m.x93*m.x9 <= 0.15)

m.c211 = Constraint(expr=m.x94*m.x10 <= 0.15)

m.c212 = Constraint(expr=m.x95*m.x11 <= 0.15)

m.c213 = Constraint(expr=m.x96*m.x12 <= 0.15)

m.c214 = Constraint(expr=m.x97*m.x13 <= 0.15)

m.c215 = Constraint(expr=m.x98*m.x14 <= 0.15)

m.c216 = Constraint(expr=m.x99*m.x15 <= 0.15)

m.c217 = Constraint(expr=m.x100*m.x16 <= 0.15)

m.c218 = Constraint(expr=m.x101*m.x17 <= 0.15)

m.c219 = Constraint(expr=m.x102*m.x18 <= 0.15)

m.c220 = Constraint(expr=m.x103*m.x19 <= 0.15)

m.c221 = Constraint(expr=m.x104*m.x20 <= 0.15)

m.c222 = Constraint(expr=m.x105*m.x21 <= 0.15)

m.c223 = Constraint(expr=m.x106*m.x22 <= 0.15)

m.c224 = Constraint(expr=m.x107*m.x23 <= 0.15)

m.c225 = Constraint(expr=m.x108*m.x24 <= 0.15)

m.c226 = Constraint(expr=m.x109*m.x25 <= 0.15)

m.c227 = Constraint(expr=m.x110*m.x26 <= 0.15)

m.c228 = Constraint(expr=m.x111*m.x27 <= 0.15)

m.c229 = Constraint(expr=m.x112*m.x28 <= 0.15)

m.c230 = Constraint(expr=m.x113*m.x29 <= 0.15)

m.c231 = Constraint(expr=m.x114*m.x30 <= 0.15)

m.c232 = Constraint(expr=m.x115*m.x31 <= 0.15)

m.c233 = Constraint(expr=m.x116*m.x32 <= 0.15)

m.c234 = Constraint(expr=m.x117*m.x33 <= 0.15)

m.c235 = Constraint(expr=m.x118*m.x34 <= 0.15)

m.c236 = Constraint(expr=m.x119*m.x35 <= 0.15)

m.c237 = Constraint(expr=m.x120*m.x36 <= 0.15)

m.c238 = Constraint(expr=m.x121*m.x37 <= 0.15)

m.c239 = Constraint(expr=m.x122*m.x38 <= 0.15)

m.c240 = Constraint(expr=m.x123*m.x39 <= 0.15)

m.c241 = Constraint(expr=m.x124*m.x40 <= 0.15)

m.c242 = Constraint(expr=m.x125*m.x41 <= 0.15)

m.c243 = Constraint(expr=m.x126*m.x42 <= 0.15)

m.c244 = Constraint(expr=m.x127*m.x43 <= 0.15)

m.c245 = Constraint(expr=m.x128*m.x44 <= 0.15)

m.c246 = Constraint(expr=m.x129*m.x45 <= 0.15)

m.c247 = Constraint(expr=m.x130*m.x46 <= 0.15)

m.c248 = Constraint(expr=m.x131*m.x47 <= 0.15)

m.c249 = Constraint(expr=m.x132*m.x48 <= 0.15)

m.c250 = Constraint(expr=m.x133*m.x49 <= 0.15)

m.c251 = Constraint(expr=m.x134*m.x50 <= 0.15)

m.c252 = Constraint(expr=m.x135*m.x51 <= 0.15)

m.c253 = Constraint(expr=m.x136*m.x52 <= 0.15)

m.c254 = Constraint(expr=m.x137*m.x53 <= 0.15)

m.c255 = Constraint(expr=m.x138*m.x54 <= 0.15)

m.c256 = Constraint(expr=m.x139*m.x55 <= 0.15)

m.c257 = Constraint(expr=m.x140*m.x56 <= 0.15)

m.c258 = Constraint(expr=m.x141*m.x57 <= 0.15)

m.c259 = Constraint(expr=m.x142*m.x58 <= 0.15)

m.c260 = Constraint(expr=m.x143*m.x59 <= 0.15)

m.c261 = Constraint(expr=m.x144*m.x60 <= 0.15)

m.c262 = Constraint(expr=m.x145*m.x61 <= 0.15)

m.c263 = Constraint(expr=m.x146*m.x62 <= 0.15)

m.c264 = Constraint(expr=m.x147*m.x63 <= 0.15)

m.c265 = Constraint(expr=m.x148*m.x64 <= 0.15)

m.c266 = Constraint(expr=m.x149*m.x65 <= 0.15)

m.c267 = Constraint(expr=m.x150*m.x66 <= 0.15)

m.c268 = Constraint(expr=m.x151*m.x67 <= 0.15)

m.c269 = Constraint(expr=m.x152*m.x68 <= 0.15)

m.c270 = Constraint(expr=m.x153*m.x69 <= 0.15)

m.c271 = Constraint(expr=m.x154*m.x70 <= 0.15)

m.c272 = Constraint(expr=m.x155*m.x71 <= 0.15)

m.c273 = Constraint(expr=m.x156*m.x72 <= 0.15)

m.c274 = Constraint(expr=m.x157*m.x73 <= 0.15)

m.c275 = Constraint(expr=m.x158*m.x74 <= 0.15)

m.c276 = Constraint(expr=m.x159*m.x75 <= 0.15)

m.c277 = Constraint(expr=m.x160*m.x76 <= 0.15)

m.c278 = Constraint(expr=m.x161*m.x77 <= 0.15)

m.c279 = Constraint(expr=m.x162*m.x78 <= 0.15)

m.c280 = Constraint(expr=m.x163*m.x79 <= 0.15)

m.c281 = Constraint(expr=m.x164*m.x80 <= 0.15)

m.c282 = Constraint(expr=m.x165*m.x81 <= 0.15)

m.c283 = Constraint(expr=m.x166*m.x82 <= 0.15)

m.c284 = Constraint(expr=m.x167*m.x83 <= 0.15)

m.c285 = Constraint(expr=m.x168*m.x84 <= 0.15)

m.c286 = Constraint(expr=-(0.5*m.b175*m.x90 + m.b187*m.x96 + m.b199*m.x102 + m.b211*m.x108 + m.b223*m.x114 + m.b235*
                         m.x120 + 0.5*m.b247*m.x126 + m.b259*m.x132 + m.b271*m.x138 + m.b283*m.x144 + 0.5*m.b295*m.x150
                          + m.b307*m.x156 + m.b319*m.x162 + 0.5*m.b331*m.x168) + m.x344 == 0)

m.c287 = Constraint(expr=-(0.5*m.b176*m.x90 + m.b188*m.x96 + m.b200*m.x102 + m.b212*m.x108 + m.b224*m.x114 + m.b236*
                         m.x120 + 0.5*m.b248*m.x126 + m.b260*m.x132 + m.b272*m.x138 + m.b284*m.x144 + 0.5*m.b296*m.x150
                          + m.b308*m.x156 + m.b320*m.x162 + 0.5*m.b332*m.x168) + m.x345 == 0)

m.c288 = Constraint(expr=-(0.5*m.b177*m.x90 + m.b189*m.x96 + m.b201*m.x102 + m.b213*m.x108 + m.b225*m.x114 + m.b237*
                         m.x120 + 0.5*m.b249*m.x126 + m.b261*m.x132 + m.b273*m.x138 + m.b285*m.x144 + 0.5*m.b297*m.x150
                          + m.b309*m.x156 + m.b321*m.x162 + 0.5*m.b333*m.x168) + m.x346 == 0)

m.c289 = Constraint(expr=-(0.5*m.b178*m.x90 + m.b190*m.x96 + m.b202*m.x102 + m.b214*m.x108 + m.b226*m.x114 + m.b238*
                         m.x120 + 0.5*m.b250*m.x126 + m.b262*m.x132 + m.b274*m.x138 + m.b286*m.x144 + 0.5*m.b298*m.x150
                          + m.b310*m.x156 + m.b322*m.x162 + 0.5*m.b334*m.x168) + m.x347 == 0)

m.c290 = Constraint(expr=-(0.5*m.b179*m.x90 + m.b191*m.x96 + m.b203*m.x102 + m.b215*m.x108 + m.b227*m.x114 + m.b239*
                         m.x120 + 0.5*m.b251*m.x126 + m.b263*m.x132 + m.b275*m.x138 + m.b287*m.x144 + 0.5*m.b299*m.x150
                          + m.b311*m.x156 + m.b323*m.x162 + 0.5*m.b335*m.x168) + m.x348 == 0)

m.c291 = Constraint(expr=-(0.5*m.b180*m.x90 + m.b192*m.x96 + m.b204*m.x102 + m.b216*m.x108 + m.b228*m.x114 + m.b240*
                         m.x120 + 0.5*m.b252*m.x126 + m.b264*m.x132 + m.b276*m.x138 + m.b288*m.x144 + 0.5*m.b300*m.x150
                          + m.b312*m.x156 + m.b324*m.x162 + 0.5*m.b336*m.x168) + m.x349 == 0)

m.c292 = Constraint(expr=-(0.5*m.b181*m.x90 + m.b193*m.x96 + m.b205*m.x102 + m.b217*m.x108 + m.b229*m.x114 + m.b241*
                         m.x120 + 0.5*m.b253*m.x126 + m.b265*m.x132 + m.b277*m.x138 + m.b289*m.x144 + 0.5*m.b301*m.x150
                          + m.b313*m.x156 + m.b325*m.x162 + 0.5*m.b337*m.x168) + m.x350 == 0)

m.c293 = Constraint(expr=-(0.5*m.b182*m.x90 + m.b194*m.x96 + m.b206*m.x102 + m.b218*m.x108 + m.b230*m.x114 + m.b242*
                         m.x120 + 0.5*m.b254*m.x126 + m.b266*m.x132 + m.b278*m.x138 + m.b290*m.x144 + 0.5*m.b302*m.x150
                          + m.b314*m.x156 + m.b326*m.x162 + 0.5*m.b338*m.x168) + m.x351 == 0)

m.c294 = Constraint(expr=-(0.5*m.b183*m.x90 + m.b195*m.x96 + m.b207*m.x102 + m.b219*m.x108 + m.b231*m.x114 + m.b243*
                         m.x120 + 0.5*m.b255*m.x126 + m.b267*m.x132 + m.b279*m.x138 + m.b291*m.x144 + 0.5*m.b303*m.x150
                          + m.b315*m.x156 + m.b327*m.x162 + 0.5*m.b339*m.x168) + m.x352 == 0)

m.c295 = Constraint(expr=   m.b175 - m.b247 == 0)

m.c296 = Constraint(expr=   m.b176 - m.b248 == 0)

m.c297 = Constraint(expr=   m.b177 - m.b249 == 0)

m.c298 = Constraint(expr=   m.b178 - m.b250 == 0)

m.c299 = Constraint(expr=   m.b179 - m.b251 == 0)

m.c300 = Constraint(expr=   m.b180 - m.b252 == 0)

m.c301 = Constraint(expr=   m.b181 - m.b253 == 0)

m.c302 = Constraint(expr=   m.b182 - m.b254 == 0)

m.c303 = Constraint(expr=   m.b183 - m.b255 == 0)

m.c304 = Constraint(expr=   m.b184 - m.b256 == 0)

m.c305 = Constraint(expr=   m.b185 - m.b257 == 0)

m.c306 = Constraint(expr=   m.b186 - m.b258 == 0)

m.c307 = Constraint(expr=   m.b295 - m.b331 == 0)

m.c308 = Constraint(expr=   m.b296 - m.b332 == 0)

m.c309 = Constraint(expr=   m.b297 - m.b333 == 0)

m.c310 = Constraint(expr=   m.b298 - m.b334 == 0)

m.c311 = Constraint(expr=   m.b299 - m.b335 == 0)

m.c312 = Constraint(expr=   m.b300 - m.b336 == 0)

m.c313 = Constraint(expr=   m.b301 - m.b337 == 0)

m.c314 = Constraint(expr=   m.b302 - m.b338 == 0)

m.c315 = Constraint(expr=   m.b303 - m.b339 == 0)

m.c316 = Constraint(expr=   m.b304 - m.b340 == 0)

m.c317 = Constraint(expr=   m.b305 - m.b341 == 0)

m.c318 = Constraint(expr=   m.b306 - m.b342 == 0)


#python trRosetta.py T1008.npz T1008.fasta model.pdb

#adapting trRosetta PyRosetta scripts to run as functions - generating SKEMPI chain predicted PDBs
import numpy as np
import random
import json
import tempfile
from pyrosetta import *
from pyrosetta.rosetta.protocols.minimization_packing import MinMover
import os
import time

def gen_rst(npz, tmpdir, params):
    #generate restraints
    dist,omega,theta,phi = npz['dist'][0],npz['omega'][0],npz['theta'][0],npz['phi'][0]
    print ("dist: ", dist.shape)
    print ("omega: ", omega.shape)
    print ("theta: ", theta.shape)
    print ("phi: ", phi.shape)
    # dictionary to store Rosetta restraints
    rst = {'dist' : [], 'omega' : [], 'theta' : [], 'phi' : [], 'rep' : []}

    ########################################################
    # assign parameters
    ########################################################
    PCUT  = 0.05 #params['PCUT']
    PCUT1 = params['PCUT1']
    EBASE = params['EBASE']
    EREP  = params['EREP']
    DREP  = params['DREP']
    PREP  = params['PREP']
    SIGD  = params['SIGD']
    SIGM  = params['SIGM']
    MEFF  = params['MEFF']
    DCUT  = params['DCUT']
    ALPHA = params['ALPHA']

    DSTEP = params['DSTEP']
    ASTEP = np.deg2rad(params['ASTEP'])

    seq = params['seq']
    print ("number res: ", len(seq))
    ########################################################
    # repultion restraints
    ########################################################
    #cbs = ['CA' if a=='G' else 'CB' for a in params['seq']]
    '''
    prob = np.sum(dist[:,:,5:], axis=-1)
    i,j = np.where(prob<PREP)
    prob = prob[i,j]
    for a,b,p in zip(i,j,prob):
        if b>a:
            name=tmpdir.name+"/%d.%d_rep.txt"%(a+1,b+1)
            rst_line = 'AtomPair %s %d %s %d SCALARWEIGHTEDFUNC %.2f SUMFUNC 2 CONSTANTFUNC 0.5 SIGMOID %.3f %.3f\n'%('CB',a+1,'CB',b+1,-0.5,SIGD,SIGM)
            rst['rep'].append([a,b,p,rst_line])
    print("rep restraints:   %d"%(len(rst['rep'])))
    '''

    ########################################################
    # dist: 0..20A
    ########################################################
    nres = dist.shape[0]
    #print ("number res: ", nres)
    bins = np.array([4.25+DSTEP*i for i in range(32)])
    #print ("bins: ", bins.shape)
    prob = np.sum(dist[:,:,5:], axis=-1)
    #print ("prob: ", prob.shape)
    bkgr = np.array((bins/DCUT)**ALPHA)
    #print ("bkgr: ", bkgr.shape)
    attr = -np.log((dist[:,:,5:]+MEFF)/(dist[:,:,-1][:,:,None]*bkgr[None,None,:]))+EBASE
    repul = np.maximum(attr[:,:,0],np.zeros((nres,nres)))[:,:,None]+np.array(EREP)[None,None,:]
    dist = np.concatenate([repul,attr], axis=-1)
    bins = np.concatenate([DREP,bins])
    i,j = np.where(prob>PCUT)
    prob = prob[i,j]
    nbins = 35
    step = 0.5
    for a,b,p in zip(i,j,prob):
        if b>a:
            name=tmpdir.name+"/%d.%d.txt"%(a+1,b+1)
            with open(name, "w") as f:
                f.write('x_axis'+'\t%.3f'*nbins%tuple(bins)+'\n')
                f.write('y_axis'+'\t%.3f'*nbins%tuple(dist[a,b])+'\n')
                f.close()
            rst_line = 'AtomPair %s %d %s %d SPLINE TAG %s 1.0 %.3f %.5f'%('CB',a+1,'CB',b+1,name,1.0,step)
            rst['dist'].append([a,b,p,rst_line])
    print("dist restraints:  %d"%(len(rst['dist'])))

    ########################################################
    # omega: -pi..pi
    ########################################################
    nbins = omega.shape[2]-1+4
    bins = np.linspace(-np.pi-1.5*ASTEP, np.pi+1.5*ASTEP, nbins)
    prob = np.sum(omega[:,:,1:], axis=-1)
    i,j = np.where(prob>PCUT)
    prob = prob[i,j]
    omega = -np.log((omega+MEFF)/(omega[:,:,-1]+MEFF)[:,:,None])
    omega = np.concatenate([omega[:,:,-2:],omega[:,:,1:],omega[:,:,1:3]],axis=-1)
    for a,b,p in zip(i,j,prob):
        if b>a:
            name=tmpdir.name+"/%d.%d_omega.txt"%(a+1,b+1)
            with open(name, "w") as f:
                f.write('x_axis'+'\t%.5f'*nbins%tuple(bins)+'\n')
                f.write('y_axis'+'\t%.5f'*nbins%tuple(omega[a,b])+'\n')
                f.close()
            rst_line = 'Dihedral CA %d CB %d CB %d CA %d SPLINE TAG %s 1.0 %.3f %.5f'%(a+1,a+1,b+1,b+1,name,1.0,ASTEP)
            rst['omega'].append([a,b,p,rst_line])
    print("omega restraints: %d"%(len(rst['omega'])))

    ########################################################
    # theta: -pi..pi
    ########################################################
    prob = np.sum(theta[:,:,1:], axis=-1)
    i,j = np.where(prob>PCUT)
    prob = prob[i,j]
    theta = -np.log((theta+MEFF)/(theta[:,:,-1]+MEFF)[:,:,None])
    theta = np.concatenate([theta[:,:,-2:],theta[:,:,1:],theta[:,:,1:3]],axis=-1)
    for a,b,p in zip(i,j,prob):
        if b!=a:
            name=tmpdir.name+"/%d.%d_theta.txt"%(a+1,b+1)
            with open(name, "w") as f:
                f.write('x_axis'+'\t%.3f'*nbins%tuple(bins)+'\n')
                f.write('y_axis'+'\t%.3f'*nbins%tuple(theta[a,b])+'\n')
                f.close()
            rst_line = 'Dihedral N %d CA %d CB %d CB %d SPLINE TAG %s 1.0 %.3f %.5f'%(a+1,a+1,a+1,b+1,name,1.0,ASTEP)
            rst['theta'].append([a,b,p,rst_line])
            #if a==0 and b==9:
            #    with open(name,'r') as f:
            #        print(f.read())
    print("theta restraints: %d"%(len(rst['theta'])))

    ########################################################
    # phi: 0..pi
    ########################################################
    nbins = phi.shape[2]-1+4
    bins = np.linspace(-1.5*ASTEP, np.pi+1.5*ASTEP, nbins)
    prob = np.sum(phi[:,:,1:], axis=-1)
    i,j = np.where(prob>PCUT)
    prob = prob[i,j]
    phi = -np.log((phi+MEFF)/(phi[:,:,-1]+MEFF)[:,:,None])
    phi = np.concatenate([np.flip(phi[:,:,1:3],axis=-1),phi[:,:,1:],np.flip(phi[:,:,-2:],axis=-1)], axis=-1)
    for a,b,p in zip(i,j,prob):
        if b!=a:
            name=tmpdir.name+"/%d.%d_phi.txt"%(a+1,b+1)
            with open(name, "w") as f:
                f.write('x_axis'+'\t%.3f'*nbins%tuple(bins)+'\n')
                f.write('y_axis'+'\t%.3f'*nbins%tuple(phi[a,b])+'\n')
                f.close()
            rst_line = 'Angle CA %d CB %d CB %d SPLINE TAG %s 1.0 %.3f %.5f'%(a+1,a+1,b+1,name,1.0,ASTEP)
            rst['phi'].append([a,b,p,rst_line])
            #if a==0 and b==9:
            #    with open(name,'r') as f:
            #        print(f.read())

    print("phi restraints:   %d"%(len(rst['phi'])))

    return rst

def set_random_dihedral(pose):
    nres = pose.total_residue()
    for i in range(1, nres):
        phi,psi=random_dihedral()
        pose.set_phi(i,phi)
        pose.set_psi(i,psi)
        pose.set_omega(i,180)

    return(pose)

#pick phi/psi randomly from:
#-140  153 180 0.135 B
# -72  145 180 0.155 B
#-122  117 180 0.073 B
# -82  -14 180 0.122 A
# -61  -41 180 0.497 A
#  57   39 180 0.018 L
def random_dihedral():
    phi=0
    psi=0
    r=random.random()
    if(r<=0.135):
        phi=-140
        psi=153
    elif(r>0.135 and r<=0.29):
        phi=-72
        psi=145
    elif(r>0.29 and r<=0.363):
        phi=-122
        psi=117
    elif(r>0.363 and r<=0.485):
        phi=-82
        psi=-14
    elif(r>0.485 and r<=0.982):
        phi=-61
        psi=-41
    else:
        phi=57
        psi=39
    return(phi, psi)

def read_fasta(file):
    fasta=""
    with open(file, "r") as f:
        for line in f:
            if(line[0] == ">"):
                continue
            else:
                line=line.rstrip()
                fasta = fasta + line;
    return fasta

def remove_clash(scorefxn, mover, pose):
    for _ in range(0, 5):
        if float(scorefxn(pose)) < 10:
            break
        mover.apply(pose)

def add_rst(pose, rst, sep1, sep2, params, nogly=False):

    pcut=params['PCUT']
    seq = params['seq']

    array=[]

    if nogly==True:
        array += [line for a,b,p,line in rst['dist'] if abs(a-b)>=sep1 and abs(a-b)<sep2 and seq[a]!='G' and seq[b]!='G' and p>=pcut]
        if params['USE_ORIENT'] == True:
            array += [line for a,b,p,line in rst['omega'] if abs(a-b)>=sep1 and abs(a-b)<sep2 and seq[a]!='G' and seq[b]!='G' and p>=pcut+0.5] #0.5
            array += [line for a,b,p,line in rst['theta'] if abs(a-b)>=sep1 and abs(a-b)<sep2 and seq[a]!='G' and seq[b]!='G' and p>=pcut+0.5] #0.5
            array += [line for a,b,p,line in rst['phi'] if abs(a-b)>=sep1 and abs(a-b)<sep2 and seq[a]!='G' and seq[b]!='G' and p>=pcut+0.6] #0.6
    else:
        array += [line for a,b,p,line in rst['dist'] if abs(a-b)>=sep1 and abs(a-b)<sep2 and p>=pcut]
        if params['USE_ORIENT'] == True:
            array += [line for a,b,p,line in rst['omega'] if abs(a-b)>=sep1 and abs(a-b)<sep2 and p>=pcut+0.5]
            array += [line for a,b,p,line in rst['theta'] if abs(a-b)>=sep1 and abs(a-b)<sep2 and p>=pcut+0.5]
            array += [line for a,b,p,line in rst['phi'] if abs(a-b)>=sep1 and abs(a-b)<sep2 and p>=pcut+0.6] #0.6

    if len(array) < 1:
        return

    random.shuffle(array)

    # save to file
    tmpname = params['TDIR']+'/minimize.cst'
    with open(tmpname,'w') as f:
        for line in array:
            f.write(line+'\n')
        f.close()

    # add to pose
    constraints = rosetta.protocols.constraint_movers.ConstraintSetMover()
    constraints.constraint_file(tmpname)
    constraints.add_constraints(True)
    constraints.apply(pose)

    os.remove(tmpname)

def generatePDB(fasta, npz, out):

    ########################################################
    # process inputs
    ########################################################

    # read params
    #scriptdir = os.path.dirname(os.path.realpath(__file__))
    with open('./trRosettaPyRosetta/data/params.json') as jsonfile:
        params = json.load(jsonfile)

    args = {'pcut':params['PCUT'], 'mode':2,  'wdir':params['WDIR'], 'steps':1000, 'use_orient':True, 'fast_relax':True}
    #set FASTA, NPZ, OUT
    args['FASTA'] = fasta
    args['NPZ'] = npz
    args['OUT'] = out
    params['PCUT'] = args['pcut']
    params['USE_ORIENT'] = args['use_orient']
    # init PyRosetta
    init('-hb_cen_soft -relax:default_repeats 5 -default_max_cycles 200 -out:level 100')

    # Create temp folder to store all the restraints
    tmpdir = tempfile.TemporaryDirectory(prefix=args['wdir']+'/')
    params['TDIR'] = tmpdir.name
    print('temp folder:     ', tmpdir.name)

    # read and process restraints & sequence
    npz = np.load(args['NPZ'])
    print (type(npz))
    seq = read_fasta(args['FASTA'])
    L = len(seq)
    print (L)
    params['seq'] = seq
    rst = gen_rst(npz,tmpdir,params)
    seq_polyala = 'A'*len(seq)

    ########################################################
    # Scoring functions and movers
    ########################################################
    sf = ScoreFunction()
    sf.add_weights_from_file('./trRosettaPyRosetta/data/scorefxn.wts')

    sf1 = ScoreFunction()
    sf1.add_weights_from_file('./trRosettaPyRosetta/data/scorefxn1.wts')

    sf_vdw = ScoreFunction()
    sf_vdw.add_weights_from_file('./trRosettaPyRosetta/data/scorefxn_vdw.wts')

    sf_cart = ScoreFunction()
    sf_cart.add_weights_from_file('./trRosettaPyRosetta/data/scorefxn_cart.wts')

    mmap = MoveMap()
    mmap.set_bb(True)
    mmap.set_chi(False)
    mmap.set_jump(True)

    min_mover = MinMover(mmap, sf, 'lbfgs_armijo_nonmonotone', 0.0001, True)
    min_mover.max_iter(1000)

    min_mover1 = MinMover(mmap, sf1, 'lbfgs_armijo_nonmonotone', 0.0001, True)
    min_mover1.max_iter(1000)

    min_mover_vdw = MinMover(mmap, sf_vdw, 'lbfgs_armijo_nonmonotone', 0.0001, True)
    min_mover_vdw.max_iter(500)

    min_mover_cart = MinMover(mmap, sf_cart, 'lbfgs_armijo_nonmonotone', 0.0001, True)
    min_mover_cart.max_iter(1000)
    min_mover_cart.cartesian(True)

    repeat_mover = RepeatMover(min_mover, 3)

    ########################################################
    # initialize pose
    ########################################################
    pose = pose_from_sequence(seq, 'centroid' )

    # mutate GLY to ALA
    for i,a in enumerate(seq):
        if a == 'G':
            mutator = rosetta.protocols.simple_moves.MutateResidue(i+1,'ALA')
            mutator.apply(pose)
            print('mutation: G%dA'%(i+1))

    set_random_dihedral(pose)
    remove_clash(sf_vdw, min_mover_vdw, pose)

    ########################################################
    # minimization
    ########################################################

    if args['mode'] == 0:

        # short
        print('short')
        add_rst(pose, rst, 1, 12, params)
        repeat_mover.apply(pose)
        min_mover_cart.apply(pose)
        remove_clash(sf_vdw, min_mover1, pose)

        # medium
        print('medium')
        add_rst(pose, rst, 12, 24, params)
        repeat_mover.apply(pose)
        min_mover_cart.apply(pose)
        remove_clash(sf_vdw, min_mover1, pose)

        # long
        print('long')
        add_rst(pose, rst, 24, len(seq), params)
        repeat_mover.apply(pose)
        min_mover_cart.apply(pose)
        remove_clash(sf_vdw, min_mover1, pose)

    elif args['mode'] == 1:

        # short + medium
        print('short + medium')
        add_rst(pose, rst, 3, 24, params)
        repeat_mover.apply(pose)
        min_mover_cart.apply(pose)
        remove_clash(sf_vdw, min_mover1, pose)

        # long
        print('long')
        add_rst(pose, rst, 24, len(seq), params)
        repeat_mover.apply(pose)
        min_mover_cart.apply(pose)
        remove_clash(sf_vdw, min_mover1, pose)

    elif args['mode'] == 2: #default behavior

        # short + medium + long
        print('short + medium + long')
        add_rst(pose, rst, 1, len(seq), params)
        repeat_mover.apply(pose)
        min_mover_cart.apply(pose)
        remove_clash(sf_vdw, min_mover1, pose)

    # mutate ALA back to GLY
    for i,a in enumerate(seq):
        if a == 'G':
            mutator = rosetta.protocols.simple_moves.MutateResidue(i+1,'GLY')
            mutator.apply(pose)
            print('mutation: A%dG'%(i+1))

    ########################################################
    # full-atom refinement
    ########################################################

    if args['fast_relax'] == True:

        sf_fa = create_score_function('ref2015')
        sf_fa.set_weight(rosetta.core.scoring.atom_pair_constraint, 5)
        sf_fa.set_weight(rosetta.core.scoring.dihedral_constraint, 1)
        sf_fa.set_weight(rosetta.core.scoring.angle_constraint, 1)

        mmap = MoveMap()
        mmap.set_bb(True)
        mmap.set_chi(True)
        mmap.set_jump(True)

        relax = rosetta.protocols.relax.FastRelax()
        relax.set_scorefxn(sf_fa)
        relax.max_iter(200)
        relax.dualspace(True)
        relax.set_movemap(mmap)

        pose.remove_constraints()
        switch = SwitchResidueTypeSetMover("fa_standard")
        switch.apply(pose)

        print('relax...')
        params['PCUT'] = 0.15
        add_rst(pose, rst, 1, len(seq), params, True)
        relax.apply(pose)

    ########################################################
    # save final model
    ########################################################
    pose.dump_pdb(args['OUT'])

def runOnDirectories():
    #generate test PDBs for trRosetta predictions currently done

    #for each MSA, attempt trRosetta structural prediction
    #for cutoffLevel in cutoffs:
    predDir = "./SKEMPI_CHAIN_FILES/trRosettaOutputs/"
    fastaDir = "./SKEMPI_CHAIN_FILES/fastaFiles/"
    pdbDir = "./SKEMPI_CHAIN_FILES/pdbStructures/"

    allFiles = os.listdir(predDir)
    print (len(os.listdir(predDir)))
    failedFiles = []
    for i in range(0,len(allFiles)):
        print ("ON ", i , " OUT OF ", len(allFiles))
        fileName = allFiles[i]
        try:
            nameComps = fileName.replace("_keras_xaa.npz","").split("_") #need recombine all but last list entry
            actualName = "_".join(nameComps[0:len(nameComps)-1])
            pdbName = "_".join(nameComps[0:len(nameComps)])
            print (fileName, actualName)
            fastaFile = fastaDir + actualName + ".fasta"
            npzFile = predDir +fileName
            pdbName = pdbDir + pdbName + ".pdb"
            print ("PDB: ", pdbName)
            print ("NPZ: ", npzFile)
            print ("FASTA: ", fastaFile)
            if not os.path.isfile(pdbName) and os.path.isfile(npzFile):
                #if str(cutoffLevel) in fileName:
                generatePDB(fastaFile, npzFile, pdbName)
            else:
                print ("pdb exists")
        except:
            print ("attempt failed, problem with trRosetta output?")
            failedFiles.append(fileName)

    allPDBs = os.listdir(pdbDir)
    print (len(allPDBs))
    print ("Failed files: ")
    print (failedFiles)

if __name__ == '__main__':
    fasta = "./TR015032_results/negative_279.fasta"
    predNPZ = "./TR015032_results/seq.npz"
    startTime = time.time()
    generatePDB(fasta, predNPZ, "trRosettaPredV1.pdb")
    print ("OVERALL TIME: ")
    print (time.time() - startTime)