I'm new in reliability optimization problems topic. I want to solve these problems with meta-heuristic algorithms. How can I encode solutions for generating initial population?
Let us assume that you need to generate an initial population matrix xx of size n with m variables. This means that you wanted to generate n individuals each having m components (variables). Now, each of these m variables must be having some lower and upper bounds. Let us assume that lower bound of m variables is represented by xmin and the upper bounds of m variables is represented by xmax. Here, xmin and xmax are an array (row) vector of size m. Now, the population xx can be generated using the following codes in MATLAB.........
xmin=[0 0... 0]; %upto m values for example
xmax=[10 10 .... 10]; % upto m values for example
for i=1:n
for j=1:m
xx(i,j)=xmin(j)+(xmax(j)-xmin(j))*rand();
end
end
**************************
Lets you want to generate an initial population of size 10 of 6 variables whose lower and upper bounds are 3 and 8 respectively. Then, the following codes will do it:
xmin=[3 3 3 3 3 3];
xmax=[8 8 8 8 8 8];
for i=1:10
for j=1:6
xx(i,j)=xmin(j)+(xmax(j)-xmin(j))*rand();
end
end
xx
answer will be
xx =
7.0736 7.5290 3.6349 7.5669 6.1618 3.4877
4.3925 5.7344 7.7875 7.8244 3.7881 7.8530
7.7858 5.4269 7.0014 3.7094 5.1088 7.5787
6.9610 7.7975 6.2787 3.1786 7.2456 7.6700
6.3937 6.7887 6.7157 4.9611 6.2774 3.8559
6.5302 3.1592 4.3846 3.2309 3.4857 7.1173
6.4741 4.5855 7.7511 3.1722 5.1937 4.9078
6.8276 6.9760 3.9344 5.4488 5.2279 6.2316
6.5468 6.7734 4.3801 6.3985 6.2755 3.8131
3.5950 5.4918 7.7987 4.7019 5.9263 4.1191
I hope you will find it useful. Note: when you will run on your pc, the results may be different as the population generated is random in nature.
Let us assume that you need to generate an initial population matrix xx of size n with m variables. This means that you wanted to generate n individuals each having m components (variables). Now, each of these m variables must be having some lower and upper bounds. Let us assume that lower bound of m variables is represented by xmin and the upper bounds of m variables is represented by xmax. Here, xmin and xmax are an array (row) vector of size m. Now, the population xx can be generated using the following codes in MATLAB.........
xmin=[0 0... 0]; %upto m values for example
xmax=[10 10 .... 10]; % upto m values for example
for i=1:n
for j=1:m
xx(i,j)=xmin(j)+(xmax(j)-xmin(j))*rand();
end
end
**************************
Lets you want to generate an initial population of size 10 of 6 variables whose lower and upper bounds are 3 and 8 respectively. Then, the following codes will do it:
xmin=[3 3 3 3 3 3];
xmax=[8 8 8 8 8 8];
for i=1:10
for j=1:6
xx(i,j)=xmin(j)+(xmax(j)-xmin(j))*rand();
end
end
xx
answer will be
xx =
7.0736 7.5290 3.6349 7.5669 6.1618 3.4877
4.3925 5.7344 7.7875 7.8244 3.7881 7.8530
7.7858 5.4269 7.0014 3.7094 5.1088 7.5787
6.9610 7.7975 6.2787 3.1786 7.2456 7.6700
6.3937 6.7887 6.7157 4.9611 6.2774 3.8559
6.5302 3.1592 4.3846 3.2309 3.4857 7.1173
6.4741 4.5855 7.7511 3.1722 5.1937 4.9078
6.8276 6.9760 3.9344 5.4488 5.2279 6.2316
6.5468 6.7734 4.3801 6.3985 6.2755 3.8131
3.5950 5.4918 7.7987 4.7019 5.9263 4.1191
I hope you will find it useful. Note: when you will run on your pc, the results may be different as the population generated is random in nature.
In fact my chromosome includes some subsystems. Each subsystem has (n) components and a reliability ( r). It is better to say each subsystem has two parts: real and integer numbers. Chromosome represents a solution of mixed-integer problem. that
About your first population generation and it evolution by Random Localization of the Extreme of a Function of a Variable Code, that could be found in the monografic work "Analysis and Synthesis of Engineering Systems".
The practical application of the Integration of Variables method to any concrete case, when the searching procedure of local minima of a function of a variable code of possible solutions to the given discrete optimization task with random variation of serch intervals for upgrading the successive solutions populations is illustrated.
In each iteration the search of the minimum of a function of a variable code (that constitute the values, in the decimal system of numeration, of the variable-code of the looked for solution) is carried. The initial variable code values are generated aleatorily inside the interval of possible values of the solution variable code. Searching solutions is carried out by the Non lineal Programming method of Localization of the minimum of the function of one independent variable. The quality function Z can be interpreted in the same way that Genetic Algorithms do, as fitness, and it could include the result of the calculation of a penalty function for the no fulfillment of the restrictions. As a particular case of penalty functions the rejection of non feasible solutions could be used. In each localization iteration it is included in the population the found solutions, while the population's size is smaller than the established one (CSol) or the population is upgraded in case it already reached the established size. As upgrading it is understood the comparison of the objective function value of the solutions generated in the given step, and in the case the fitness of the just generated solution is better that the worse in the population solution this last one is substituted by the just generated one. Once the foreseen precision is reached the process of generation of x random values it is restarted.
In figure 24 of thementioned monographic work the execution of a localization step by the proposed algorithm is illustrated. Two variable codes are aleatory generated in the interval xinf-xsup. Of the three obtained subintervals it is eliminated that one which contains the higher Z value and there are again generated other two values inside the obtained subinterval. The process is repeated while the longitude of the interval xinf-xsup is higher to a given precision. While the population's size is inferior to settled down one, it is added into the population, in each step, the generated solutions. Once reached the population's required size the Z values of both generated solutions are compared with the Z value of the worst population solution, and in the event of having smaller value of Z, the corresponding solution substitutes the worst in the population.
Once reached the precision (for the discrete case xsup-xinf £2) there are assigned to the variables xsup and xinf its initial values. The process is repeated until a serial number of times longer than a predetermined value, non population's solution is substituted.
The maximum value required for the variable code could be calculated, for a total of m variable of the studied optimization problem as:
Where:
Inter0 = xsup: Initial longitude of the search interval.
MaxCod(i): Maximum number of foreseen solution options of the i variable.
For calculating the Z value according the associated procedure for each x generated value it is required to convert that code value in solution options of each one of the m variables of the original task. A possible algorithm for decoding the generated values of any variable code x it is the following one:
For i = 1 to m
Cod (i) = x mod MaxCod(i) + 1
x = [ x / MaxCod(i)]
Next i
Where:
Cod (i) : Serial number of solution option of the ith variable.
[a] : integer value of a.
You could find mentioned monografic work in my researchgate profile.