I have 799 decisions {0,1} that need to be optimized to maximize (OVWDL). When a maintenance decision is taken (x=1), a treatment cost is allocated to the total cost. My constraint is to find the best combination of decisions that keep the total costs within my budget. I use the following code:
function OVWDL=dl_max(x)load('2018Optim-Region-2-Conditio-2017-one_mile')DL_T=DL_I+x.*DL_inc-(DL_dec-x.*DL_dec);cost_T=sum(x.*cost);OVWDL=-sum(DL_T.*Lseg)/sum(Lseg);endfunction [c, ceq] = mybudget(x)load('2018Optim-Region-2-Conditio-2017-one_mile')B=4580000; %My budget
cost_T=sum(x.*cost);c=cost_T-B;ceq=[];endload('2018Optim-Region-2-Conditio-2017-one_mile')FitnessFunction=@dl_max;ConstraintFunction=@mybudget;n = length(Lseg);LB=zeros(1,n);UB=ones(1,n);integers=linspace(1,n,n);[x,fval]=ga(FitnessFunction,n,[],[],[],[],LB,UB,ConstraintFunction,integers);
When I apply this code on a small data size, it works. But for the 799 cases, it violates the constraint and the total costs exceed the budget limit. Could anyone help me how to enhance the prediction ability of this model?
Best Answer