{"id":290547,"date":"2018-10-09T19:00:02","date_gmt":"2018-10-09T15:00:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=290547"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2018-10-09T15:00:02","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=290547","title":{"rendered":"\u0422\u0435\u043e\u0440\u0438\u044f \u0438\u0433\u0440: \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043d\u0430 Kotlin"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u0422\u0435\u043e\u0440\u0438\u044f \u0438\u0433\u0440 \u2014 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0434\u0438\u0441\u0446\u0438\u043f\u043b\u0438\u043d\u0430, \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0449\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438\u0433\u0440\u043e\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u0446\u0435\u043b\u044c, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u0432 \u0432\u044b\u0431\u043e\u0440 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430. \u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u044d\u0442\u0430 \u0442\u0435\u043c\u0430 \u0443\u0436\u0435 <a href=\"https:\/\/habr.com\/post\/163681\/\">\u043e\u0441\u0432\u0435\u0449\u0430\u043b\u0430\u0441\u044c<\/a>, \u043d\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u0430\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0430 Kotlin.<a name=\"habracut\"><\/a> <br \/>  \u0422\u0430\u043a \u0432\u043e\u0442, \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u2013 \u044d\u0442\u043e \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0445 \u0432\u044b\u0431\u043e\u0440 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043b\u0438\u0447\u043d\u043e\u043c \u0445\u043e\u0434\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u043b\u043e\u0436\u0438\u0432\u0448\u0435\u0439\u0441\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438. \u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0438\u0433\u0440\u043e\u043a\u0430 \u2013 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0430\u044f \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0438\u0433\u0440\u0435, \u0442.\u0435. \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0438\u0433\u0440\u044b\u0448. \u0415\u0441\u043b\u0438 \u0438\u0433\u0440\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442, \u043a\u0440\u043e\u043c\u0435 \u043b\u0438\u0447\u043d\u044b\u0445, \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0445\u043e\u0434\u044b, \u0442\u043e \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0432\u044b\u0438\u0433\u0440\u044b\u0448.<br \/>  \u0417\u0430\u0434\u0430\u0447\u0430 \u0442\u0435\u043e\u0440\u0438\u0438 \u0438\u0433\u0440 \u2013 \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u0438\u0433\u0440\u043e\u043a\u043e\u0432. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a (\u0438\u043b\u0438 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0438) \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0440\u0430\u0437\u0443\u043c\u0435\u043d, \u0447\u0435\u043c \u0441\u0430\u043c \u0438\u0433\u0440\u043e\u043a, \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0435\u0439 \u0446\u0435\u043b\u0438. \u0420\u0430\u0441\u0447\u0435\u0442 \u043d\u0430 \u0440\u0430\u0437\u0443\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430 \u2013 \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u0430 \u0438\u0437 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u0432 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0435, \u043d\u043e \u0432 \u0442\u0435\u043e\u0440\u0438\u0438 \u0438\u0433\u0440 \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0430 \u043a\u043b\u0430\u0434\u0435\u0442\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u0443.<br \/>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438\u0433\u0440\u044b \u0441 \u043f\u0440\u0438\u0440\u043e\u0434\u043e\u0439 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a, \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0441\u0432\u043e\u044e \u043f\u0440\u0438\u0431\u044b\u043b\u044c. \u0418\u0433\u0440\u044b \u0441 \u043f\u0440\u0438\u0440\u043e\u0434\u043e\u0439 \u2013 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u0431\u043e\u0440 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0431 \u043e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0441\u043f\u0440\u043e\u0441, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u0438\u0440\u043e\u0434\u044b \u0438 \u0442.\u0434. \u00ab\u041f\u0440\u0438\u0440\u043e\u0434\u0430\u00bb \u2013 \u044d\u0442\u043e \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u043d\u044f\u0442\u0438\u0435 \u043d\u0435 \u043f\u0440\u0435\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432.<br \/>  \u0420\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442 \u0434\u0432\u0430 \u0432\u0438\u0434\u0430 \u0437\u0430\u0434\u0430\u0447 \u0432 \u0438\u0433\u0440\u0430\u0445 \u0441 \u043f\u0440\u0438\u0440\u043e\u0434\u043e\u0439:  <\/p>\n<ol>\n<li>\u0437\u0430\u0434\u0430\u0447\u0430 \u043e \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0440\u0438\u0441\u043a\u0430, \u043a\u043e\u0433\u0434\u0430 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043f\u0440\u0438\u0440\u043e\u0434\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439;<\/li>\n<li>\u0437\u0430\u0434\u0430\u0447\u0438 \u043e \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044f\u0445 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043f\u0440\u0438\u0440\u043e\u0434\u044b.<\/li>\n<\/ol>\n<p>  \u041a\u0440\u0430\u0442\u043a\u043e \u043e\u0431 \u044d\u0442\u0438\u0445 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u0445 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043d\u043e <a href=\"https:\/\/habr.com\/post\/179811\/\">\u0437\u0434\u0435\u0441\u044c<\/a>.<br \/>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0432 \u0447\u0438\u0441\u0442\u044b\u0445 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f\u0445, \u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0440\u0435\u0448\u0438\u043c \u0438\u0433\u0440\u0443 \u0432 \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f\u0445 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0433\u043e\u0432\u043e\u0440\u043e\u0447\u043a\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u042f \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0441\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u043c \u0432 \u0442\u0435\u043e\u0440\u0438\u0438 \u0438\u0433\u0440, \u0430 \u0432 \u044d\u0442\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b Kotlin \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437. \u041e\u0434\u043d\u0430\u043a\u043e \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0438\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u0430\u0442\u044c \u0441\u043e\u0432\u0435\u0442, \u043f\u0440\u043e\u0448\u0443 \u0432 \u043b\u0438\u0447\u043a\u0443.  <\/div>\n<\/div>\n<p>  <\/p>\n<h4>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h4>\n<p>  \u0412\u0441\u0435 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043d\u0430 \u0441\u043a\u0432\u043e\u0437\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435. \u0417\u0430\u0434\u0430\u0447\u0430 \u0442\u0430\u043a\u043e\u0432\u0430: \u0444\u0435\u0440\u043c\u0435\u0440\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0432 \u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u044f\u0445 \u0437\u0430\u0441\u0435\u044f\u0442\u044c \u0441\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u0442\u0440\u0435\u043c\u044f \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0430\u043c\u0438, \u0435\u0441\u043b\u0438 \u0443\u0440\u043e\u0436\u0430\u0439\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u0438\u0445 \u043a\u0443\u043b\u044c\u0442\u0443\u0440, \u0430, \u0437\u043d\u0430\u0447\u0438\u0442, \u0438 \u043f\u0440\u0438\u0431\u044b\u043b\u044c, \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u0438\u043c \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0442\u043e: \u043f\u0440\u043e\u0445\u043b\u0430\u0434\u043d\u044b\u043c \u0438 \u0434\u043e\u0436\u0434\u043b\u0438\u0432\u044b\u043c, \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c, \u0438\u043b\u0438 \u0436\u0430\u0440\u043a\u0438\u043c \u0438 \u0441\u0443\u0445\u0438\u043c. \u0424\u0435\u0440\u043c\u0435\u0440 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u043b \u0447\u0438\u0441\u0442\u0443\u044e \u043f\u0440\u0438\u0431\u044b\u043b\u044c \u0441 1 \u0433\u0435\u043a\u0442\u0430\u0440\u0430 \u043e\u0442 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u0443\u043b\u044c\u0442\u0443\u0440 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043e\u0433\u043e\u0434\u044b. \u0418\u0433\u0440\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435\u0439:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/f1\/pq\/ga\/f1pqga_ueocs6kznk-lewivt20w.png\"><br \/>  \u0414\u0430\u043b\u0435\u0435 \u044d\u0442\u0443 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/84d\/00a\/a43\/84d00aa431e6ec805742a8eb8b5c980e.svg\" alt=\"$U_{1} = (0,2,5), U_{2} = (2,3,1), U_{3} = (4,3,-1)$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0418\u0441\u043a\u043e\u043c\u0443\u044e \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5ea\/c0c\/a94\/5eac0ca945dcadac2263090250f4a4c3.svg\" alt=\"$u_{opt} $\" data-tex=\"inline\"><\/math>. \u0420\u0435\u0448\u0430\u0442\u044c \u0438\u0433\u0440\u0443 \u0431\u0443\u0434\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432 \u0412\u0430\u043b\u044c\u0434\u0430, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u043c\u0430, \u043f\u0435\u0441\u0441\u0438\u043c\u0438\u0437\u043c\u0430, \u0421\u044d\u0432\u0438\u0434\u0436\u0430 \u0438 \u0413\u0443\u0440\u0432\u0438\u0446\u0430 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432 \u0411\u0430\u0439\u0435\u0441\u0430 \u0438 \u041b\u0430\u043f\u043b\u0430\u0441\u0430 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0440\u0438\u0441\u043a\u0430.<br \/>  \u041a\u0430\u043a \u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u043e\u0441\u044c \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u043d\u0430 Kotlin. \u0417\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435-\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u0430\u043a Gambit (\u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u0421), Axelrod \u0438 PyNFG (\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 Python), \u043d\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0435\u0445\u0430\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0435, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435, \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0434\u0438 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u044b\u043a\u0430\u0442\u044c \u0441\u0442\u0438\u043b\u044c\u043d\u044b\u0439, \u043c\u043e\u0434\u043d\u044b\u0439 \u0438 \u043c\u043e\u043b\u043e\u0434\u0435\u0436\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. <br \/>  \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0433\u0440\u044b \u0437\u0430\u0432\u0435\u0434\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u043b\u0438 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b. \u041a\u043b\u0430\u0441\u0441 \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432 \u0438\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043f\u0440\u0438\u0440\u043e\u0434\u044b) \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0438\u043c \u0438\u043c\u0435\u043d\u0438. \u041f\u043e\u043b\u0435 <code>key<\/code> \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438, \u0430 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u0442\u0440\u043e\u043a\u0430 \u0438\u043b\u0438 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>import java.text.DecimalFormat import java.text.NumberFormat  open class GameVector(name: String, values: List&lt;Double&gt;, key: Int = -1) : Comparable&lt;GameVector&gt; {      val name: String     val values: List&lt;Double&gt;     val key: Int      private val formatter:NumberFormat = DecimalFormat(\"#0.00\")      init {         this.name = name;         this.values = values;         this.key = key;     }      public fun max(): Double? {         return values.max();     }      public fun min(): Double? {         return values.min();     }      override fun toString(): String{         return name + \": \" + values                 .map { v -&gt; formatter.format(v) }                 .reduce( {f1: String, f2: String -&gt; \"$f1   $f2\"})     }      override fun compareTo(other: GameVector): Int {         var compare = 0         if (this.key == other.key){             return compare         }         var great = true         for (i in 0..this.values.lastIndex){             great = great &amp;&amp; this.values[i] &gt;= other.values[i]         }         if (great){             compare = 1         }else{             var less = true             for (i in 0..this.values.lastIndex){                 less = less &amp;&amp; this.values[i] &lt;= other.values[i]             }             if (less){                 compare = -1             }         }         return compare     } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0418\u0433\u0440\u043e\u0432\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430\u0445 \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u0445 \u043f\u0440\u0438\u0440\u043e\u0434\u044b. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u0432 \u043d\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0438 \u0447\u0438\u0441\u0442\u043e\u0439 \u0446\u0435\u043d\u044b \u0438\u0433\u0440\u044b.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0433\u0440\u043e\u0432\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>open class GameMatrix(matrix: List&lt;List&lt;Double&gt;&gt;, alternativeNames: List&lt;String&gt;, natureStateNames: List&lt;String&gt;) {     val matrix: List&lt;List&lt;Double&gt;&gt;     val alternativeNames: List&lt;String&gt;     val natureStateNames: List&lt;String&gt;      val alternatives: List&lt;GameVector&gt;     val natureStates: List&lt;GameVector&gt;      init {         this.matrix = matrix;         this.alternativeNames = alternativeNames         this.natureStateNames = natureStateNames          var alts: MutableList&lt;GameVector&gt; = mutableListOf()         for (i in 0..matrix.lastIndex) {             val currAlternative = alternativeNames[i]             val gameVector = GameVector(currAlternative, matrix[i], i)             alts.add(gameVector)         }         alternatives = alts.toList()          var nss: MutableList&lt;GameVector&gt; = mutableListOf()         val lastIndex = matrix[0].lastIndex \/\/ \u043d\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0432\u0440\u043a\u0438 \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u0434\u043b\u0438\u043d \u0432\u0441\u0435\u0445 \u0441\u0442\u0440\u043e\u043a, \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0447\u0442\u043e \u043e\u043d\u0438 \u0440\u0430\u0432\u043d\u044b         for (j in 0..lastIndex) {             val currState = natureStateNames[j]             var states: MutableList&lt;Double&gt; = mutableListOf()             for (i in 0..matrix.lastIndex) {                 states.add(matrix[i][j])             }             val gameVector = GameVector(currState, states.toList(), j)             nss.add(gameVector)         }         natureStates = nss.toList()     }      open fun change (i : Int, j : Int, value : Double) : GameMatrix{         var mml = this.matrix.toMutableList()          var rowi = mml[i].toMutableList()         rowi.set(j, value)          mml.set(i, rowi)          return GameMatrix(mml.toList(), alternativeNames, natureStateNames)     }      open fun changeAlternativeName (i : Int, value : String) : GameMatrix{         var list = alternativeNames.toMutableList()         list.set(i, value)          return GameMatrix(matrix, list.toList(), natureStateNames)     }      open fun changeNatureStateName (j : Int, value : String) : GameMatrix{         var list = natureStateNames.toMutableList()         list.set(j, value)          return GameMatrix(matrix, alternativeNames, list.toList())     }      fun size() : Pair&lt;Int, Int&gt;{         return Pair(alternatives.size, natureStates.size)     }      override fun toString(): String {         return \"\u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u0440\u0438\u0440\u043e\u0434\u044b:\\n\" +             natureStateNames.reduce { n1: String, n2: String -&gt; \"$n1;\\n$n2\" } +             \"\\n\u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u0438\u0433\u0440\u044b:\\n\" +             alternatives                 .map { a: GameVector -&gt; a.toString() }                 .reduce { a1: String, a2: String -&gt; \"$a1;\\n$a2\" }     }      protected fun dominateSet(gvl: List&lt;GameVector&gt;, list: MutableList&lt;String&gt;, dvv: Int) : MutableSet&lt;GameVector&gt;{         var dSet: MutableSet&lt;GameVector&gt; = mutableSetOf()         for (gv in gvl){             for (gvv in gvl){                 if (!dSet.contains(gv) &amp;&amp; !dSet.contains(gvv)) {                     if (gv.compareTo(gvv) == dvv) {                         dSet.add(gv)                         list.add(\"[$gvv] \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u0443\u0435\u0442 [$gv]\")                     }                 }             }         }         return dSet     }      open fun newMatrix(dCol: MutableSet&lt;GameVector&gt;, dRow: MutableSet&lt;GameVector&gt;)                             : GameMatrix{         var result: MutableList&lt;MutableList&lt;Double&gt;&gt; = mutableListOf()         var ralternativeNames: MutableList&lt;String&gt; = mutableListOf()         var rnatureStateNames: MutableList&lt;String&gt; = mutableListOf()          val dIndex =  dCol.map { c -&gt; c.key }.toList()          for (i in 0 .. natureStateNames.lastIndex){             if (!dIndex.contains(i)){                 rnatureStateNames.add(natureStateNames[i])             }         }          for (gv in this.alternatives){             if (!dRow.contains(gv)){                 var nr: MutableList&lt;Double&gt; = mutableListOf()                 for (i in 0 .. gv.values.lastIndex){                     if (!dIndex.contains(i)){                         nr.add(gv.values[i])                     }                 }                 result.add(nr)                 ralternativeNames.add(gv.name)             }         }          val rlist = result.map { r -&gt; r.toList() }.toList()         return GameMatrix(rlist, ralternativeNames.toList(), rnatureStateNames.toList())     }      fun dominateMatrix(): Pair&lt;GameMatrix, List&lt;String&gt;&gt;{         var list: MutableList&lt;String&gt; = mutableListOf()          var dCol: MutableSet&lt;GameVector&gt; = dominateSet(this.natureStates, list, 1)         var dRow: MutableSet&lt;GameVector&gt; = dominateSet(this.alternatives, list, -1)          val newMatrix = newMatrix(dCol, dRow)          var ddgm = Pair(newMatrix, list.toList())          val ret = iterate(ddgm, list)         return ret;     }      protected fun iterate(ddgm: Pair&lt;GameMatrix, List&lt;String&gt;&gt;, list: MutableList&lt;String&gt;)             : Pair&lt;GameMatrix, List&lt;String&gt;&gt;{         var dgm = this         var lddgm = ddgm          while (dgm.size() != lddgm.first.size()){             dgm = lddgm.first             list.addAll(lddgm.second)             lddgm = dgm.dominateMatrix()         }          return Pair(dgm,list.toList().distinct())     }       fun minClearPrice(): Double{         val map: List&lt;Double&gt; = this.alternatives.map { a -&gt; a?.min() ?: 0.0 }         return map?.max() ?: 0.0     }      fun maxClearPrice(): Double{         val map: List&lt;Double&gt; = this.natureStates.map { a -&gt; a?.max() ?: 0.0 }         return map?.min() ?: 0.0     }      fun existsClearStrategy() : Boolean{         return minClearPrice() &gt;= maxClearPrice()     } }<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041e\u043f\u0438\u0448\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>interface ICriteria {     fun optimum(): List&lt;GameVector&gt; } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h3>\u041f\u0440\u0438\u043d\u044f\u0442\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>  \u041f\u0440\u0438\u043d\u044f\u0442\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442, \u0447\u0442\u043e \u0438\u0433\u0440\u043e\u043a\u0443 \u043d\u0435 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a.<\/p>\n<h4>\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0412\u0430\u043b\u044c\u0434\u0430<\/h4>\n<p>  \u0412 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438 \u0412\u0430\u043b\u044c\u0434\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0438\u0445\u0443\u0434\u0448\u0438\u0439 \u0438\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/056\/9ec\/d68\/0569ecd68e96fba4cbe838a90553041c.svg\" alt=\"$u_{opt} = max_{i} min_{j} [U]$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0441\u0442\u0440\u0430\u0445\u0443\u0435\u0442 \u043e\u0442 \u043d\u0430\u0438\u0445\u0443\u0434\u0448\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u043d\u043e \u0446\u0435\u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u2013 \u043f\u043e\u0442\u0435\u0440\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u0439 \u0438\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432. <br \/>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440. \u0414\u043b\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/84d\/00a\/a43\/84d00aa431e6ec805742a8eb8b5c980e.svg\" alt=\"$U_{1} = (0,2,5), U_{2} = (2,3,1), U_{3} = (4,3,-1) $\" data-tex=\"inline\"><\/math> \u043d\u0430\u0439\u0434\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u044b \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0442\u0440\u043e\u0439\u043a\u0443 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/921\/514\/4a7\/9215144a73533f4159e6d8996f1750cb.svg\" alt=\"$S = (0, 1, -1) $\" data-tex=\"inline\"><\/math>. \u041c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u043e\u043c \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 1, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e \u0412\u0430\u043b\u044c\u0434\u0430 \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4d3\/cec\/8cf\/4d3cec8cf56b6d7f1c3c530c012d15d0.svg\" alt=\"$U_{2} = (2,3,1)$\" data-tex=\"inline\"><\/math>, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u043f\u043e\u0441\u0430\u0434\u043a\u0435 \u041a\u0443\u043b\u044c\u0442\u0443\u0440\u044b 2.<br \/>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0412\u0430\u043b\u044c\u0434\u0430 \u043d\u0435\u0437\u0430\u0442\u0435\u0439\u043b\u0438\u0432\u0430:  <\/p>\n<pre><code>class WaldCriteria(gameMatrix : GameMatrix) : ICriteria {      val gameMatrix: GameMatrix      init{         this.gameMatrix = gameMatrix     }      override fun optimum(): List&lt;GameVector&gt; {         val mins = gameMatrix.alternatives.map { a -&gt; Pair(a, a.min()) }         val max =  mins.maxWith( Comparator { o1, o2 -&gt;  o1.second!!.compareTo(o2.second!!)})         return mins                 .filter { m -&gt; m.second == max!!.second }                 .map { m -&gt; m.first }     } } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u0431\u044b \u0432 \u0432\u0438\u0434\u0435 \u0442\u0435\u0441\u0442\u0430:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0422\u0435\u0441\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>private fun matrix(): GameMatrix {         val alternativeNames: List&lt;String&gt; = listOf(\"\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430 1\", \"\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430 2\", \"\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430 3\")         val natureStateNames: List&lt;String&gt; = listOf(\"\u041f\u0440\u043e\u0445\u043b\u0430\u0434\u043d\u043e\u0435 \u0438 \u0434\u043e\u0436\u0434\u043b\u0438\u0432\u043e\u0435\", \"\u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435\", \"\u0416\u0430\u0440\u043a\u043e\u0435 \u0438 \u0441\u0443\u0445\u043e\u0435\")         val matrix: List&lt;List&lt;Double&gt;&gt; = listOf(                 listOf(0.0, 2.0, 5.0),                 listOf(2.0, 3.0, 1.0),                 listOf(4.0, 3.0, -1.0)         )         val gm = GameMatrix(matrix, alternativeNames, natureStateNames)         return gm;     } } private fun testCriteria(gameMatrix: GameMatrix, criteria: ICriteria, name: String){         println(gameMatrix.toString())         val optimum = criteria.optimum()         println(\"$name. \u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f: \")         optimum.forEach { o -&gt; println(o.toString()) }     } @Test     fun testWaldCriteria() {         val matrix = matrix();         val criteria = WaldCriteria(matrix)         testCriteria(matrix, criteria, \"\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0412\u0430\u043b\u044c\u0434\u0430\")     } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041d\u0435\u0442\u0440\u0443\u0434\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>criteria<\/code>.<\/p>\n<h4>\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u043c\u0430<\/h4>\n<p>  \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0430 \u0438\u0433\u0440\u043e\u043a \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0434\u0430\u044e\u0449\u0435\u0435 \u043b\u0443\u0447\u0448\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442, \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438\u0433\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0431\u043b\u0430\u0433\u043e\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c\u0438:   <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/72e\/03d\/eb9\/72e03deb976f27ccec1a6154b384a99a.svg\" alt=\"$u_{opt} = max_{i} max_{j} [U]$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u043c, \u043a\u043e\u0433\u0434\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u043f\u0440\u043e\u0441\u043e\u043c \u2013 \u0444\u0438\u0440\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443\u0431\u044b\u0442\u043a\u0438 \u043f\u0440\u0438 \u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043d\u0435\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u0438. \u0412 \u0442\u043e\u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0430 \u0438\u043c\u0435\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0441\u043c\u044b\u0441\u043b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u043e \u043d\u0435\u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0451\u043d\u043d\u044b\u0445 \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044f\u0445, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043b\u044e\u0431\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 \u0441\u043f\u0440\u043e\u0441 \u0432\u0441\u0435\u0433\u0434\u0430 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u0442 \u043d\u0443\u0436\u0434\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u0435\u0439. \u0415\u0441\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0440\u043e\u0441, \u0442\u043e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u044c \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f, \u043a\u0430\u043a \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0443\u0442 \u043a \u043d\u0435\u0434\u043e\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u0438\u0431\u044b\u043b\u0438. \u042d\u0442\u043e \u0434\u0430\u0451\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430.<br \/>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440. \u0414\u043b\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/84d\/00a\/a43\/84d00aa431e6ec805742a8eb8b5c980e.svg\" alt=\"$U_{1} = (0,2,5), U_{2} = (2,3,1), U_{3} = (4,3,-1) $\" data-tex=\"inline\"><\/math> \u043d\u0430\u0439\u0434\u0435\u043c \u043d\u0430\u0439\u0434\u0435\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0442\u0440\u043e\u0439\u043a\u0443 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b07\/f16\/228\/b07f162288b83caa39b38a224752dcdf.svg\" alt=\"$S = (5, 3, 4)$\" data-tex=\"inline\"><\/math>. \u041c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u043e\u043c \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 5, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u043c\u0430 \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/161\/075\/359\/161075359391ccd3746b148996bd2c86.svg\" alt=\"$U_{1} = (0,2,5)$\" data-tex=\"inline\"><\/math>, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u043f\u043e\u0441\u0430\u0434\u043a\u0435 \u041a\u0443\u043b\u044c\u0442\u0443\u0440\u044b 1.<br \/>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u043c\u0430 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0412\u0430\u043b\u044c\u0434\u0430:  <\/p>\n<pre><code>class WaldCriteria(gameMatrix : GameMatrix) : ICriteria {      val gameMatrix: GameMatrix      init{         this.gameMatrix = gameMatrix     }      override fun optimum(): List&lt;GameVector&gt; {         val mins = gameMatrix.alternatives.map { a -&gt; Pair(a, a.min()) }         val max =  mins.maxWith( Comparator { o1, o2 -&gt;  o1.second!!.compareTo(o2.second!!)})         return mins                 .filter { m -&gt; m.second == max!!.second }                 .map { m -&gt; m.first }     } } <\/code><\/pre>\n<h4>\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u043f\u0435\u0441\u0441\u0438\u043c\u0438\u0437\u043c\u0430<\/h4>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0438\u0437 \u0435\u0435 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4e0\/12f\/384\/4e012f3848e121cdb3a87c181afccbb5.svg\" alt=\"$u_{opt} = min_{i} min_{j} [U]$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u043f\u0435\u0441\u0441\u0438\u043c\u0438\u0437\u043c\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442, \u0447\u0442\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0431\u043b\u0430\u0433\u043e\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c \u0434\u043b\u044f \u043b\u0438\u0446\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u043b\u0438\u0446\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0443\u044e \u043f\u043e\u0442\u0435\u0440\u044e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043d\u0430\u0434 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0441\u0442\u0430\u0440\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0438\u0441\u043a\u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u0445\u043e\u0434\u043d\u043e\u0441\u0442\u044c\u044e.<br \/>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440. \u0414\u043b\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/84d\/00a\/a43\/84d00aa431e6ec805742a8eb8b5c980e.svg\" alt=\"$U_{1} = (0,2,5), U_{2} = (2,3,1), U_{3} = (4,3,-1) $\" data-tex=\"inline\"><\/math> \u043d\u0430\u0439\u0434\u0435\u043c \u043d\u0430\u0439\u0434\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0442\u0440\u043e\u0439\u043a\u0443 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/921\/514\/4a7\/9215144a73533f4159e6d8996f1750cb.svg\" alt=\"$S = (0, 1, -1)$\" data-tex=\"inline\"><\/math>. \u041c\u0438\u043d\u0438\u043c\u0443\u043c\u043e\u043c \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 -1, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e \u043f\u0435\u0441\u0441\u0438\u043c\u0438\u0437\u043c\u0430 \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/eb8\/779\/dd3\/eb8779dd32832e607580895ff51250d2.svg\" alt=\"$U_{3} = (4,3,-1) $\" data-tex=\"inline\"><\/math>, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u043f\u043e\u0441\u0430\u0434\u043a\u0435 \u041a\u0443\u043b\u044c\u0442\u0443\u0440\u044b 3.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0430 \u0441 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c\u0438 \u0412\u0430\u043b\u044c\u0434\u0430 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u043c\u0430 \u0442\u043e, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u043f\u0435\u0441\u0441\u0438\u043c\u0438\u0437\u043c\u0430, \u0434\u0443\u043c\u0430\u044e, \u043b\u0435\u0433\u043a\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f:  <\/p>\n<pre><code>class PessimismCriteria(gameMatrix : GameMatrix) : ICriteria {      val gameMatrix: GameMatrix      init{         this.gameMatrix = gameMatrix     }      override fun optimum(): List&lt;GameVector&gt; {         val mins = gameMatrix.alternatives.map { a -&gt; Pair(a, a.min()) }         val min =  mins.minWith( Comparator { o1, o2 -&gt;  o1.second!!.compareTo(o2.second!!)})         return mins                 .filter { m -&gt; m.second == min!!.second }                 .map { m -&gt; m.first }     } } <\/code><\/pre>\n<h4>\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0421\u044d\u0432\u0438\u0434\u0436\u0430<\/h4>\n<p>  \u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0421\u044d\u0432\u0438\u0434\u0436\u0430 (\u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0441\u043e\u0436\u0430\u043b\u0435\u044e\u0449\u0435\u0433\u043e \u043f\u0435\u0441\u0441\u0438\u043c\u0438\u0441\u0442\u0430) \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u043d\u043e\u0439 \u043f\u0440\u0438\u0431\u044b\u043b\u0438, \u0438\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u043d\u043e\u0439 \u043f\u0440\u0438\u0431\u044b\u043b\u0438:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0da\/e8b\/7ad\/0dae8b7adbc50d7690888f3ace1aaf24.svg\" alt=\"$u_{opt} = min_{i} max_{j}[S]\\\\ s_{i,j} = (max \\begin{bmatrix} u_{1,j} \\\\ u_{2,j}\\\\ ...\\\\u_{n,j} \\end{bmatrix} - u_{i,j})$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 S \u2014 \u044d\u0442\u043e \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u0439.<br \/>  \u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e \u0421\u044d\u0432\u0438\u0434\u0436\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u0435 \u0438\u0437 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u0439. \u0420\u0435\u0448\u0435\u043d\u0438\u0435, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u0438, \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c.<br \/>  \u041a \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u0430\u043c\u044b\u0445 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d\u0438\u0439 \u0438 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u0435\u0439 \u0434\u0440\u0443\u0433\u0438\u0445 \u0438\u0433\u0440\u043e\u043a\u043e\u0432.<br \/>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440. \u0414\u043b\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/84d\/00a\/a43\/84d00aa431e6ec805742a8eb8b5c980e.svg\" alt=\"$U_{1} = (0,2,5), U_{2} = (2,3,1), U_{3} = (4,3,-1) $\" data-tex=\"inline\"><\/math> \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u0439<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/-4\/y2\/54\/-4y2543cih7agigsq4u-icgxu5i.png\"><br \/>  \u0422\u0440\u043e\u0439\u043a\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u0439 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/637\/60a\/560\/63760a560d97b6d894980f71c894a091.svg\" alt=\"$S = (4,4,6)$\" data-tex=\"inline\"><\/math>. \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0438\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0440\u0438\u0441\u043a\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 4, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f\u043c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f08\/309\/37f\/f0830937f821f09e060654d15dffa050.svg\" alt=\"$U_{1}$\" data-tex=\"inline\"><\/math> \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9b8\/c2c\/0fb\/9b8c2c0fb957f64115e1fbf4f569e4ed.svg\" alt=\"$U_{2}$\" data-tex=\"inline\"><\/math>.<br \/>  \u0417\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0421\u044d\u0432\u0438\u0434\u0436\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435:  <\/p>\n<pre><code>class SavageCriteria(gameMatrix: GameMatrix) : ICriteria {      val gameMatrix: GameMatrix      init {         this.gameMatrix = gameMatrix     }      fun GameMatrix.risk(): List&lt;Pair&lt;GameVector, Double?&gt;&gt; {         val maxStates = this.natureStates.map { n -&gt; Pair(n, n.values.max()) }                 .map { n -&gt; n.first.key to n.second }.toMap()          var am: MutableList&lt;Pair&lt;GameVector, List&lt;Double&gt;&gt;&gt; = mutableListOf()         for (a in this.alternatives) {             var v: MutableList&lt;Double&gt; = mutableListOf()             for (i in 0..a.values.lastIndex) {                 val mn = maxStates.get(i)                 v.add(mn!! - a.values[i])             }             am.add(Pair(a, v.toList()))         }         return am.map { m -&gt; Pair(m.first, m.second.max()) }     }      override fun optimum(): List&lt;GameVector&gt; {         val risk = gameMatrix.risk()         val minRisk = risk.minWith(Comparator { o1, o2 -&gt; o1.second!!.compareTo(o2.second!!) })         return risk                 .filter { r -&gt; r.second == minRisk!!.second }                 .map { m -&gt; m.first }     } } <\/code><\/pre>\n<h4>\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0413\u0443\u0440\u0432\u0438\u0446\u0430<\/h4>\n<p>  \u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0413\u0443\u0440\u0432\u0438\u0446\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u043e\u043c \u043c\u0435\u0436\u0434\u0443 \u043a\u0440\u0430\u0439\u043d\u0438\u043c \u043f\u0435\u0441\u0441\u0438\u043c\u0438\u0437\u043c\u043e\u043c \u0438 \u043f\u043e\u043b\u043d\u044b\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u043c\u043e\u043c:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/09f\/257\/a1c\/09f257a1ce10c8557ce3633f4c7a2266.svg\" alt=\"$u_{opt} = max(\\gamma\u00d7A(k) + A(0)\u00d7(1 - \\gamma))$\" data-tex=\"display\"><\/math><\/p>\n<p>  A(0) \u2014 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u043a\u0440\u0430\u0439\u043d\u0435\u0433\u043e \u043f\u0435\u0441\u0441\u0438\u043c\u0438\u0441\u0442\u0430, A(k) \u2014 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0430, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/439\/0c4\/11d\/4390c411d372f3b7b78efdd6f8fa2a6c.svg\" alt=\"$\\gamma=1$\" data-tex=\"inline\"><\/math> \u2014 \u0437\u0430\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0435\u0441\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430: <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f74\/5e3\/a28\/f745e3a281680d4d5d9e7b28aa26c0ad.svg\" alt=\"$0\\leq\\gamma\\leq1$\" data-tex=\"inline\"><\/math>; <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/473\/139\/d89\/473139d89023f7d9e5906942e1fde5d3.svg\" alt=\"$\\gamma = 0$\" data-tex=\"inline\"><\/math> \u2014 \u043a\u0440\u0430\u0439\u043d\u0438\u0439 \u043f\u0435\u0441\u0441\u0438\u043c\u0438\u0437\u043c, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/439\/0c4\/11d\/4390c411d372f3b7b78efdd6f8fa2a6c.svg\" alt=\"$\\gamma=1$\" data-tex=\"inline\"><\/math> \u2014 \u043f\u043e\u043b\u043d\u044b\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u043c.<br \/>  \u041f\u0440\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439, \u0437\u0430\u0434\u0430\u0432\u0430\u044f \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0435\u0441\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/fbc\/f2a\/da4\/fbcf2ada4d2c9c0d4c2e64f59ffe82c0.svg\" alt=\"$\\gamma$\" data-tex=\"inline\"><\/math>, \u0430 \u0437\u0430\u0442\u0435\u043c \u043e\u043a\u0440\u0443\u0433\u043b\u044f\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043e \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0439 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u0438\u0437\u0430\u0446\u0438\u0438.<br \/>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440. \u0414\u043b\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/84d\/00a\/a43\/84d00aa431e6ec805742a8eb8b5c980e.svg\" alt=\"$U_{1} = (0,2,5), U_{2} = (2,3,1), U_{3} = (4,3,-1)$\" data-tex=\"inline\"><\/math>. \u041f\u0440\u0438\u043c\u0435\u043c, \u0447\u0442\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u043c\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/58a\/d22\/74f\/58ad2274f5b7f910051475cbca4a973f.svg\" alt=\"$\\gamma=0,6$\" data-tex=\"inline\"><\/math>. \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dj\/lk\/gm\/djlkgmm7hfw9-s3ezoojdnr9muo.png\"><br \/>  \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0438\u0437 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0445 H \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 3, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f08\/309\/37f\/f0830937f821f09e060654d15dffa050.svg\" alt=\"$U_{1}$\" data-tex=\"inline\"><\/math>.<br \/>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0413\u0443\u0440\u0432\u0438\u0446\u0430 \u0443\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u044a\u0435\u043c\u043d\u0430\u044f:  <\/p>\n<pre><code>class HurwitzCriteria(gameMatrix: GameMatrix, optimisticKoef: Double) : ICriteria {      val gameMatrix: GameMatrix     val optimisticKoef: Double      init {         this.gameMatrix = gameMatrix         this.optimisticKoef = optimisticKoef     }      inner class HurwitzParam(xmax: Double, xmin: Double, optXmax: Double){         val xmax: Double         val xmin: Double         val optXmax: Double          val value: Double          init{             this.xmax = xmax             this.xmin = xmin             this.optXmax = optXmax             value = xmax * optXmax + xmin * (1 - optXmax)         }      }      fun GameMatrix.getHurwitzParams(): List&lt;Pair&lt;GameVector, HurwitzParam&gt;&gt; {         return this.alternatives.map { a -&gt; Pair(a, HurwitzParam(a.max()!!, a.min()!!, optimisticKoef)) }     }      override fun optimum(): List&lt;GameVector&gt; {         val hpar = gameMatrix.getHurwitzParams()         val maxHurw = hpar.maxWith(Comparator { o1, o2 -&gt; o1.second.value.compareTo(o2.second.value) })         return hpar                 .filter { r -&gt; r.second == maxHurw!!.second }                 .map { m -&gt; m.first }     } } <\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043d\u044f\u0442\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0440\u0438\u0441\u043a\u0430<\/h3>\n<p>  \u041c\u0435\u0442\u043e\u0434\u044b \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0440\u0438\u0441\u043a\u0430 \u043f\u0440\u0438 \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0443\u0441\u043b\u0432\u043e\u0438\u0439:  <\/p>\n<ul>\n<li>\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u0445; <\/li>\n<li>\u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u0445 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439;<\/li>\n<li>\u0437\u043d\u0430\u043d\u0438\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u0438\u0441\u0445\u043e\u0434\u043e\u0432 \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/li>\n<\/ul>\n<p>  \u0415\u0441\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0440\u0438\u0441\u043a\u0430, \u0442\u043e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438. \u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u0438\u043c \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0439 \u043f\u0440\u0438\u0431\u044b\u043b\u0438 \u0438\u043b\u0438 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0445 \u0437\u0430\u0442\u0440\u0430\u0442.<br \/>  \u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0432\u0435\u0434\u0435\u043d \u043b\u0438\u0431\u043e \u043a \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0439 (\u0441\u0440\u0435\u0434\u043d\u0435\u0439) \u043f\u0440\u0438\u0431\u044b\u043b\u0438, \u043b\u0438\u0431\u043e \u043a \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0445 \u0437\u0430\u0442\u0440\u0430\u0442. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0438\u0431\u044b\u043b\u044c (\u0437\u0430\u0442\u0440\u0430\u0442\u044b) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u043e\u0439.<br \/>  \u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0442\u0430\u043a\u043e\u0432\u0430: \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u0433\u0434\u0435 \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432\u043b\u0438\u044f\u044e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u041d\u043e \u0438\u0433\u0440\u043e\u043a \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044f\u0445 \u044d\u0442\u0438\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0433\u043e\u0434\u043d\u0443\u044e \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0441\u0442\u044c \u0441\u0432\u043e\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439.<br \/>  \u0427\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u043c \u0438\u0433\u0440\u043e\u0432\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044f\u043c\u0438:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/g0\/a1\/za\/g0a1zajzoc3qkzawciqop-bnxry.png\"><br \/>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u0447\u0435\u0441\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0438\u0433\u0440\u043e\u0432\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443. \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u043f\u043e \u043f\u0440\u0430\u0432\u0434\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u043d\u0435 \u043e\u0447\u0435\u043d\u044c-\u0442\u043e \u0438\u0437\u044f\u0449\u043d\u043e, \u043d\u0443 \u0434\u0430 \u043b\u0430\u0434\u043d\u043e.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0433\u0440\u043e\u0432\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044f\u043c\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>open class ProbabilityGameMatrix(matrix: List&lt;List&lt;Double&gt;&gt;, alternativeNames: List&lt;String&gt;,                                  natureStateNames: List&lt;String&gt;, probabilities: List&lt;Double&gt;) :         GameMatrix(matrix, alternativeNames, natureStateNames) {     val probabilities: List&lt;Double&gt;      init {         this.probabilities = probabilities;     }      override fun change (i : Int, j : Int, value : Double) : GameMatrix{         val cm = super.change(i, j, value)         return ProbabilityGameMatrix(cm.matrix, cm.alternativeNames, cm.natureStateNames, probabilities)     }      override fun changeAlternativeName (i : Int, value : String) : GameMatrix{         val cm = super.changeAlternativeName(i, value)         return ProbabilityGameMatrix(cm.matrix, cm.alternativeNames, cm.natureStateNames, probabilities)     }      override fun changeNatureStateName (j : Int, value : String) : GameMatrix{         val cm = super.changeNatureStateName(j, value)         return ProbabilityGameMatrix(cm.matrix, cm.alternativeNames, cm.natureStateNames, probabilities)     }      fun changeProbability (j : Int, value : Double) : GameMatrix{         var list = probabilities.toMutableList()         list.set(j, value)          return ProbabilityGameMatrix(matrix, alternativeNames, natureStateNames, list.toList())     }      override fun toString(): String {         var s = \"\"         val formatter: NumberFormat = DecimalFormat(\"#0.00\")         for (i in 0 .. natureStateNames.lastIndex){             s += natureStateNames[i] + \" = \" + formatter.format(probabilities[i]) + \"\\n\"         }         return \"\u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u0440\u0438\u0440\u043e\u0434\u044b:\\n\" +                 s +                 \"\u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u0438\u0433\u0440\u044b:\\n\" +                 alternatives                         .map { a: GameVector -&gt; a.toString() }                         .reduce { a1: String, a2: String -&gt; \"$a1;\\n$a2\" }     }      override fun newMatrix(dCol: MutableSet&lt;GameVector&gt;, dRow: MutableSet&lt;GameVector&gt;)             : GameMatrix{         var result: MutableList&lt;MutableList&lt;Double&gt;&gt; = mutableListOf()         var ralternativeNames: MutableList&lt;String&gt; = mutableListOf()         var rnatureStateNames: MutableList&lt;String&gt; = mutableListOf()         var rprobailities: MutableList&lt;Double&gt; = mutableListOf()          val dIndex =  dCol.map { c -&gt; c.key }.toList()          for (i in 0 .. natureStateNames.lastIndex){             if (!dIndex.contains(i)){                 rnatureStateNames.add(natureStateNames[i])             }         }          for (i in 0 .. probabilities.lastIndex){             if (!dIndex.contains(i)){                 rprobailities.add(probabilities[i])             }         }          for (gv in this.alternatives){             if (!dRow.contains(gv)){                 var nr: MutableList&lt;Double&gt; = mutableListOf()                 for (i in 0 .. gv.values.lastIndex){                     if (!dIndex.contains(i)){                         nr.add(gv.values[i])                     }                 }                 result.add(nr)                 ralternativeNames.add(gv.name)             }         }          val rlist = result.map { r -&gt; r.toList() }.toList()         return ProbabilityGameMatrix(rlist, ralternativeNames.toList(), rnatureStateNames.toList(),                 rprobailities.toList())     }  } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h4>\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0411\u0430\u0439\u0435\u0441\u0430<\/h4>\n<p>  \u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0411\u0430\u0439\u0435\u0441\u0430 (\u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0440\u0438\u0441\u043a\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0446\u0435\u043d\u043a\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/220\/9ba\/110\/2209ba1100209cf642a979e328929b4d.svg\" alt=\"$u_{i}$\" data-tex=\"inline\"><\/math> \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0435\u0439 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b. \u0412 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u044d\u0442\u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e\u043c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0438\u0433\u0440\u043e\u043a\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5ea\/c0c\/a94\/5eac0ca945dcadac2263090250f4a4c3.svg\" alt=\"$u_{opt}$\" data-tex=\"inline\"><\/math> \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u044f:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3ef\/1a3\/c6d\/3ef1a3c6d32a92a210387447556c9881.svg\" alt=\"$u_{opt}= max_{1\\leq i \\leq n }M(u_{i})\\\\ M(u_{i})= max_{1\\leq i \\leq n }\\sum_{j=1}^m u_{i,j}\\cdot y_{j}^0 $\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c \u043d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/220\/9ba\/110\/2209ba1100209cf642a979e328929b4d.svg\" alt=\"$u_{i}$\" data-tex=\"inline\"><\/math> \u043f\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e \u0411\u0430\u0439\u0435\u0441\u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0438\u0441\u043a\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (\u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435) \u0440\u0438\u0441\u043a\u043e\u0432 i-\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u044b <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d07\/cc5\/b26\/d07cc5b26db621faab45e0e0b54ede62.svg\" alt=\"$U$\" data-tex=\"inline\"><\/math>, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445, \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0441 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u0440\u0438\u0440\u043e\u0434\u044b. \u0422\u043e\u0433\u0434\u0430 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0438 \u0447\u0438\u0441\u0442\u044b\u0445 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u043f\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e \u0411\u0430\u0439\u0435\u0441\u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0438\u0441\u043a\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5ea\/c0c\/a94\/5eac0ca945dcadac2263090250f4a4c3.svg\" alt=\"$u_{opt}$\" data-tex=\"inline\"><\/math>, \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0449\u0430\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c\u044e \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u0440\u0435\u0434\u043d\u0438\u043c \u0440\u0438\u0441\u043a\u043e\u043c. \u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0411\u0430\u0439\u0435\u0441\u0430 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u0435\u0439 \u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0438\u0441\u043a\u043e\u0432, \u0442.\u0435. \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5ea\/c0c\/a94\/5eac0ca945dcadac2263090250f4a4c3.svg\" alt=\"$u_{opt}$\" data-tex=\"inline\"><\/math> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e \u0411\u0430\u0439\u0435\u0441\u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u0435\u0439, \u0442\u043e \u043e\u043d\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u043f\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e \u0411\u0430\u0439\u0435\u0441\u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0438\u0441\u043a\u043e\u0432, \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442.<br \/>  \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/108\/973\/202\/1089732024b4dc0cc04eb65493babb90.svg\" alt=\"$M_1=0 \\cdot0,2 +2 \\cdot0,5 +5 \\cdot0,3 = 2,5;\\\\ M_2=2 \\cdot0,2 +3 \\cdot0,5 +1 \\cdot0,3 = 2,2;\\\\ M_4=0 \\cdot0,2 +3 \\cdot0,5 +(-1) \\cdot0,3 = 2,0;$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1d6\/fa0\/e85\/1d6fa0e85974dfff88cf4c6af2a6d770.svg\" alt=\"$M_1$\" data-tex=\"inline\"><\/math>, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f08\/309\/37f\/f0830937f821f09e060654d15dffa050.svg\" alt=\"$U_1$\" data-tex=\"inline\"><\/math>.<br \/>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0411\u0430\u0439\u0435\u0441\u0430:  <\/p>\n<pre><code>class BayesCriteria(gameMatrix: ProbabilityGameMatrix) : ICriteria {      val gameMatrix: ProbabilityGameMatrix      init {         this.gameMatrix = gameMatrix     }      fun ProbabilityGameMatrix.bayesProbability(): List&lt;Pair&lt;GameVector, Double?&gt;&gt; {         var am: MutableList&lt;Pair&lt;GameVector, Double&gt;&gt; = mutableListOf()         for (a in this.alternatives) {             var alprob: Double = 0.0             for (i in 0..a.values.lastIndex) {                 alprob += a.values[i] * this.probabilities[i]             }             am.add(Pair(a, alprob))         }         return am.toList();     }      override fun optimum(): List&lt;GameVector&gt; {         val risk = gameMatrix.bayesProbability()         val maxBayes = risk.maxWith(Comparator { o1, o2 -&gt; o1.second!!.compareTo(o2.second!!) })         return risk                 .filter { r -&gt; r.second == maxBayes!!.second }                 .map { m -&gt; m.first }     } }<\/code><\/pre>\n<h4>\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u041b\u0430\u043f\u043b\u0430\u0441\u0430<\/h4>\n<p>  \u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u041b\u0430\u043f\u043b\u0430\u0441\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u0443\u044e \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0433\u0434\u0430 \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e \u0440\u0430\u0432\u043d\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0443\u0440\u043e\u0432\u043d\u0435\u0439 \u0441\u043f\u0440\u043e\u0441\u0430, \u0447\u0442\u043e \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u0431\u043e\u0440\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438.<br \/>  \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u041b\u0430\u043f\u043b\u0430\u0441\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/44c\/d12\/4f4\/44cd124f40214082b663947b8713c311.svg\" alt=\"$u_{opt} = max[\\overline{U}]\\\\ \\overline{U}= \\begin{bmatrix} \\overline{u}_{1} \\\\ \\overline{u}_{2}\\\\ ...\\\\ \\overline{u}_{n} \\end{bmatrix}, \\overline{u}_{i} = \\frac{1}{n}\\sum_{j=1}^nu_{i,j}$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043f\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e \u041b\u0430\u043f\u043b\u0430\u0441\u0430. \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0441\u0440\u0435\u0434\u043d\u0435\u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/07e\/f4f\/ec9\/07ef4fec9c9c2363464d69bf24410312.svg\" alt=\"$ \\overline{u}_{1} = \\frac{1}{3}\\cdot(0+2+5) = 2,3\\\\ \\overline{u}_{2} = \\frac{1}{3}\\cdot(2+3+1) = 2,0\\\\ \\overline{u}_{3} = \\frac{1}{3}\\cdot(4+3-1) = 2,0 $\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f08\/309\/37f\/f0830937f821f09e060654d15dffa050.svg\" alt=\"$U_1$\" data-tex=\"inline\"><\/math>.<br \/>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u041b\u0430\u043f\u043b\u0430\u0441\u0430:  <\/p>\n<pre><code>class LaplaceCriteria(gameMatrix: GameMatrix) : ICriteria {      val gameMatrix: GameMatrix      init {         this.gameMatrix = gameMatrix     }      fun GameMatrix.arithemicMean(): List&lt;Pair&lt;GameVector, Double&gt;&gt; {         return this.alternatives.map { m -&gt; Pair(m, m.values.average()) }     }      override fun optimum(): List&lt;GameVector&gt; {         val risk = gameMatrix.arithemicMean()         val maxBayes = risk.maxWith(Comparator { o1, o2 -&gt; o1.second.compareTo(o2.second) })         return risk                 .filter { r -&gt; r.second == maxBayes!!.second }                 .map { m -&gt; m.first }     } }<\/code><\/pre>\n<h4>\u0421\u043c\u0435\u0448\u0430\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438. \u0410\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434<\/h4>\n<p>  \u0410\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0435\u0448\u0438\u0442\u044c \u0438\u0433\u0440\u0443 \u0432 \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f\u0445. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438\u0433\u0440\u044b \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043d\u044f\u0442\u0438\u044f.<br \/>  \u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/da6\/38e\/84d\/da638e84dd0321e94d3ce7cdb2401333.svg\" alt=\"$U_{i}$\" data-tex=\"inline\"><\/math> \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/82e\/7af\/f00\/82e7aff006024e5f056957b195dea803.svg\" alt=\"$U_{i-1}$\" data-tex=\"inline\"><\/math>, \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4ce\/00a\/67f\/4ce00a67fe151c3885a11bcc8e468bc9.svg\" alt=\"$u_{1..n} \\in U_{i} \\geq u_{1..n} \\in U_{i-1}$\" data-tex=\"inline\"><\/math>. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0435\u0441\u043b\u0438 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u043b\u0430\u0442\u0451\u0436\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u0443\u0435\u0442 \u0432\u0442\u043e\u0440\u0443\u044e \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u043c\u0438\u043d\u0430\u043d\u0442-\u0441\u0442\u0440\u043e\u043a\u043e\u0439. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0435 \u043f\u043b\u0430\u0442\u0451\u0436\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430, \u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u0443\u0435\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u043c\u0438\u043d\u0430\u043d\u0442-\u0441\u0442\u043e\u043b\u0431\u0446\u043e\u043c.<br \/>  \u041d\u0438\u0436\u043d\u0435\u0439 \u0446\u0435\u043d\u043e\u0439 \u0438\u0433\u0440\u044b \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5d2\/9eb\/eac\/5d29ebeac7d8bf0cd79abb4b3e04c380.svg\" alt=\"$\\alpha = max_i min_j u_{ij}$\" data-tex=\"inline\"><\/math>.<br \/>  \u0412\u0435\u0440\u0445\u043d\u0435\u0439 \u0446\u0435\u043d\u043e\u0439 \u0438\u0433\u0440\u044b \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/db9\/fd3\/b75\/db9fd3b75d50a3f002a039826f404783.svg\" alt=\"$\\beta = min_j max_i u_{ij}$\" data-tex=\"inline\"><\/math>.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438\u0433\u0440\u044b \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c:  <\/p>\n<ol>\n<li>\u0412\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043d\u0438\u0436\u043d\u044e\u044e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/723\/4a5\/2ba\/7234a52ba041cdb09b9328a047048fb2.svg\" alt=\"$\\alpha$\" data-tex=\"inline\"><\/math> \u0438 \u0432\u0435\u0440\u0445\u043d\u044e\u044e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7fd\/b73\/0d9\/7fdb730d916a98c0ad71826e0bc706bf.svg\" alt=\"$\\beta$\" data-tex=\"inline\"><\/math> \u0446\u0435\u043d\u044b \u0438\u0433\u0440\u044b. \u0415\u0441\u043b\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/17d\/6fc\/72f\/17d6fc72f5b6f18e42851c6673052b3a.svg\" alt=\"$\\alpha = \\beta $\" data-tex=\"inline\"><\/math>, \u0442\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u0432 \u0447\u0438\u0441\u0442\u044b\u0445 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f\u0445, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u2014 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u0430\u043b\u044c\u0448\u0435<\/li>\n<li>\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b. \u0418\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u041d\u0430 \u0438\u0445 \u043c\u0435\u0441\u0442\u043e \u0432 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0432\u043d\u044b 0<\/li>\n<li>\u0420\u0435\u0448\u0438\u0442\u044c \u043c\u0430\u0442\u0440\u0438\u0447\u043d\u0443\u044e \u0438\u0433\u0440\u0443 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9B%D0%B8%D0%BD%D0%B5%D0%B9%D0%BD%D0%BE%D0%B5_%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%BC%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5\">\u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/a><\/li>\n<\/ol>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a\u043b\u0430\u0441\u0441, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0440\u0435\u0448\u0435\u043d\u0438\u0435  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Solve<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>class Solve(gamePriceObr: Double, solutions: List&lt;Double&gt;, names: List&lt;String&gt;) {      val gamePrice: Double     val gamePriceObr: Double     val solutions: List&lt;Double&gt;     val names: List&lt;String&gt;      private val formatter: NumberFormat = DecimalFormat(\"#0.00\")      init{         this.gamePrice =  1 \/ gamePriceObr         this.gamePriceObr = gamePriceObr;         this.solutions = solutions         this.names = names     }      override fun toString(): String{         var s =  \"\u0426\u0435\u043d\u0430 \u0438\u0433\u0440\u044b: \" + formatter.format(gamePrice) + \"\\n\"         for (i in 0..solutions.lastIndex){             s += \"$i) \" + names[i] + \" = \" + formatter.format(solutions[i] \/ gamePriceObr) + \"\\n\"         }         return s     }      fun itersect(matrix: GameMatrix): String{         var s =  \"\u0426\u0435\u043d\u0430 \u0438\u0433\u0440\u044b: \" + formatter.format(gamePrice) + \"\\n\"         for (j in 0..matrix.alternativeNames.lastIndex) {             var f = false             val a = matrix.alternativeNames[j]             for (i in 0..solutions.lastIndex) {                 if (a.equals(names[i])) {                     s += \"$j) \" + names[i] + \" = \" + formatter.format(solutions[i] \/ gamePriceObr) + \"\\n\"                     f = true                     break                 }             }             if (!f){                 s += \"$j) \" + a + \"  = 0\\n\"             }         }         return s     } }<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0418 \u043a\u043b\u0430\u0441\u0441, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0438\u043c\u043f\u043b\u0435\u043a\u0441-\u043c\u0435\u0442\u043e\u0434\u043e\u043c. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435 \u044f \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044e\u0441\u044c, \u0442\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0438\u0437 <a href=\"http:\/\/commons.apache.org\/proper\/commons-math\/javadocs\/api-3.3\/org\/apache\/commons\/math3\/optim\/linear\/SimplexSolver.html\">Apache Commons Math<\/a>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Solver<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code> open class Solver (gameMatrix: GameMatrix) {      val gameMatrix: GameMatrix      init{         this.gameMatrix = gameMatrix     }      fun solve(): Solve{         val goalf: List&lt;Double&gt; = gameMatrix.alternatives.map { a -&gt; 1.0 }         val f = LinearObjectiveFunction(goalf.toDoubleArray(), 0.0)          val constraints = ArrayList&lt;LinearConstraint&gt;()         for (alt in gameMatrix.alternatives){             constraints.add(LinearConstraint(alt.values.toDoubleArray(), Relationship.LEQ,  1.0))          }          val solution = SimplexSolver().optimize(f, LinearConstraintSet(constraints), GoalType.MAXIMIZE,                 NonNegativeConstraint(true))          val sl: List&lt;Double&gt; = solution.getPoint().toList()         val solve = Solve(solution.getValue(), sl, gameMatrix.alternativeNames)          return solve     } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c. \u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0434\u0440\u0443\u0433\u0443\u044e \u0438\u0433\u0440\u043e\u0432\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c0f\/8c8\/69b\/c0f8c869b0cc2e06a0c2aa828119c663.svg\" alt=\"$ \\begin{pmatrix} 2&amp; 4&amp; 8&amp; 5 \\\\ 6&amp; 2&amp; 4&amp; 6\\\\ 3&amp; 2&amp; 5&amp; 4 \\end{pmatrix} $\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u0435\u0441\u0442\u044c \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u0443\u044e\u0449\u0435\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e:<br \/>  \\begin{pmatrix} 2&amp; 4\\\\ 6&amp; 2\\end{pmatrix}  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code> val alternativeNames: List&lt;String&gt; = listOf(\"\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430 1\", \"\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430 2\", \"\u041a\u0443\u043b\u044c\u0442\u0443\u0440\u0430 3\") val natureStateNames: List&lt;String&gt; =      listOf(\"\u041f\u0440\u043e\u0445\u043b\u0430\u0434\u043d\u043e\u0435 \u0438 \u0434\u043e\u0436\u0434\u043b\u0438\u0432\u043e\u0435\", \"\u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435\", \"\u0416\u0430\u0440\u043a\u043e\u0435 \u0438 \u0441\u0443\u0445\u043e\u0435\", \"\u0412\u0435\u0442\u0440\u0435\u043d\u043e\u0435\") val matrix: List&lt;List&lt;Double&gt;&gt; = listOf(      listOf(2.0, 4.0, 8.0, 5.0),      listOf(6.0, 2.0, 4.0, 6.0),      listOf(3.0, 2.0, 5.0, 4.0) ) val gm = GameMatrix(matrix, alternativeNames, natureStateNames) val (dgm, list) = gm.dominateMatrix() println(dgm.toString()) println(list.reduce({s1, s2 -&gt; s1 + \"\\n\" + s2})) println() val s: Solver = Solver(dgm) val solve = s.solve() println(solve) <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0433\u0440\u044b <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c34\/cc8\/80b\/c34cc880b36e7e964a8600a5590e2c7c.svg\" alt=\"$(0,33; 0,67; 0)$\" data-tex=\"inline\"><\/math> \u043f\u0440\u0438 \u0446\u0435\u043d\u0435 \u0438\u0433\u0440\u044b \u0440\u0430\u0432\u043d\u043e\u0439 3,33<\/p>\n<h4>\u0412\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/h4>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0442\u0435\u043c, \u043a\u043e\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u0438 \u0441 \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0438\u0433\u0440 \u0441 \u043f\u0440\u0438\u0440\u043e\u0434\u043e\u0439. \u0412\u043c\u0435\u0441\u0442\u043e \u0432\u044b\u0432\u043e\u0434\u043e\u0432 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 GitHub <a href=\"https:\/\/github.com\/altmf\/game_theory\">https:\/\/github.com\/altmf\/game_theory<\/a><br \/>  \u0411\u0443\u0434\u0443 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0435\u043d \u0437\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u0432\u044f\u0437\u044c!<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/425609\/\"> https:\/\/habr.com\/post\/425609\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u0422\u0435\u043e\u0440\u0438\u044f \u0438\u0433\u0440 \u2014 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0434\u0438\u0441\u0446\u0438\u043f\u043b\u0438\u043d\u0430, \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0449\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438\u0433\u0440\u043e\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u0446\u0435\u043b\u044c, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u0432 \u0432\u044b\u0431\u043e\u0440 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430. \u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u044d\u0442\u0430 \u0442\u0435\u043c\u0430 \u0443\u0436\u0435 <a href=\"https:\/\/habr.com\/post\/163681\/\">\u043e\u0441\u0432\u0435\u0449\u0430\u043b\u0430\u0441\u044c<\/a>, \u043d\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u0430\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0430 Kotlin.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-290547","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/290547","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=290547"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/290547\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=290547"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=290547"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=290547"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}