lb = [200 200 16 4 8 75 100];
ub = [1000 1500 25 12 10 100 250];

% Guide for more details.
opts = gaoptimset(...
    'PopulationSize', 150, ...
    'Generations', 200, ...
    'EliteCount', 10, ...
    'TolFun', 1e-15, ...
    'PlotFcns', @gaplotbestf);

%%
% for reproducibility.
rng(0, 'twister');
[xbest, fbest, exitflag] = ga(@column13920Volume,7, [], [], [], [], ...
    lb, ub, @column13920Constraints,[], opts);
    
% GA.
display(xbest);

 
fprintf('\nCost function returned by ga = %g\n', fbest);


lb = [1 1 1 1 1 1 1];
ub = [33 53 3 5 2 6 16];



rng(0, 'twister');
[xbestDisc, fbestDisc, exitflagDisc] = ga(@column13920VolumeWithDisc, ...
    7, [], [], [], [], lb, ub, @column13920ConstraintsWithDisc,1:7, opts);


xbestDisc = column13920MapVariables(xbestDisc);
display(xbestDisc);


fprintf('\nCost function returned by ga = %g\n', fbestDisc);

% discrete variables in the problem formulation.