龙空技术网

VIKOR算法步骤及代码实现(MATLAB)

LearningYard学苑 59

前言:

目前各位老铁们对“q学习算法matlab程序”可能比较关注,我们都需要分析一些“q学习算法matlab程序”的相关资讯。那么小编同时在网摘上网罗了一些关于“q学习算法matlab程序””的相关文章,希望同学们能喜欢,姐妹们一起来了解一下吧!

VIKOR方法的基本思想是:确定正理想解(PIS)与负理想解(NIS),然后比较待选方案的评估值,根据其于理想指标值的距离大小择优。其中,正理想解是各评价准则中的最优值,而负理想解则是各评价准则中的最差值。

VIKOR方法基于以下形式的测度:

The basic idea of the VIKOR method is to determine the positive ideal solution (PIS) and the negative ideal solution (NIS), and then compare the evaluation values of the options to be selected, and choose the best according to the distance from the ideal index value. Among them, the positive ideal solution is the optimal value in each evaluation criterion, and the negative ideal solution is the worst value in each evaluation criterion.

The VIKOR method is based on measures of the following form:

# 1.构建评价模型(以实数为例)#

代码实现:

为了将来修改了矩阵代码仍然能够正常运行,需要先将矩阵行和列的元素个数求出来

The basic idea of the VIKOR method is to determine the positive ideal solution (PIS) and the negative ideal solution (NIS), and then compare the evaluation values of the options to be selected, and choose the best according to the distance from the ideal index value. Among them, the positive ideal solution is the optimal value in each evaluation criterion, and the negative ideal solution is the worst value in each evaluation criterion.

The VIKOR method is based on measures of the following form:

# 2.决策指标标准化 #

标准化处理是为了消除量纲对最终结果的影响,使不同变量具有可比性。决策指标包含效益型指标和成本型指标。

Standardization is to eliminate the influence of dimensions on the final result and make different variables comparable. Decision-making indicators include benefit-type indicators and cost-type indicators.

代码实现:

输出结果:

#3.确定群体效用与个体遗憾#

权重录入及最大、最小值输入:

Tip 1:这里需要用到一个技巧——空集与“end+1”。如果我们不采用这种方法,那么每次循环时后一个值就会覆盖掉前一个值,Best_Value与Worst_Value就会如下图所示变成1个实数,而不是1*4的向量。“end+1”可以将循环中即将被替换的值保留,避免了数值覆盖的情况发生。注意这里需要在循环前建立空集,否则系统会提示找不到变量。

Tip 1: A trick is needed here-empty set and "end+1". If we don't use this method, the next value will overwrite the previous value each time the loop is repeated, and Best_Value and Worst_Value will become a real number as shown in the figure below, instead of a 1*4 vector. "End+1" can keep the value to be replaced in the loop, avoiding the value overwriting. Note that an empty set needs to be created before the loop, otherwise the system will prompt that the variable cannot be found.

求出最大值与最小值后,可计算出群体效用值S的值。由于S是由一个方案中所有属性值经计算后组合而成,所以我们可先单独求出,再组合成S。

After finding the maximum and minimum values, the value of the group utility value S can be calculated. Since S is a combination of all the attribute values in a scheme after calculation, we can find it separately and then combine it into S.

代码实现:

计算个体遗憾值:

输出结果:

# 4.计算折衷决策指标值 #

根据S和R计算决策指标Q的值,指标Q值越小方案越优。

Calculate the value of the decision index Q according to S and R. The smaller the value of the index Q, the better the solution.

代码实现:

输出结果:

#5.确定备选方案排序及折衷方案 #

代码实现:

输出结果:

Tip 2:需要注意的是,这里要用num2str将数值转化为字符串形式,并用中括号连接所有字符内容。另外还用到了matlab中的分支结构:if…else…end。这种分支结构的格式为:

Tip 2: It should be noted that here, num2str is used to convert the value into a string form, and brackets are used to connect all characters. In addition, the branch structure in matlab is used: if...else...end. The format of this branch structure is:

# 6.敏感性分析 #

在实际决策中,折衷系数不同,方案排序也会受到影响。因此,本文将v在0~1之间以0.1为步长进行11次取值,进行敏感性分析,检验评价模型的稳定性。

代码实现:

In actual decision-making, the trade-off coefficient is different, and the order of the schemes will also be affected. Therefore, this paper takes the value of v between 0 and 1 with a step length of 0.1 for 11 times, carries out a sensitivity analysis, and tests the stability of the evaluation model.

扰动折衷系数敏感性分析矩阵结果:

Sensitivity analysis matrix result of disturbance trade-off coefficient:

对扰动后的方案进行排序:

Sort the schemes after the disturbance:

扰动折衷系数敏感性分析排序结果:

Perturbation compromise coefficient sensitivity analysis ranking results:

通过上述敏感性分析,在不同的值下,4个备选方案的排序主要以方案1和方案4为主导。因此可以认定该模型对的扰动不敏感,进一步说明该方法具备良好的稳定性。

Through the above-mentioned sensitivity analysis, under different values, the ranking of the 4 alternatives is mainly dominated by alternatives 1 and 4. Therefore, it can be concluded that the model is not sensitive to the disturbance, which further shows that the method has good stability.

翻译:谷歌翻译

参考资料:网络

本文由LearningYard学苑原创,如有侵权请联系删除

# 文字、排版:圈儿

#审核:程丽燕

标签: #q学习算法matlab程序 #优化算法matlab程序