From: Nico P. <Nic...@gm...> - 2014-11-21 13:10:38
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>Hi Anders,</div> <div> </div> <div>sorry to bother you again, but I have another problem. I just optimized a problem and the solution seems perfectly fine (I attach the state of the ExpressionBasedModel below).</div> <div>The variable assignment (w0 = w16 = 0.5) is indeed a minimal solution and the value of the objective is 0, as I would expect. However, the getValue() method yields 1 for the</div> <div>result object and I do not understand why. In fact, the objective state in the ExpressionBasedModel says "Objective: 0.0 (1.000000)". So, I guess, getValue() yields the second</div> <div>value. But what do these values actually mean? The only reasonable explanation for me is that I optimize the objective a + c' w where w is my variable vector, c' the transposed</div> <div>objective vector and a an offset. So maybe 0 is the solution of the linear part (c' w) and 1 the solution of the complete objective? Then, I guess, I set an offset of 1 by accident. </div> <div>I initialize the objective with</div> <div><br/> Expression tmpExpr = tmpModel.addExpression("Objective");<br/> tmpExpr.setLinearFactor(noWorlds, BigMath.ONE); //noworlds=32 <br/> tmpExpr.weight(BigMath.ONE);</div> <div> </div> <div>So maybe weight corresponds to the offset? I tried to set it to zero, but this does not seem to be the solution. Do you see my mistake? Below you find the complete state</div> <div>of the ExpressionBasedModel (constraint0 and constraint1 are some linear constraints that are indeed satisfied).</div> <div> </div> <div>############################################<br/> 0 <= w0: 0.500000<br/> 0 <= w1: 0<br/> 0 <= w2: 0<br/> 0 <= w3: 0<br/> 0 <= w4: 0<br/> 0 <= w5: 0<br/> 0 <= w6: 0<br/> 0 <= w7: 0<br/> 0 <= w8: 0<br/> 0 <= w9: 0<br/> 0 <= w10: 0<br/> 0 <= w11: 0<br/> 0 <= w12: 0<br/> 0 <= w13: 0<br/> 0 <= w14: 0<br/> 0 <= w15: 0<br/> 0 <= w16: 0.500000<br/> 0 <= w17: 0<br/> 0 <= w18: 0<br/> 0 <= w19: 0<br/> 0 <= w20: 0<br/> 0 <= w21: 0<br/> 0 <= w22: 0<br/> 0 <= w23: 0<br/> 0 <= w24: 0<br/> 0 <= w25: 0<br/> 0 <= w26: 0<br/> 0 <= w27: 0<br/> 0 <= w28: 0<br/> 0 <= w29: 0<br/> 0 <= w30: 0<br/> 0 <= w31: 0<br/> 0 <= w32: 0<br/> 0 <= constraint1: 0.0 (1.000000) <= 0<br/> 1.000000 <= Normalization: 1.0 (1.000000) <= 1.000000<br/> 0 <= constraint0: 0.0 (1.000000) <= 0<br/> Objective: 0.0 (1.000000)<br/> ############################################</div> <div> </div> <div>Best regards</div> <div>Nico</div> </div></div></body></html> |