
function S_MSE= target_de(x,deg,V_leb,...
    family_type, S_struct)

% INITIALIZATION.

switch family_type
    case 1
        y=eps;
    case 2
        y=10^20;
    case 3
        y=10^20;
end

S_MSE.I_nc      = 0; % no constraints
S_MSE.FVr_ca    = 0; % no constraint array
S_MSE.I_no      = 1; % number of objectives (costs)
S_MSE.FVr_oa(1) = y;

%-------------------------
% ATTACHED FUNCTIONS.
%-------------------------
if size(x,1) == 0

    switch family_type
        case 1
            y=eps;
        case 2
            y=10^20;
        case 3
            y=10^20;
    end

    S_MSE.I_nc      = 0; % no constraints
    S_MSE.FVr_ca    = 0; % no constraint array
    S_MSE.I_no      = 1; % number of objectives (costs)
    S_MSE.FVr_oa(1) = y;

else

    x=x';

	pts=g(x,S_struct.domain);

	y = target(pts,S_struct.domain,V_leb,deg);

    % DEFAULT VALUE CORRECTION IN CASE OF "y=NaN"or .
    if (isnan(y) == 1) |  (abs(y) == Inf)
        switch family_type
            case 1
                y=eps;
            case 2
                y=10^20;
            case 3
                y=10^20;
        end
    end


    %----strategy to put everything into a cost function------------
    S_MSE.I_nc      = 0; % no constraints
    S_MSE.FVr_ca    = 0; % no constraint array
    S_MSE.I_no      = 1; % number of objectives (costs)
    S_MSE.FVr_oa(1) = y;

end

