-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
Model:
float: r = 0.01;
int: years = 121;
var 0.0..10000.0: c;
array[1..years] of var 0.0..20000.0: m;
constraint m[1] = c;
constraint forall(i in 2..(years))
(m[i] = m[i-1]*(1+r) + c);
constraint m[years] >= 10000.0;
solve minimize c;
output ["\(c)\n\(c*years)\n"];
Gecode solves this model on my machine in approximately 1 second. If I make one change to the output:
- output ["\(c)\n\(c*years)\n"];
+ output ["\(c)\n\(c*years)\n\(m[years])"];It gets the same solution in the same amount of time, and then continues running indefinitely. This seems to be sensitive to the chosen parameters. Setting years = 120 or r >= 0.3 causes the bug to disappear.
This is Version 2.9.3 (1832659182) on Windows 11.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels