You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: MOKP.m
    path of file: ./repos/PlatEMO/PlatEMO/Problems/Multi-objective optimization/Real-world MOPs
    
    the code of the file until where you have to start completion: classdef MOKP < PROBLEM
% <multi/many> <binary> <large/none>
% The multi-objective knapsack problem

%------------------------------- Reference --------------------------------
% E. Zitzler and L. Thiele, Multiobjective evolutionary algorithms: A

    
function Setting(obj)
            % Parameter setting
            if isempty(obj.M); obj.M = 2; end
            if isempty(obj.D); obj.D = 250; end
            obj.encoding = 4 + zeros(1,obj.D);
            % Randomly generate profits and weights
            file = sprintf('MOKP-M%d-D%d.mat',obj.M,obj.D);
            file = fullfile(fileparts(mfilename('fullpath')),file);
            if exist(file,'file') == 2
                load(file,'P','W');
            else
                P = randi([10,100],obj.M,obj.D);
                W = randi([10,100],obj.M,obj.D);
                save(file,'P','W');
            end