{"id":281060,"date":"2016-11-16T15:40:03","date_gmt":"2016-11-16T12:40:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=281060"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=281060","title":{"rendered":"\u0421\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435 \u043c\u0438\u0440\u0430 \u041e\u043f\u044b\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u0443\u043c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438 \u0441\u0432\u043e\u0438\u043c\u0438 \u0440\u0443\u043a\u0430\u043c\u0438"},"content":{"rendered":"<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0448\u044c \u0434\u0435\u043d\u044c \u0432 \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u0445 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 \u00ab\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432\u00bb \u0438 \u00ab\u0438\u0434\u0438\u043e\u0442\u044b\u00bb \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u0433\u043b\u0430\u0432\u043d\u043e\u043c\u0443 \u0431\u0443\u0445\u0433\u0430\u043b\u0442\u0435\u0440\u0443, \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0437\u0430\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0447\u0442\u0438 \u043d\u0430 \u043d\u0435\u0434\u0435\u043b\u044e \u0438\u0437-\u0437\u0430 \u043e\u0440\u0444\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438, \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0439 \u043a\u0435\u043c-\u0442\u043e \u0432 \u043a\u043e\u0434\u0435 \u0432 2009 \u0433\u043e\u0434\u0443. \u0412 \u0442\u0430\u043a\u0438\u0435 \u0434\u043d\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u043e\u0431\u043e\u0440\u0432\u0430\u0442\u044c \u0440\u0443\u043a\u0438 \u0442\u043e\u043c\u0443 \u0443\u043c\u043d\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0442\u0432\u043e\u0440\u0438\u043b \u044d\u0442\u043e\u0442 \u043c\u0438\u0440, \u0438 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0435 \u0441 \u043d\u043e\u043b\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/8fd\/c07\/73c\/8fdc0773c47140ddb1b93904dcbfdcbc.jpeg\" alt=\"image\"\/><\/p>\n<p>  TL;DR<br \/>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 \u0434\u043b\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f Python \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e \u0441\u0432\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%90%D0%B3%D0%B5%D0%BD%D1%82%D0%BD%D0%BE%D0%B5_%D0%BC%D0%BE%D0%B4%D0%B5%D0%BB%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5\">\u0430\u0433\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/a> \u0441 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0438 \u0431\u043e\u0433\u0430\u043c\u0438.<\/p>\n<p>  <a href=\"https:\/\/github.com\/pavmav\/sandbox-learn\">\u0421\u0441\u044b\u043b\u043a\u0430 <\/a>\u043d\u0430 github. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043d\u0443\u0436\u0435\u043d <a href=\"http:\/\/www.pygame.org\/download.shtml\">pygame<\/a>. \u0414\u043b\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f <a href=\"http:\/\/scikit-learn.org\/stable\/install.html\">sklearn<\/a>.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>\u0417\u0430\u0440\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0438\u0434\u0435\u0438<\/h3>\n<p>  \u0418\u0434\u0435\u044f \u0441\u043e\u043e\u0440\u0443\u0434\u0438\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0431\u0443\u0434\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u043f\u043e\u044f\u0432\u043b\u044f\u043b\u0430\u0441\u044c \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c \u0442\u0435\u043c\u044b \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u043e\u0431\u043e\u0448\u043b\u0430 \u043c\u0435\u043d\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043e\u0439. <a href=\"https:\/\/www.coursera.org\/specializations\/machine-learning\">\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0443\u0440\u0441\u043e\u0432<\/a> \u043d\u0430 \u043a\u0443\u0440\u0441\u0435\u0440\u0435 \u0434\u0430\u043b\u0438 \u043e\u0431\u043c\u0430\u043d\u0447\u0438\u0432\u043e\u0435 \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438. \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u043e\u0432 \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043d\u0430 kaggle \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0441\u0430\u043c\u043e\u043c\u043d\u0435\u043d\u0438\u0435, \u043e\u0434\u043d\u0430\u043a\u043e, \u043d\u0435 \u043e\u0445\u043b\u0430\u0434\u0438\u043b\u0438 \u044d\u043d\u0442\u0443\u0437\u0438\u0430\u0437\u043c.<\/p>\n<p>  \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0431\u0443\u0434\u0443\u0447\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043b\u0435\u043c \u043a\u0430\u0441\u0442\u044b <a href=\"https:\/\/1c.ru\/\">\u043d\u0435\u043f\u0440\u0438\u043a\u0430\u0441\u0430\u0435\u043c\u044b\u0445 <\/a>\u043e\u0442\u0435\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e IT \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430, \u044f \u043d\u0435\u0447\u0430\u0441\u0442\u043e \u0438\u043c\u0435\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0436\u043d\u043e \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u043c\u043d\u043e\u0439 Python. \u0410 \u043e\u0442 \u0443\u043c\u043d\u044b\u0445 \u043b\u044e\u0434\u0435\u0439 \u044f \u0441\u043b\u044b\u0448\u0430\u043b, \u0447\u0442\u043e \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u044d\u0442\u043e\u043c \u043f\u043b\u0430\u043d\u0435 \u2014 \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u0434\u043e.<\/p>\n<p>  \u041d\u043e \u0442\u043e\u043b\u0447\u043a\u043e\u043c \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u043b\u043e \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d\u0438\u0435 No Man\u2019s Sky. \u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0448\u0438\u043a\u0430\u0440\u043d\u0430\u044f \u0438\u0434\u0435\u044f, \u043d\u043e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0438\u0440 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043f\u0443\u0441\u0442\u044b\u043c. \u0418 \u043a\u0430\u043a \u043b\u044e\u0431\u043e\u0439 \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u0432\u0448\u0438\u0439\u0441\u044f \u0431\u043e\u043b\u0435\u043b\u044c\u0449\u0438\u043a, \u044f \u043d\u0430\u0447\u0430\u043b \u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u043b \u044f, \u0435\u0441\u043b\u0438 \u0431\u044b \u043c\u0435\u043d\u044f \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u043b\u0438. \u0418 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u043c\u0438\u0440 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043f\u0443\u0441\u0442\u044b\u043c \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432 \u043d\u0435\u043c \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e \u0440\u0430\u0437\u0443\u043c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438. \u0411\u0435\u0441\u043a\u0440\u0430\u0439\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u044b, \u043f\u0440\u0438\u0432\u044b\u0447\u043a\u0430 \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0441\u0435\u0431\u044f, \u0440\u0430\u0434\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u043e\u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u0435\u043b\u044f \u2014 \u044d\u0442\u043e \u0432\u0441\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0445\u043e\u0440\u043e\u0448\u043e. \u041d\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430 \u0431\u0430\u0437\u0443, \u043f\u043e\u0441\u043b\u043e\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u043e \u0440\u044b\u043d\u043a\u0443, \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0441\u043f\u043b\u0435\u0442\u043d\u0438 \u0432 \u0437\u0430\u0431\u0435\u0433\u0430\u043b\u043e\u0432\u043a\u0435. \u0414\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0441\u044b\u043b\u043a\u0443 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u0430 \u044d\u0442\u043e \u0441\u0432\u043e\u0438 100 \u0437\u043e\u043b\u043e\u0442\u044b\u0445, \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432. \u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043b\u044e\u0431\u043e\u0439 \u0433\u043e\u0440\u043e\u0434, \u043b\u044e\u0431\u043e\u0439 \u0434\u0438\u0430\u043b\u043e\u0433 \u0438\u043b\u0438 \u043a\u0432\u0435\u0441\u0442 \u0432 \u0438\u0433\u0440\u0430\u0445 \u2014 \u043f\u043b\u043e\u0434 \u0442\u0440\u0443\u0434\u0430 \u0436\u0438\u0432\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u0438 \u043d\u0430\u0441\u0435\u043b\u0438\u0442\u044c \u0436\u0438\u0437\u043d\u044c\u044e \u0442\u0430\u043a\u043e\u0439 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u043c\u0438\u0440 \u0441\u0438\u043b\u0430\u043c\u0438 \u043b\u044e\u0434\u0435\u0439 \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c. \u041d\u043e \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0431\u044b \u043c\u043e\u0433\u043b\u0438 \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c NPC \u0441 \u0438\u0445 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c\u0438 \u0438\u0441\u0442\u043e\u0440\u0438\u044f\u043c\u0438 \u0438 \u043a\u0432\u0435\u0441\u0442\u0430\u043c\u0438?<\/p>\n<h3>\u041f\u043b\u0430\u043d \u0432 \u043e\u0431\u0449\u0438\u0445 \u0447\u0435\u0440\u0442\u0430\u0445<\/h3>\n<p>  \u0422\u0430\u043a \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0438\u0434\u0435\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438\u043b\u0438 \u0434\u0430\u0436\u0435, \u0435\u0441\u043b\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u0435, \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u043b\u0438 \u0431\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<ol>\n<li> \u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0435 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Agent-based_model\">\u0430\u0433\u0435\u043d\u0442\u043d\u043e\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/a> (\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f \u0443\u0437\u043d\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0441\u0435\u043b \u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e). \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0438\u0440, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u0432 \u044d\u0442\u043e\u043c \u043c\u0438\u0440\u0435, \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u043c\u0435\u043d\u044f\u0435\u043c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044e \u0435\u0449\u0435 \u0440\u0430\u0437. \u0418 \u0442\u0430\u043a \u043f\u043e \u043a\u0440\u0443\u0433\u0443, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u043c, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u0445 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u043e\u0431\u0449\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443. \u041e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0448\u0442\u0443\u043a\u0430.\n<\/li>\n<li> <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9E%D0%B1%D1%83%D1%87%D0%B5%D0%BD%D0%B8%D0%B5_%D1%81_%D0%BF%D0%BE%D0%B4%D0%BA%D1%80%D0%B5%D0%BF%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5%D0%BC\">\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u0434\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u0435\u043c<\/a> (\u043e\u043d\u043e \u0436\u0435 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Reinforcement_learning\">reinforcement learning<\/a>). \u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0445\u0441\u044f \u043a\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u043e\u0439. \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u0433\u0440\u0435, \u043f\u0440\u0430\u0432\u0438\u043b \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435, \u043d\u043e \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043f\u0430\u0440\u0442\u0438\u0438, \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0438\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u043e\u0432\u043b\u0438\u044f\u043b\u043e \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0445 \u0432\u0430\u043c\u0438 \u043e\u0447\u043a\u043e\u0432 (<a href=\"http:\/\/blackboxchallenge.com\/\">\u043a\u043e\u043d\u043a\u0443\u0440\u0441 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443<\/a>, \u043f\u0440\u0430\u0432\u0434\u0430, \u0443\u0436\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0441\u044f). \u0422\u0443\u0442 \u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0439 \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0438\u043b\u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0439. \u042d\u0442\u043e \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430\u044f \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438 \u043c\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439.\n<\/li>\n<li> \u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0438\u0440 \u0438 \u043d\u0430\u0441\u0435\u043b\u0438\u043c \u0435\u0433\u043e \u0436\u0438\u0432\u043d\u043e\u0441\u0442\u044c\u044e, \u0440\u0430\u0437\u0443\u043c\u043d\u043e\u0439 \u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c, \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0442\u0443\u0434\u0430 \u043b\u0438\u0447\u043d\u043e, \u043f\u0440\u0438\u0445\u0432\u0430\u0442\u0438\u0432 \u0441\u0432\u043e\u0439 \u0432\u0435\u0440\u043d\u044b\u0439 \u0431\u043b\u0430\u0441\u0442\u0435\u0440, \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u043c\u0435\u0447, \u043c\u043d\u043e\u0433\u043e\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u0438\u0440\u043a\u0443 \u0438\u043b\u0438 \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0433\u0432\u043e\u0437\u0434\u043e\u0434\u0435\u0440.<\/li>\n<\/ol>\n<p>  <\/p>\n<h3>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439<\/h3>\n<p>  \u0418\u0442\u0430\u043a, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0434\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0439 \u0444\u0438\u0437\u0438\u043a\u043e\u0439 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0438\u0440\u0430. \u041e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0438\u0431\u043a\u043e\u0439 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439:<\/p>\n<ol>\n<li> \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043a\u043b\u0435\u0442\u043e\u0447\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442 \u2014 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u044b\u0439 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043c\u0438\u0440, \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0434\u043d\u0443 \u043f\u043b\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0443\u044e \u0434\u043b\u0438\u043d\u0443 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0435. \u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u043b\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043c\u044b\u0441\u043b\u0430 \u2014 \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043a\u043b\u0435\u0442\u043a\u0430\u043c\u0438, \u043d\u0435\u043b\u044c\u0437\u044f \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0435\u0433\u043e \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0437\u0430\u043d\u0438\u043c\u0430\u043b \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0439 \u043a\u043b\u0435\u0442\u043a\u0438, \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e.\n<\/li>\n<li> \u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c \u0448\u0430\u0433\u0430\u043c\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445, \u0442\u043e \u0435\u0441\u0442\u044c \u0443 \u043a\u043b\u0435\u0442\u043a\u0438 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u043c\u0438 \u0431\u0443\u0434\u0443\u0442 4, \u0430 \u043d\u0435 8. \u0414\u043e \u0442\u0435\u0445, \u0447\u0442\u043e \u043f\u043e \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438, \u0431\u0443\u0434\u0435\u0442 \u043f\u043e 2 \u0448\u0430\u0433\u0430.\n<\/li>\n<li> \u0427\u0442\u043e\u0431\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0439\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0433\u043b\u0443\u0431\u0438\u043d\u044b: \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u041f\u043e \u043e\u0434\u043d\u0438\u043c \u0438 \u0442\u0435\u043c \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c \u0432 \u043c\u0438\u0440\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043e\u0434\u043d\u043e\u0433\u043e, \u043d\u043e \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0434\u0432\u0443\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432: \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0438\/\u0438\u043b\u0438 \u043d\u0435\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u044b\u0439. \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e \u043a\u0430\u043a \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u044c, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u043e\u044f\u0442 \u0438 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u044b. \u0422\u0438\u043f\u044b \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0435\u0439 \u0431\u044b\u0432\u0430\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435, \u0442\u0438\u043f\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0442\u043e\u0436\u0435. \u041c\u043e\u0436\u043d\u043e \u043d\u0430 \u043a\u043e\u0432\u0435\u0440 (\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442) \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0443\u043c\u0431\u0443 (\u043d\u0435\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442). \u041d\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u043e\u0441\u0442\u0435\u043b\u0438\u0442\u044c \u043b\u0438\u043d\u043e\u043b\u0435\u0443\u043c \u043d\u0430 \u043b\u0430\u043c\u0438\u043d\u0430\u0442 (\u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e, \u043a\u0442\u043e \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u043e\u043e\u0431\u0449\u0435?) \u0438 \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0443\u043b \u043d\u0430 \u0442\u0443\u043c\u0431\u0443.\n<\/li>\n<li> \u0417\u0430\u0442\u043e \u0432 \u0442\u0443\u043c\u0431\u0435 \u043c\u043e\u0433\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u044b. \u0418 \u0432 \u043a\u043e\u0432\u0440\u0435 \u043c\u043e\u0433\u0443\u0442, \u0438 \u0432 \u043a\u0430\u0440\u043c\u0430\u043d\u0430\u0445 \u0443 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0442\u043e\u0436\u0435. \u0422\u043e \u0435\u0441\u0442\u044c, \u043b\u044e\u0431\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043e\u0432. \u041d\u043e \u043d\u0435 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0438\u043d\u0430\u0447\u0435 \u043c\u044b \u043d\u0430\u0440\u0443\u0448\u0438\u043c \u0442\u0440\u0435\u0442\u0438\u0439 \u0437\u0430\u043a\u043e\u043d.\n<\/li>\n<li> \u0412\u0440\u0435\u043c\u044f \u0442\u0430\u043a\u0436\u0435 \u0438\u0434\u0435\u0442 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u043e. \u041a\u0430\u0436\u0434\u044b\u0439 \u0448\u0430\u0433 \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0436\u0438\u0432\u0435\u0442 \u043e\u0434\u043d\u043e \u043f\u043b\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437\u0432\u043d\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043c\u0438\u0440\u0435 \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0435\u0433\u043e \u043f\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043d\u0430 \u0434\u0430\u043d\u043d\u0443\u044e \u044d\u043f\u043e\u0445\u0443. \u0421\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u0441\u043b\u0430\u0431\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u2014 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438, \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0441\u0441\u0438\u043d\u0445\u0440\u043e\u043d. \u041e\u0431\u044a\u0435\u043a\u0442\u0430\u043c, \u0434\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u00ab\u0445\u043e\u0434\u00bb \u0434\u043e\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0437\u0436\u0435, \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0443\u0436\u0435 \u00ab\u043f\u043e\u0445\u043e\u0434\u0438\u0432\u0448\u0438\u0445\u00bb \u0432 \u044d\u0442\u0443 \u044d\u043f\u043e\u0445\u0443. \u0415\u0441\u043b\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u044d\u043f\u043e\u0445\u0438, \u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0434\u0432\u0430 \u043d\u0435\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0441\u0442\u0430\u043d\u0443\u0442 \u043d\u0430 \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u0443\u044e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u044d\u043f\u043e\u0445\u0438 \u043a\u043b\u0435\u0442\u043a\u0443. \u0418\u043b\u0438 \u0438\u0437\u0432\u043b\u0435\u043a\u0443\u0442 \u0438\u0437 \u043a\u043e\u043c\u043e\u0434\u0430 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043d\u043e\u0441\u043e\u043a. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0438\u0432\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043e\u0431\u0440\u0430\u0449\u0430\u044f\u0441\u044c \u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u044d\u043f\u043e\u0445\u0443 \u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435 \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0446\u0435\u043b\u0438\u043a\u043e\u043c.<\/li>\n<\/ol>\n<p>  \u042d\u0442\u043e \u0434\u0430\u0435\u0442 \u043d\u0430\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432: \u0441\u0430\u043c \u043c\u0438\u0440 (Field), \u043e\u0431\u044a\u0435\u043a\u0442 \u044d\u0442\u043e\u0433\u043e \u043c\u0438\u0440\u0430 (Entity) \u0438 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 (Substance). \u0417\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u043a\u043e\u0434 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f. \u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/github.com\/pavmav\/sandbox-learn\">\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435<\/a> \u043d\u0430 github.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043b\u0430\u0441\u0441\u044b Entity \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">class Entity(object):     def __init__(self):         # home universe         self.board = None          # time-space coordinates         self.x = None         self.y = None         self.z = None          # lifecycle properties         self.age = 0         self.alive = False         self.time_of_death = None          # common properties         self.passable = False         self.scenery = True         self._container = []          # visualization properties         self.color = None      def contains(self, substance_type):         for element in self._container:             if type(element) == substance_type:                 return True         return False      def live(self):         self.z += 1         self.age += 1  class Blank(Entity):     def __init__(self):         super(Blank, self).__init__()         self.passable = True         self.color = &quot;#004400&quot;      def live(self):         super(Blank, self).live()          if random.random() &lt;= 0.0004:             self._container.append(substances.Substance())          if len(self._container) &gt; 0:             self.color = &quot;#224444&quot;         else:             self.color = &quot;#004400&quot;  class Block(Entity):     def __init__(self):         super(Block, self).__init__()         self.passable = False         self.color = &quot;#000000&quot; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043b\u0430\u0441\u0441 Field<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">class Field(object):     def __init__(self, length, height):         self.__length = length         self.__height = height         self.__field = []         self.__epoch = 0         self.pause = False          for y in range(self.__height):             row = []             self.__field.append(row)             for x in range(self.__length):                 if y == 0 or x == 0 or y == (height - 1) or x == (length - 1):                     init_object = Block()                 else:                     init_object = Blank()                  init_object.x = x                 init_object.y = y                 init_object.z = 0                  row.append([init_object]) <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u043b\u0430\u0441\u0441 Substance \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u043c\u044b\u0441\u043b\u0430 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442, \u0432 \u043d\u0435\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u0442.<\/p>\n<p>  \u0417\u0430 \u0432\u0440\u0435\u043c\u044f \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0441\u0430\u043c \u043c\u0438\u0440. \u041a\u0430\u0436\u0434\u0443\u044e \u044d\u043f\u043e\u0445\u0443 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u0432 \u043d\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0445 \u0434\u0435\u043b\u0430\u0442\u044c \u0445\u043e\u0434. \u041a\u0430\u043a \u043e\u043d\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0443\u0442 \u044d\u0442\u043e\u0442 \u0445\u043e\u0434, \u0443\u0436\u0435 \u0438\u0445 \u0434\u0435\u043b\u043e:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0440\u0435\u043c\u044f, \u0432\u043f\u0435\u0440\u0451\u0434!<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">class Field(object):     ...     def make_time(self):         if self.pause:             return          for y in range(self.height):             for x in range(self.length):                 for element in self.__field[y][x]:                     if element.z == self.epoch:                         element.live()          self.__epoch += 1     ... <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u043e \u0437\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u043c\u0438\u0440, \u0434\u0430 \u0435\u0449\u0435 \u0438 \u0441 \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0442\u0430\u0433\u043e\u043d\u0438\u0441\u0442\u0430, \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0435\u0433\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c? \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0435\u0441\u043b\u0438 \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0439, \u043c\u043e\u0436\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u0432\u043b\u0435\u0447\u044c\u0441\u044f, \u0438 \u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0438\u0440\u043e\u043c \u043e\u0442\u043b\u043e\u0436\u0438\u0442\u0441\u044f \u043d\u0430 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0440\u043e\u043a. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0442\u0440\u0430\u0442\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c <a href=\"https:\/\/habrahabr.ru\/post\/193888\/\">\u0432\u043e\u0442 \u044d\u0442\u0443 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e<\/a> \u043f\u0440\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u0440\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"http:\/\/pygame.org\/hifi.html\">pygame<\/a> (\u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438), \u0432\u044b\u0434\u0430\u0435\u043c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u0446\u0432\u0435\u0442\u0430, \u0438 \u0432\u043e\u0442 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u0438\u0435 \u043a\u0430\u0440\u0442\u044b.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">class Field(object):     ...     def list_obj_representation(self):         representation = []         for y in range(self.height):             row_list = []             for cell in self.__field[y]:                 row_list.append(cell[-1])             representation.append(row_list)         return representation     ....  def visualize(field):     pygame.init()     screen = pygame.display.set_mode(DISPLAY)     pygame.display.set_caption(&quot;Field game&quot;)      bg = Surface((WIN_WIDTH, WIN_HEIGHT))     bg.fill(Color(BACKGROUND_COLOR))      myfont = pygame.font.SysFont(&quot;monospace&quot;, 15)      f = field     tick = 10      timer = pygame.time.Clock()     go_on = True      while go_on:         timer.tick(tick)         for e in pygame.event.get():             if e.type == QUIT:                 raise SystemExit, &quot;QUIT&quot;             if e.type == pygame.KEYDOWN:                 if e.key == pygame.K_SPACE:                     f.pause = not f.pause                 elif e.key == pygame.K_UP:                     tick += 10                 elif e.key == pygame.K_DOWN and tick &gt;= 11:                     tick -= 10                 elif e.key == pygame.K_ESCAPE:                     go_on = False          screen.blit(bg, (0, 0))          f.integrity_check()         f.make_time()         level = f.list_obj_representation()         label = myfont.render(&quot;Epoch: {0}&quot;.format(f.epoch), 1, (255, 255, 0))         screen.blit(label, (630, 10))          stats = f.get_stats()         for i, element in enumerate(stats):             label = myfont.render(&quot;{0}: {1}&quot;.format(element, stats[element]), 1, (255, 255, 0))             screen.blit(label, (630, 25 + (i * 15)))          x = y = 0          for row in level:             for element in row:                 pf = Surface((PLATFORM_WIDTH, PLATFORM_HEIGHT))                 pf.fill(Color(element.color))                 screen.blit(pf, (x, y))                  x += PLATFORM_WIDTH             y += PLATFORM_HEIGHT             x = 0          pygame.display.update() <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u043e\u0437\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u0440\u0430\u0437\u0443\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0434\u0430 \u043d\u0435 \u043e\u0434\u0438\u043d. \u041d\u043e \u043f\u043e\u043a\u0430 \u0440\u0430\u0437\u043d\u043e\u0446\u0432\u0435\u0442\u043d\u044b\u0445 \u0431\u0435\u0433\u0430\u044e\u0449\u0438\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u043a\u043e\u0432 \u0432\u043f\u043e\u043b\u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432 \u0430\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u0443 \u0437\u0430\u0440\u043e\u0436\u0434\u0430\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u0431\u044b\u0442\u0438\u044f. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u044d\u0442\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u044e.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ab5\/586\/64a\/ab558664ac0449d0a4792334528b58b4.gif\" alt=\"image\"\/><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0430\u0433\u0435\u043d\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 (\u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 Python, \u043d\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u043c\u0438\u0440\u0430, \u043f\u0440\u0438\u043d\u043e\u0448\u0443 \u0438\u0437\u0432\u0438\u043d\u0435\u043d\u0438\u044f \u0437\u0430 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e\u0441\u0442\u044c). \u0422\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044e, \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c, \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043e\u0442 \u0434\u0440\u0443\u0433\u043e\u0433\u043e, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0435. \u0418\u0442\u0430\u043a, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<ol>\n<li> \u041a\u0430\u0436\u0434\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0441\u0443\u0431\u044a\u0435\u043a\u0442. \u0421\u0443\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0438\u0440\u0430 (Entity).\n<\/li>\n<li> \u041a\u0430\u0436\u0434\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b. \u041a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u00ab\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043e\/\u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043e\u00bb \u0438 \u00ab\u0446\u0435\u043b\u044c \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u0430\/\u0446\u0435\u043b\u044c \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u0430\u00bb. \u041d\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u00ab\u041d\u0430\u0439\u0442\u0438\u0411\u043b\u0438\u0436\u0430\u0439\u0448\u0443\u044e\u041f\u0438\u0446\u0446\u0435\u0440\u0438\u044e\u00bb \u043c\u043e\u0436\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u043f\u043e\u043c\u0438\u043c\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445, \u0438\u043c\u0435\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0438\u043b\u0438 \u0441\u0430\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0438\u0446\u0446\u0435\u0440\u0438\u0438.\n<\/li>\n<li> \u041a\u0430\u0436\u0434\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c, \u0430 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0438\u043c\u0435\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u00ab\u041d\u0430\u043b\u0438\u0442\u044c\u0427\u0430\u0448\u0435\u0447\u043a\u0443\u041a\u043e\u0444\u0435\u00bb \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0438\u043c\u0435\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u044f, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0434\u043b\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u00ab\u041d\u0430\u043b\u0438\u0442\u044c\u00bb \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0442\u043e\u0447\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u043b\u0438\u0442\u044c \u0438 \u043a\u0443\u0434\u0430.\n<\/li>\n<li> \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u043c \u0438\u043b\u0438 \u043d\u0435 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u043c. \u0412 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u044d\u043f\u043e\u0445\u0438 \u043e\u0434\u0438\u043d \u043e\u0431\u044a\u0435\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043d\u0435 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u043b\u044e\u0431\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u0445. \u042d\u0442\u043e \u0441\u043f\u043e\u0440\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u2014 \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u043e\u043b\u043a\u043b\u0435\u0442\u043a\u0438, \u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u044d\u043f\u043e\u0445\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u043c \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043c\u044b\u0432\u0430\u0435\u0442 \u0447\u0435\u0442\u043a\u043e\u0435 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0411\u044b\u043b\u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0434\u0435\u044f \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u0438\u043f\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430 \u043d\u0435\u0433\u043e \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c, \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u0442 0 \u0434\u043e 1, \u0433\u0434\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0432 1 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0441\u044e \u044d\u043f\u043e\u0445\u0443 \u0446\u0435\u043b\u0438\u043a\u043e\u043c. \u041f\u043e\u043a\u0430 \u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0441 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u043c \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043b\u044f \u0447\u0435\u0442\u043a\u043e\u0441\u0442\u0438 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u043c\u0438, \u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0441\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442.<\/li>\n<\/ol>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (Action) \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0434\u043e\u0431\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0438 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0430\u043c\u0430 \u0432 \u0441\u0435\u0431\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u0435\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0438 \u0432\u0441\u0435 \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e, \u0447\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0442\u043e\u0433\u043e, \u043a\u0442\u043e \u0435\u0435 \u0432\u044b\u0437\u0432\u0430\u043b, \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u043c\u0438\u0440\u0430 \u0432\u043e\u043a\u0440\u0443\u0433 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432 \u043e\u0434\u043d\u043e \u0432\u0440\u0435\u043c\u044f \u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c, \u0432 \u0434\u0440\u0443\u0433\u043e\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0432 \u0442\u0440\u0435\u0442\u044c\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430 \u043f\u043e\u043b\u043e\u0447\u043a\u0443 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0431\u044a\u0435\u043a\u0442 Action<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">class Action(object):     def __init__(self, subject):         self.subject = subject         self.accomplished = False         self._done = False         self.instant = False      def get_objective(self):         return {}      def set_objective(self, control=False, **kwargs):         valid_objectives = self.get_objective().keys()          for key in kwargs.keys():             if key not in valid_objectives:                 if control:                     raise ValueError(&quot;{0} is not a valid objective&quot;.format(key))                 else:                     pass  # maybe need to print             else:                 setattr(self, &quot;_{0}&quot;.format(key), kwargs[key])      def action_possible(self):         return True      def do(self):         self.check_set_results()         self._done = True      def check_set_results(self):         self.accomplished = True      @property     def results(self):         out = {&quot;done&quot;: self._done, &quot;accomplished&quot;: self.accomplished}         return out      def do_results(self):         self.do()         return self.results <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043a\u0440\u043e\u043c\u0435 \u043c\u0435\u043d\u044f \u0432\u0434\u0440\u0443\u0433 \u0437\u0430\u0445\u043e\u0447\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0435\u0431\u0435 \u0443\u044e\u0442\u043d\u044b\u0439 \u043c\u0438\u0440\u043e\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0442\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u2014 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043f\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0437\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c, \u043d\u0430\u0439\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043c\u0435\u0442, \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u0438 \u0442.\u0434. \u042d\u0442\u0438\u043c\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0441\u0430\u043c\u0438\u043c\u0438 \u043f\u043e \u0441\u0435\u0431\u0435, \u0442\u0430\u043a \u0438 \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0434\u043b\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439. \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u0438\u0445 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u043b\u0435\u0435, \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p>  \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0432\u0430\u0436\u0430\u044e\u0449\u0438\u0439 \u0441\u0435\u0431\u044f \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0430\u0433\u0435\u043d\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043c\u0435\u0442\u044c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0444\u0430\u0437\u0443 \u0435\u0433\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u044d\u043f\u043e\u0445\u0438 \u043d\u0430 2 \u044d\u0442\u0430\u043f\u0430: \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u043b\u0430\u043d, \u0442\u043e \u043d\u0435\u0447\u0435\u0433\u043e \u043b\u0438\u0448\u043d\u0438\u0439 \u0440\u0430\u0437 \u0440\u0430\u0437\u043c\u044b\u0448\u043b\u044f\u0442\u044c, \u043d\u0430\u0434\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e, \u0440\u0435\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0445\u043e\u0434\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043d\u0430\u0434\u043e \u043b\u0438 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0445\u043e\u0434 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c (\u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0434\u043e, \u043a\u043e\u0433\u0434\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u0443\u0441\u0442\u0430), \u0437\u0430\u0442\u0435\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442, \u0435\u0441\u043b\u0438 \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0414\u043e\u043b\u0436\u043d\u043e \u043b\u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043a\u0430\u043a \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043d\u0435 \u0442\u0435\u0440\u043f\u044f\u0449\u0438\u0439 \u0441\u043f\u0435\u0448\u043a\u0438, \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u0445\u043e\u0434 \u2014 \u0432\u043e\u043f\u0440\u043e\u0441 \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u0439. \u0414\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u044f \u043f\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0435\u0442 \u2014 \u043c\u043e\u0438 \u0430\u0433\u0435\u043d\u0442\u044b \u0434\u043e\u043b\u0433\u043e \u043d\u0435 \u0440\u0430\u0437\u043c\u044b\u0448\u043b\u044f\u044e\u0442 \u0438 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e \u043f\u043b\u0430\u043d\u0430 \u0432 \u0442\u043e\u0442 \u0436\u0435 \u0445\u043e\u0434.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">class Agent(Entity):     ...     def live(self):         ...         if self.need_to_update_plan():             self.plan()          if len(self.action_queue) &gt; 0:              current_action = self.action_queue[0]              self.perform_action(current_action)              while len(self.action_queue) &gt; 0 and self.action_queue[0].instant:                 current_action = self.action_queue[0]                  self.perform_action(current_action)      def need_to_update_plan(self):         return len(self.action_queue) == 0      def perform_action(self, action):         results = action.do_results()          if results[&quot;done&quot;] or not action.action_possible():             self.action_log.append(self.action_queue.pop(0))          return results         ...     ... <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u0434\u043e\u0431\u0430\u0432\u043e\u043a \u043a \u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0432\u0432\u0435\u0441\u0442\u0438 \u0442\u0430\u043a\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0433\u043b\u043e \u0431\u044b \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u0435\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0412\u0435\u0434\u044c, \u0430\u0433\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u0443\u0441\u0442\u0430\u0442\u044c, \u0431\u044b\u0442\u044c \u043d\u0435 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438, \u043d\u0430\u043c\u043e\u043a\u043d\u0443\u0442\u044c, \u043e\u0442\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0438\u043b\u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u0431\u044b\u0442\u044c \u0432\u0435\u0441\u0435\u043b\u044b\u043c \u0438 \u043f\u043e\u043b\u043d\u044b\u043c \u0441\u0438\u043b. \u0418\u043d\u043e\u0433\u0434\u0430 \u0434\u0430\u0436\u0435 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439, \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u044d\u043f\u043e\u0445\u0438.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u043f\u0440\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">class State(object):     def __init__(self, subject):         self.subject = subject         self.duration = 0      def affect(self):         self.duration += 1  class Entity(object):     def __init__(self):         ...         self._states_list = []         ...     ...     def get_affected(self):         for state in self._states_list:             state.affect()      def live(self):         self.get_affected()         self.z += 1         self.age += 1     ... <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0446\u0435\u043d\u0438\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0434\u0430\u0447\u043d\u043e \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0438 \u043e\u0446\u0435\u043d\u043a\u0438 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0446\u0430 \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0438 \u0441\u0431\u043e\u0440\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">import copy  def run_simulation(initial_field, check_stop_function, score_function, times=5, verbose=False):     list_results = []     for iteration in range(times):         field = copy.deepcopy(initial_field)         while not check_stop_function(field):             field.make_time()         current_score = score_function(field)         list_results.append(current_score)         if verbose:             print &quot;Iteration: {0}  Score: {1})&quot;.format(iteration+1, current_score)      return list_results <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0432\u0441\u0435, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0433\u043e\u0442\u043e\u0432\u043e \u0434\u043b\u044f \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438: \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u0430\u0433\u0435\u043d\u0442\u043e\u0432, \u0430 \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439:<\/p>\n<ol>\n<li> \u0420\u0435\u0448\u0430\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u043c\u0438\u0440\u0435: \u0441\u0442\u0435\u043d\u044b, \u0433\u043e\u0440\u044b, \u043c\u0435\u0431\u0435\u043b\u044c, \u0442\u0438\u043f\u044b \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u0442.\u0434. \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0438\u0445, \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044f \u043a\u043b\u0430\u0441\u0441 Entity. \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u0435\u043b\u0430\u0435\u043c \u0441 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u0430\u043c\u0438 \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u043c Substance.<\/li>\n<li> \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0438\u0440 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0435\u0433\u043e \u043f\u0435\u0439\u0437\u0430\u0436\u0435\u043c \u0438\u0437 \u044d\u0442\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043e\u0432.<\/li>\n<li> \u041d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u043a\u043b\u0430\u0441\u0441 Action \u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u0435\u043b\u0430\u0435\u043c \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c State \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c\u0438, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438.<\/li>\n<li> \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u043d\u0430\u0448\u0438\u0445 \u0430\u0433\u0435\u043d\u0442\u043e\u0432, \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044f Agent. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/li>\n<li> \u041d\u0430\u0441\u0435\u043b\u044f\u0435\u043c \u043d\u0430\u0448 \u043c\u0438\u0440 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0430\u0433\u0435\u043d\u0442\u0430\u043c\u0438.<\/li>\n<li> \u0414\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438 \u043d\u0430\u0441\u043b\u0430\u0436\u0434\u0435\u043d\u0438\u044f \u0441\u043e\u0437\u0435\u0440\u0446\u0430\u043d\u0438\u0435\u043c \u0441\u0432\u043e\u0435\u0433\u043e \u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0433\u043e\u043d\u044f\u0442\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e.<\/li>\n<li> \u0418 \u0432 \u0438\u0442\u043e\u0433\u0435, \u043d\u0430\u0438\u0433\u0440\u0430\u0432\u0448\u0438\u0441\u044c \u0441 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044e \u0438 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u043c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0434\u0430\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u043c\u0438 \u0430\u0433\u0435\u043d\u0442\u044b \u0438\u0433\u0440\u0430\u044e\u0442 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c \u043d\u0430\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c \u043d\u0430\u043c\u0438 \u043c\u0438\u0440\u0435.<\/li>\n<\/ol>\n<p>  <\/p>\n<h3>Proof of concept I<\/h3>\n<p>  \u0418\u0442\u0430\u043a, \u043e\u0433\u043b\u0430\u0441\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430. <\/p>\n<ul>\n<li> \u041c\u0438\u0440 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437: \u0441\u0442\u0435\u043d\u044b, \u0437\u0435\u043c\u043b\u044f. \u0421\u0442\u0435\u043d\u044b \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u0442\u0435\u043d\u044b, \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u0447\u0435\u0433\u043e. \u0421 \u0437\u0435\u043c\u043b\u0435\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u2014 \u043a\u0430\u0436\u0434\u0443\u044e \u044d\u043f\u043e\u0445\u0443 \u0435\u0441\u0442\u044c \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u0430\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u0432 \u043b\u044e\u0431\u043e\u0439 \u0438\u043b\u0438 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043a\u043b\u0435\u0442\u043a\u0430\u0445 \u0437\u0435\u043c\u043b\u0438 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u0430.<\/li>\n<li> \u041d\u0430\u0441\u0435\u043b\u0435\u043d\u0438\u0435: \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0434\u0432\u0443\u0445 \u043f\u043e\u043b\u043e\u0432. \u0422\u0430\u043a \u043a\u0430\u043a \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043c\u044b \u043f\u043e\u043b \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043f\u043e\u043b \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u043e\u0436\u043d\u044b\u0439 \u0438\u043b\u0438 \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u0439.<\/li>\n<li> \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u043b\u043e\u0436\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0430 \u0436\u0430\u0434\u0438\u043d\u044b \u0438 \u0438\u043c\u0435\u044e\u0442 \u0446\u0435\u043b\u044c\u044e \u0441\u0432\u043e\u0435\u0439 \u0436\u0438\u0437\u043d\u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0430. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043d\u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f, \u043e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443 \u0441 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u043c, \u0438\u0434\u0443\u0442 \u043a \u043d\u0435\u0439, \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442 \u0440\u0435\u0441\u0443\u0440\u0441 \u0438 \u0442\u0430\u043a \u043f\u043e \u043a\u0440\u0443\u0433\u0443. \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0438 \u043d\u0430\u0434\u0435\u043b\u0435\u043d\u044b \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c\u044e \u043a \u0434\u0435\u0442\u043e\u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044e.<\/li>\n<li> \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u0435\u0435. \u0423 \u043d\u0438\u0445 \u043d\u0430 \u0432\u044b\u0431\u043e\u0440 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f: \u0442\u043e\u0436\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441 \u0438\u043b\u0438 \u0438\u0441\u043a\u0430\u0442\u044c \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u0430 \u0434\u043b\u044f \u0441\u043f\u0430\u0440\u0438\u0432\u0430\u043d\u0438\u044f (\u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0430, \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u043d\u0430\u0440\u043e\u043a\u043e\u043c \u043d\u0435 \u0443\u0433\u043e\u0434\u0438\u0442\u044c \u0432 \u043c\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u0430 \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u0430\u0445 \u0434\u043b\u044f \u0441\u043f\u0430\u0440\u0438\u0432\u0430\u043d\u0438\u044f \u043b\u0443\u0447\u0448\u0435 \u0434\u0430\u0436\u0435 \u043d\u0435 \u0434\u0443\u043c\u0430\u0442\u044c).<\/li>\n<li> \u041a\u043e\u0433\u0434\u0430 \u0440\u0435\u0448\u0438\u0432\u0448\u0435\u0435 \u0441\u043f\u0430\u0440\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0430 \u0434\u043e\u0433\u043e\u043d\u044f\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u0430 \u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0435\u043c\u0443 \u0443\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u043b\u043e\u0436\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0430 \u0440\u0435\u0448\u0430\u0435\u0442, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043e \u043b\u0438 \u043e\u043d\u043e \u043a \u0441\u043f\u0430\u0440\u0438\u0432\u0430\u043d\u0438\u044e, \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0443 \u043e\u0431\u043e\u0438\u0445 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432. \u0415\u0441\u043b\u0438 \u0443 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0449\u0435\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435, \u0442\u043e \u043e\u043d \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0435. \u0415\u0441\u043b\u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e, \u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0441\u043f\u0430\u0440\u0438\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432.<\/li>\n<li> \u0427\u0435\u0440\u0435\u0437 \u0434\u0435\u0441\u044f\u0442\u044c \u044d\u043f\u043e\u0445 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0447\u0430\u0442\u0438\u044f \u0440\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0430. \u041e\u043d\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0432\u0435\u0442 \u0441\u0440\u0430\u0437\u0443, \u0432\u0437\u0440\u043e\u0441\u043b\u044b\u043c, \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438 \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u043e\u043b\u0430.<\/li>\n<li> \u0412\u0441\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u043c\u0435\u0440\u0435\u0442\u044c. \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u044d\u043f\u043e\u0445\u0443, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0434\u0435\u0441\u044f\u0442\u043e\u0439 \u043f\u043e\u0441\u043b\u0435 \u0435\u0433\u043e \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f, \u0435\u0441\u0442\u044c \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u0430\u044f \u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0441\u0432\u043e\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435.<\/li>\n<\/ul>\n<p>  \u041d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0430 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043f\u0443\u043b\u044f\u0446\u0438\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432 \u0440\u0430\u0437\u043c\u043d\u043e\u0436\u0430\u043b\u0430\u0441\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<\/p>\n<p>  \u0414\u043e\u0447\u0438\u0442\u0430\u0432\u0448\u0438\u0445 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u044f \u0438\u0437 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u0438 \u043d\u0435 \u0431\u0443\u0434\u0443 \u0443\u0442\u043e\u043c\u043b\u044f\u0442\u044c \u0434\u043b\u0438\u043d\u043d\u044b\u043c\u0438 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f\u043c\u0438, \u043f\u043e\u043a\u0430\u0436\u0443 \u0442\u043e\u043b\u044c\u043a\u043e:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0430\u0440\u0438\u0430\u043d\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043f\u0430\u0440\u0438\u0432\u0430\u043d\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">class GoMating(Action):     def __init__(self, subject):         super(GoMating, self).__init__(subject)          self.search_action = SearchMatingPartner(subject)         self.move_action = MovementToEntity(subject)         self.mate_action = Mate(subject)          self.current_action = self.search_action      def action_possible(self):          if not self.current_action:             return False          return self.current_action.action_possible()      def do(self):         if self.subject.has_state(states.NotTheRightMood):             self._done = True             return          if self.results[&quot;done&quot;]:             return          if not self.action_possible():             self._done = True             return          first = True          while first or (self.current_action and self.current_action.instant) and not self.results[&quot;done&quot;]:              first = False              current_results = self.current_action.do_results()              if current_results[&quot;done&quot;]:                 if current_results[&quot;accomplished&quot;]:                     if isinstance(self.current_action, SearchMatingPartner):                         if current_results[&quot;accomplished&quot;]:                             self.current_action = self.move_action                             self.current_action.set_objective(**{&quot;target_entity&quot;: current_results[&quot;partner&quot;]})                     elif isinstance(self.current_action, MovementXY):                         self.current_action = self.mate_action                         self.current_action.set_objective(**{&quot;target_entity&quot;: self.search_action.results[&quot;partner&quot;]})                     elif isinstance(self.current_action, Mate):                         self.current_action = None                         self.accomplished = True                         self._done = True                 else:                     self.current_action = None                     self._done = True             else:                 break      def check_set_results(self):         self.accomplished = self._done <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">class Creature(Agent):     ...     def plan(self):         nearest_partner = actions.SearchMatingPartner(self).do_results()[&quot;partner&quot;]         if nearest_partner is None:             chosen_action = actions.HarvestSubstance(self)             chosen_action.set_objective(** {&quot;target_substance_type&quot;: type(substances.Substance())})             self.queue_action(chosen_action)         else:             self_has_substance = self.count_substance_of_type(substances.Substance)             partner_has_substance = nearest_partner.count_substance_of_type(substances.Substance)             if partner_has_substance - self_has_substance &gt; 2:                 self.queue_action(actions.GoMating(self))             else:                 chosen_action = actions.HarvestSubstance(self)                 chosen_action.set_objective(**{&quot;target_substance_type&quot;: type(substances.Substance())})                 self.queue_action(chosen_action)     ... <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h3>\u041f\u0440\u043e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u0431\u043e\u0433\u043e\u0432<\/h3>\n<p>  \u0423\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u0432\u0448\u0438\u0441\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u0430\u0447\u043d\u0435\u043c \u043f\u043e\u0432\u044b\u0448\u0430\u0442\u044c \u0433\u0440\u0430\u0434\u0443\u0441 \u0432\u0435\u0441\u0435\u043b\u044c\u044f \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0435 \u0432\u0441\u0435 \u0438\u0437 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b, \u043e\u0434\u043d\u0430\u043a\u043e, \u044f \u043e\u0431\u0435\u0449\u0430\u043b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u0431\u043e\u0433\u043e\u0432.<\/p>\n<p>  \u041d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0434\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u043d\u0430\u0448\u0438\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432. \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0442\u0443 \u0436\u0435 \u0441\u0430\u043c\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0441 \u043f\u043e\u0438\u0441\u043a\u0430\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0438 \u0441\u043f\u0430\u0440\u0438\u0432\u0430\u043d\u0438\u0435\u043c. \u0415\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u0440\u0435\u0448\u0430\u043b\u0438 \u0435\u0435 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043f\u0443\u0442\u0435\u043c, \u0442\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u0431\u044b \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u043e\u043f\u0438\u0440\u0430\u044f\u0441\u044c \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0417\u0430\u0442\u0435\u043c, \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u043b\u0438 \u0435\u0449\u0435 \u043a\u0430\u043a-\u0442\u043e, \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u044b \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0445. \u0421\u043b\u0435\u0434\u043e\u043c \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u0438\u0445 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430\u0445 \u043f\u0430\u0440\u0443 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0438\u0445 \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0443\u044e. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044e \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f. \u0418 \u0442\u0443\u0442 \u043d\u0430\u043c \u0431\u044b \u043f\u0440\u0438\u0448\u043b\u043e \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a, \u0430 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u0435\u0440\u0435\u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438, \u043f\u0435\u0440\u0435\u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0438\u0445 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e <s>\u043f\u0435\u0440\u0435<\/s>\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/p>\n<p>  \u0410 \u0447\u0442\u043e \u0431\u044b \u043d\u0430\u043c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432 \u0438\u0434\u0435\u0430\u043b\u0435? \u0412 \u0438\u0434\u0435\u0430\u043b\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b \u0443\u0436\u0435 \u0441\u0430\u043c\u0430 \u0441\u043e\u0431\u0440\u0430\u043b\u0430 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u044b, \u043d\u0430\u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u043c\u043e\u0434\u0435\u043b\u044c, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0430 \u0435\u0435 \u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u044b\u0434\u0430\u043b\u0430 \u043d\u0430\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0440\u043e\u0433\u043e\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432.<\/p>\n<p>  \u0418 \u0432\u043e\u0442 \u043a\u0430\u043a \u044f \u0441\u0435\u0431\u0435 \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e:<\/p>\n<ul>\n<li> \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0421\u0435\u0439\u0447\u0430\u0441 \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u044d\u0442\u043e \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0430. \u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u044d\u0442\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u0430\u0440\u0442\u043d\u0435\u0440\u043e\u0432, \u0435\u0449\u0435 \u043e\u0434\u043d\u0430, \u0441\u0447\u0438\u0442\u0430\u044e\u0449\u0430\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0443 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0430, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0435\u0449\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0438 \u0442.\u0434. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0443\u0434\u0430\u0447\u043d\u0435\u0435 \u0431\u044b\u043b\u0430 \u0431\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u044f \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u043d\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043c\u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u0435\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0435\u0435 \u043d\u0430\u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u0433\u043e \u043c\u0438\u0440\u0430.\n<\/li>\n<li> \u0422\u0430\u043a \u0436\u0435 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0435\u0433\u043e \u043d\u0430\u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044d\u0442\u043e, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443\u0434\u0430\u0447\u043d\u043e \u0438\u043b\u0438 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e \u043f\u0440\u043e\u0448\u043b\u043e \u0441\u043f\u0430\u0440\u0438\u0432\u0430\u043d\u0438\u0435.\n<\/li>\n<li> \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0445\u043e\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0438 \u0435\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0442\u043e\u0445\u0430\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0441\u043f\u0443\u0441\u043a, \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043b\u0435\u0441, \u043a\u0430\u043a\u0443\u044e-\u043d\u0438\u0431\u0443\u0434\u044c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u0438\u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0447\u0442\u043e-\u0442\u043e \u0441\u0432\u043e\u0435.\n<\/li>\n<li> \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u043f\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u043d\u0430\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 (\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443 \u043d\u0430\u0441 \u0435\u0449\u0435 \u043f\u0443\u0441\u0442\u0430\u044f). \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043e\u043d\u0438 \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u043f\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u043d\u0430\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0442 \u0435\u0433\u043e \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043e\u0431\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e (\u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0434 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c), \u0438 \u0432\u0443\u0430\u043b\u044f, \u0443 \u043d\u0430\u0441 \u0433\u043e\u0442\u043e\u0432 \u0441\u044d\u043c\u043f\u043b \u0434\u043b\u044f \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u043e\u0433\u043e \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0430. \u041f\u0440\u043e\u0434\u0435\u043b\u0430\u0432 \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437 \u0438 \u043d\u0430\u043a\u043e\u043f\u0438\u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0430, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0441\u043a\u0430\u0440\u043c\u043b\u0438\u0432\u0430\u044e\u0442 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0432 \u043c\u043e\u0434\u0435\u043b\u044c. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430\u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0430, \u043e\u043d\u0438 \u0443\u0436\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0435.\n<\/li>\n<li> \u0414\u0430\u043b\u044c\u0448\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b. \u041c\u043e\u0436\u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f. \u0410 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u043d\u0430\u0431\u043e\u0440\u044b \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438 \u043a\u0443\u0441\u043a\u0430\u043c\u0438 \u0441\u043a\u0430\u0440\u043c\u043b\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0438, \u0435\u0441\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0443\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u0418\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0435\u0440\u0435\u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0435\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u043d\u0438\u0436\u0430\u0442\u044c\u0441\u044f.<\/li>\n<\/ul>\n<p>  \u0422\u0443\u0442 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0443 \u0441\u0443\u0449\u0435\u0441\u0442\u0432 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u043f\u0430\u043c\u044f\u0442\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u044b. \u041e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0443\u043c\u0435\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u043a \u043d\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043f\u0440\u0438\u043d\u044f\u0442\u043e\u0433\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043d\u0430\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u0432\u0438\u0434\u0435. \u041d\u0443, \u0438 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435, \u0447\u0435\u043c\u0443 \u043d\u0430\u0441 \u0443\u0447\u0438\u043b\u0438 \u0432 \u0432\u0443\u0437\u0435.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0422\u0430\u0439\u043d\u044b \u043f\u0430\u043c\u044f\u0442\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">class LearningMemory(object):     def __init__(self, host):         self.host = host         self.memories = {}      def save_state(self, state, action):         self.memories[action] = {&quot;state&quot;: state}      def save_results(self, results, action):         if action in self.memories:             self.memories[action][&quot;results&quot;] = results         else:             pass      def make_table(self, action_type):         table_list = []         for memory in self.memories:             if isinstance(memory, action_type):                 if &quot;state&quot; not in self.memories[memory] or &quot;results&quot; not in self.memories[memory]:                     continue                 row = self.memories[memory][&quot;state&quot;][:]                 row.append(self.memories[memory][&quot;results&quot;])                 table_list.append(row)          return table_list      def obliviate(self):         self.memories = {} <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043d\u0430\u0443\u0447\u0438\u0442\u044c \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u043e\u0431\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0441\u0432\u043e\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0439<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">class Agent(Entity):     def __init__(self):         ...         self.memorize_tasks = {}         ....     ...     def set_memorize_task(self, action_types, features_list, target):         if isinstance(action_types, list):             for action_type in action_types:                 self.memorize_tasks[action_type] = {&quot;features&quot;: features_list,                                                     &quot;target&quot;: target}         else:             self.memorize_tasks[action_types] = {&quot;features&quot;: features_list,                                                  &quot;target&quot;: target}      def get_features(self, action_type):         if action_type not in self.memorize_tasks:             return None          features_list_raw = self.memorize_tasks[action_type][&quot;features&quot;]         features_list = []          for feature_raw in features_list_raw:             if isinstance(feature_raw, dict):                 if &quot;kwargs&quot; in feature_raw:                     features_list.append(feature_raw[&quot;func&quot;](**feature_raw[&quot;kwargs&quot;]))                 else:                     features_list.append(feature_raw[&quot;func&quot;]())             elif callable(feature_raw):                 features_list.append(feature_raw())             else:                 features_list.append(feature_raw)          return features_list      def get_target(self, action_type):         if action_type not in self.memorize_tasks:             return None          target_raw = self.memorize_tasks[action_type][&quot;target&quot;]          if callable(target_raw):             return target_raw()         elif isinstance(target_raw, dict):             if &quot;kwargs&quot; in target_raw:                 return target_raw[&quot;func&quot;](**target_raw[&quot;kwargs&quot;])             else:                 return target_raw[&quot;func&quot;]()         else:             return target_raw      def queue_action(self, action):          if type(action) in self.memorize_tasks:             self.private_learning_memory.save_state(self.get_features(type(action)), action)             self.public_memory.save_state(self.get_features(type(action)), action)          self.action_queue.append(action)      def perform_action_save_memory(self, action):         self.chosen_action = action          if type(action) in self.memorize_tasks:             results = self.perform_action(action)             if results[&quot;done&quot;]:                 self.private_learning_memory.save_results(self.get_target(type(action)), action)                 self.public_memory.save_results(self.get_target(type(action)), action)         else:             results = self.perform_action(action)     ... <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u043a\u0438\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440, \u043f\u043e-\u043e\u0442\u0435\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0437\u0430 \u0432\u0441\u0435\u043c\u0438 \u0430\u0433\u0435\u043d\u0442\u0430\u043c\u0438, \u0440\u0430\u0437\u0434\u0430\u044e\u0449\u0438\u0439 \u0438\u043c \u0437\u0430\u0434\u0430\u043d\u0438\u044f, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u044e\u0449\u0438\u0439, \u043a\u0430\u043a \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u043e\u0442 \u043b\u0443\u043a\u0430\u0432\u043e\u0433\u043e, \u043c\u043d\u043e\u0433\u043e\u043c\u0438\u043b\u043e\u0441\u0442\u0438\u0432\u044b\u0439 \u0438 \u0432\u0441\u0435\u0431\u043b\u0430\u0433\u043e\u0439. \u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0447\u0435\u043c \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0432 \u0430\u0433\u0435\u043d\u0442\u0430\u0445, \u0430 \u043e\u0431\u0449\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0433\u0434\u0435-\u0442\u043e \u0432 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u043c\u0438\u0440\u0430 \u0438\u043b\u0438 \u0435\u0449\u0435 \u0433\u0434\u0435-\u043d\u0438\u0431\u0443\u0434\u044c, \u043d\u0430\u043c \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0432\u043a\u043b\u0438\u043d\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u0433\u0435\u043d\u0442\u0430 \u0432 \u043d\u0430\u0448\u0435\u043c \u043c\u0438\u0440\u0435 \u0438 \u043d\u0430\u0434\u0435\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u0441\u043e\u0437\u043d\u0430\u043d\u0438\u0435\u043c, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044f \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0442\u0438\u043f\u0430 \u043f\u0430\u043c\u044f\u0442\u0438, \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. <\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442 Demiurge, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u043c\u0443 \u043c\u0438\u0440\u0443. \u0412\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043a\u0440\u043e\u043c\u0435 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445, \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u043c\u0438\u0440\u0435 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0430 insert_object. \u0412 \u043d\u0435\u0433\u043e \u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u0438\u043d\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0448\u0435 \u0431\u043e\u0436\u0435\u0441\u0442\u0432\u043e, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044f \u0441\u0432\u043e\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0435 \u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0422\u0435\u043e\u0433\u043e\u043d\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">class Demiurge(object):     def handle_creation(self, creation, refuse):         pass  class Field(object):     def __init__(self, length, height):     ...         self.demiurge = None     ...     def insert_object(self, x, y, entity_object, epoch_shift=0):         if self.demiurge is not None:             refuse = False             self.demiurge.handle_creation(entity_object, refuse)             if refuse:                 return          assert x &lt; self.length         assert y &lt; self.height          self.__field[y][x][-1] = entity_object          entity_object.z = self.epoch + epoch_shift          entity_object.board = self         entity_object.x = x         entity_object.y = y     ... <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0434\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439:<\/p>\n<ul>\n<li> \u0412\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u0430 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0435 (\u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e) \u043c\u0435\u0441\u0442\u043e. \u0415\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u043d\u043d\u044b\u0435 \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439, \u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u044e\u0430\u043d\u0441\u0430\u0445 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.\n<\/li>\n<li> \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0431\u0435\u0437\u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u044f\u0442\u044c \u043e\u0434\u043d\u043e\u0433\u043e \u0434\u0435\u043c\u0438\u0443\u0440\u0433\u0430 \u0434\u0440\u0443\u0433\u0438\u043c \u2014 \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f, \u0438\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0446\u0435\u043b\u044f\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0438\u0440, \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u0443\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u043e\u043d\u043a\u0443\u0440\u0441, \u0447\u0435\u0439 \u0431\u043e\u0433 <s>\u0441\u0430\u043c\u044b\u0439 \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u0439<\/s> \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043e\u0431\u0443\u0447\u0438\u0442 \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443.\n<\/li>\n<li> \u0418\u043b\u0438 \u0435\u0441\u0442\u044c \u0438\u0434\u0435\u044f (\u043f\u043e\u043a\u0430 \u043d\u0435\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f) \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0446\u0435\u043b\u044b\u0435 \u043f\u0430\u043d\u0442\u0435\u043e\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u0434\u0435\u043c\u0438\u0443\u0440\u0433\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u043b\u0438 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430 (\u043e\u0434\u0438\u043d \u0443\u0447\u0438\u0442 \u043a\u0443\u0437\u043d\u0435\u0447\u043d\u043e\u043c\u0443 \u0434\u0435\u043b\u0443, \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u044b\u0440\u0430\u0449\u0438\u0432\u0430\u0442\u044c \u0432\u0438\u043d\u043e\u0433\u0440\u0430\u0434, \u0442\u0440\u0435\u0442\u0438\u0439 \u043f\u043b\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0438 \u0440\u0430\u0437\u043c\u043d\u043e\u0436\u0430\u0442\u044c\u0441\u044f). \u0418\u043b\u0438 \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u043a\u043e\u043d\u043a\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438, \u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0420\u0430\u0433\u043d\u0430\u0440\u0451\u043a \u0441\u0438\u043b\u0430\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0440\u0430\u0437\u043d\u044b\u0445 \u0431\u043e\u0433\u043e\u0432.<\/li>\n<\/ul>\n<p>  \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0430\u0433\u0435\u043d\u0442\u0430\u043c \u0431\u044b\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0442\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u043b\u0438 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u041f\u0443\u0431\u043b\u0438\u0447\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u2014 \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432. \u0412 \u043d\u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438 \u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0435 \u0430\u0433\u0435\u043d\u0442\u044b \u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u043b\u044e\u0431\u043e\u0439. \u041f\u0443\u0431\u043b\u0438\u0447\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u2014 \u0443\u0447\u0435\u0431\u043d\u0438\u043a \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0442\u043e\u0439 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e. \u041d\u0443, \u0430 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u2014 \u044d\u0442\u043e \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 \u0438 \u0443\u043c\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0430\u0433\u0435\u043d\u0442\u0430. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0435\u0440\u043f\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0437 \u043e\u0431\u0449\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0441\u0432\u043e\u044e \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<\/p>\n<h3>Proof of concept II<\/h3>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0435\u0448\u0438\u0442\u044c \u0442\u0443 \u0436\u0435 \u0441\u0430\u043c\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0441 \u0441\u043e\u0431\u0438\u0440\u0430\u043d\u0438\u0435\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u043c\u0438 \u043b\u043e\u0436\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0430. \u0422\u0430\u043a \u043a\u0430\u043a \u0437\u0430\u0434\u0430\u0447\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f, \u0442\u043e \u0443 \u043d\u0430\u0441 \u0432\u0440\u044f\u0434 \u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0440\u0435\u0448\u0438\u0442\u044c \u0435\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0436\u0435\u0441\u0442\u043a\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0448\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u0435\u043b\u0438 \u043d\u0435 \u0432\u044b\u043c\u0435\u0440\u043b\u0438 \u043a\u0430\u043a \u0432\u0438\u0434 \u043e\u0442 \u043d\u0435\u0436\u0435\u043b\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u043d\u0435\u0443\u043c\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u043d\u043e\u0436\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  \u041d\u0438\u0436\u0435 \u043f\u043e\u043b\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438:<\/p>\n<ul>\n<li> \u041d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0434\u0435\u043c\u0438\u0443\u0440\u0433\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0432\u043e\u0435 \u0431\u043e\u0436\u0435\u0441\u0442\u0432\u043e (Priapus).<\/li>\n<li> \u041f\u0430\u043c\u044f\u0442\u044c \u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0449\u0438\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0438\u0445 \u0432 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438. \u041c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0431\u0435\u0440\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"http:\/\/scikit-learn.org\/stable\/modules\/generated\/sklearn.linear_model.SGDClassifier.html\">SGDClassifier \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 sklearn<\/a>.<\/li>\n<li> \u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c handle_creation.<\/li>\n<li> \u0412 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u043e \u0442\u043e\u043c, \u0441\u043f\u0430\u0440\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043b\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0440\u0435\u043c\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438: \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u043b\u0438 \u043c\u044b, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0442\u043d\u0435\u0440 \u0438 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0443\u0440\u043e\u0432\u043d\u044f\u0445 \u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0430. \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0442\u043e, \u043a\u0430\u043a \u044d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u0438 \u0434\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0430\u0433\u0435\u043d\u0442\u0443 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u0438\u0445 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u0440\u0435\u0448\u0438\u0442 \u0441\u043f\u0430\u0440\u0438\u0432\u0430\u0442\u044c\u0441\u044f.<\/li>\n<li> \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: \u043f\u043e\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u0430, \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u043e \u0438 \u0432\u0441\u0435 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c (\u043a\u0441\u0442\u0430\u0442\u0438, \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u043a\u0430\u043a \u0432 sklearn \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043e\u0431\u0443\u0447\u0435\u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0438\u043b\u0438 \u043d\u0435\u0442?). \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043a\u043e\u043f\u0438\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u043f\u044b\u0442\u0430 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 20 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u043d\u0430 \u0432\u0441\u0435\u0445, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u0431\u0449\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c), \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u043b\u0438 \u0438\u0434\u0435\u044f \u0441\u043f\u0430\u0440\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430\u0445. \u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u0431\u0435\u0436\u0438\u043c \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u043a\u0438\u043e\u0441\u043a \u0437\u0430 \u0432\u0438\u043d\u043e\u043c \u0438 \u0448\u043e\u043a\u043e\u043b\u0430\u0434\u043a\u043e\u0439. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u0434\u043e\u0431\u044b\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441.<\/li>\n<li> \u041f\u0440\u043e\u0433\u043e\u043d\u044f\u0435\u043c 30 \u0440\u0430\u0437 \u043f\u043e 500 \u044d\u043f\u043e\u0445 \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0436\u0438\u0432\u0443\u0449\u0438\u0445 \u043d\u0430 500\u044e \u044d\u043f\u043e\u0445\u0443 \u0441\u0443\u0449\u0435\u0441\u0442\u0432. \u0414\u0435\u043b\u0430\u0435\u043c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0441\u0442\u043e\u0445\u0430\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u043d\u044b\u0439 \u0441\u043f\u0443\u0441\u043a \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435 \u043b\u0443\u0447\u0448\u0435.<\/li>\n<li> \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u0443\u043c\u0438\u043b\u044f\u0435\u043c\u0441\u044f \u0441\u0432\u043e\u0435\u043c\u0443 \u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044e.<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0427\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># Create deity class Priapus(field.Demiurge):  # Create deity     def __init__(self):         self.public_memory = brain.LearningMemory(self)         self.public_decision_model = SGDClassifier(warm_start=True)      def handle_creation(self, creation, refuse):         if isinstance(creation, entities.Creature):             creation.public_memory = self.public_memory             creation.public_decision_model = self.public_decision_model             creation.memory_type = &quot;public&quot;             creation.model_type = &quot;public&quot;             creation.memory_batch_size = 20              if creation.sex:                 def difference_in_num_substance(entity):                     nearest_partner = actions.SearchMatingPartner(entity).do_results()[&quot;partner&quot;]                     if nearest_partner is None:                         return 9e10                     else:                         self_has_substance = entity.count_substance_of_type(substances.Substance)                         partner_has_substance = nearest_partner.count_substance_of_type(substances.Substance)                         return partner_has_substance - self_has_substance                   def possible_partners_exist(entity):                     find_partner = actions.SearchMatingPartner(entity)                     search_results = find_partner.do_results()                     return float(search_results[&quot;accomplished&quot;])                  features = [{&quot;func&quot;: lambda creation: float(creation.has_state(states.NotTheRightMood)),                              &quot;kwargs&quot;: {&quot;creation&quot;: creation}},                             {&quot;func&quot;: difference_in_num_substance,                              &quot;kwargs&quot;: {&quot;entity&quot;: creation}},                              {&quot;func&quot;: possible_partners_exist,                               &quot;kwargs&quot;: {&quot;entity&quot;: creation}}]                  creation.set_memorize_task(actions.GoMating, features,                                            {&quot;func&quot;: lambda creation: creation.chosen_action.results[&quot;accomplished&quot;],                                             &quot;kwargs&quot;: {&quot;creation&quot;: creation}})              def plan(creature):                 if creature.sex:                     try:                         # raise NotFittedError                         current_features = creature.get_features(actions.GoMating)                         current_features = np.asarray(current_features).reshape(1, -1)                         if creature.public_decision_model.predict(current_features):                             go_mating = actions.GoMating(creature)                             creature.queue_action(go_mating)                             return                         else:                             harvest_substance = actions.HarvestSubstance(creature)                             harvest_substance.set_objective(                                 **{&quot;target_substance_type&quot;: type(substances.Substance())})                             creature.queue_action(harvest_substance)                             return                     except NotFittedError:                         chosen_action = random.choice(                             [actions.GoMating(creature), actions.HarvestSubstance(creature)])                         if isinstance(chosen_action, actions.HarvestSubstance):                             chosen_action.set_objective(                                 **{&quot;target_substance_type&quot;: type(substances.Substance())})                         creature.queue_action(chosen_action)                         return                 else:                     harvest_substance = actions.HarvestSubstance(creature)                     harvest_substance.set_objective(**{&quot;target_substance_type&quot;: type(substances.Substance())})                     creature.queue_action(harvest_substance)              creation.plan_callable = plan   universe = field.Field(60, 40)  # Create sample universe (length, height  universe.set_demiurge(Priapus())  # Assign deity to universe  # Fill universe with blanks, blocks, other scenery if necessary for y in range(10, 30):     universe.insert_object(20, y, field.Block())  for x in range(21, 40):     universe.insert_object(x, 10, field.Block())  for y in range(10, 30):     universe.insert_object(40, y, field.Block())  universe.populate(entities.Creature, 20)  # Populate universe with creatures  def check_stop_function(field):     return field.epoch &gt;= 500   def score_function(field):     stats = field.get_stats()     if &quot;Creature&quot; not in stats:         return 0     else:         return stats[&quot;Creature&quot;]  res = modelling.run_simulation(universe, check_stop_function, score_function, verbose=True, times=30) print res print np.asarray(res).mean() <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0412 \u0442\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435 \u043a\u0430\u043a \u043e\u043d\u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u0435\u0441\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0443 \u0430\u043b\u044c\u0444\u0430-\u0432\u0435\u0440\u0441\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438. \u0410 \u0442\u0440\u0435\u0442\u0438\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f (\u043f\u0440\u043e \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0438\u0440) \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432. \u0418 \u0432\u043e\u0442 \u0447\u0442\u043e \u044f \u043d\u0430\u043c\u0435\u0440\u0435\u043d \u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435:<\/p>\n<ul>\n<li> \u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u0410 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u043b\u0433\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0443\u0447\u0435\u0442\u0430 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439.<\/li>\n<li> \u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0438\u0440\u043e\u043c \u043f\u0440\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (\u0443\u0431\u0440\u0430\u0442\u044c\/\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u0433\u0435\u043d\u0442\u0430, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c\/\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0438\u0440\u0430 \u0438 \u0442.\u0434.). \u0418 \u0432\u043e\u043e\u0431\u0449\u0435 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0434\u0430\u0436\u0435 \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.<\/li>\n<li> \u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439.<\/li>\n<li> \u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043d\u043e\u0433\u043e\u0431\u043e\u0436\u0438\u044f.<\/li>\n<li> \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u043d\u0438\u0437\u043e\u0439\u0442\u0438 \u0432 \u0441\u043e\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044b\u0439 \u043c\u0438\u0440 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0432 \u043f\u0443\u0442\u044c, \u043f\u043e\u043b\u043d\u044b\u0439 \u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0439, \u043f\u0440\u0438\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0438 \u043d\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432.<\/li>\n<li> \u041f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u0442\u0435\u0441\u0442\u0430\u043c\u0438<\/li>\n<li> \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f<\/li>\n<li> &#8230;<\/li>\n<li> PROFIT<\/li>\n<\/ul>\n<p>  \u042f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u0442\u0434\u0430\u044e \u0441\u0435\u0431\u0435 \u043e\u0442\u0447\u0435\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0431\u0431\u0438-\u043f\u0440\u043e\u0435\u043a\u0442, \u0432\u0438\u0436\u0443 \u043c\u043d\u043e\u0433\u043e \u0431\u0430\u0433\u043e\u0432 \u0438 \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0432 \u0441\u0432\u043e\u0435\u043c \u043a\u043e\u0434\u0435 \u0438 \u0437\u043d\u0430\u044e, \u0447\u0442\u043e \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u0447\u0442\u043e-\u0442\u043e, \u0447\u0435\u0433\u043e \u044f \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u0438\u0436\u0443. \u041d\u043e \u044f \u0431\u044b \u0441\u043b\u0443\u043a\u0430\u0432\u0438\u043b, \u0435\u0441\u043b\u0438 \u0431\u044b \u0441\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u0433\u0434\u0435-\u0442\u043e \u0432 \u043f\u043e\u0442\u0430\u0439\u043d\u044b\u0445 \u0437\u0430\u043a\u043e\u0443\u043b\u043a\u0430\u0445 \u0441\u0432\u043e\u0435\u0439 \u0442\u0435\u043c\u043d\u043e\u0439 \u0434\u0443\u0448\u0438 \u043d\u0435 \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0440\u0430\u0441\u0442\u0438 \u0432\u043e \u0447\u0442\u043e-\u0442\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u0445\u043e\u0442\u044f \u0431\u044b \u0432 \u0432\u0438\u0434\u0435 \u0438\u0434\u0435\u0438 \u0438\u043b\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0437\u044b\u0432\u0430\u044e \u0432\u0441\u0435\u0445 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u043d\u0435 \u043d\u0430 \u043c\u043e\u0438 \u043a\u0440\u0438\u0432\u044b\u0435 \u0440\u0443\u043a\u0438, \u043e\u0431\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u043d\u0434\u0443\u0441\u043e\u043c \u0438 \u0442\u044b\u043a\u0430\u0442\u044c \u043d\u043e\u0441\u043e\u043c \u0432 \u043a\u043d\u0438\u0436\u043a\u0438 \u043f\u0440\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0438\u0440 \u043b\u0443\u0447\u0448\u0435. \u0418\u043b\u0438 \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u0443\u043c\u043d\u0435\u0435, \u0438\u043b\u0438 \u0431\u043e\u0433\u043e\u0432 \u0432\u0441\u0435\u043c\u043e\u0433\u0443\u0449\u0435\u0435.<\/p>\n<p>  \u0415\u0449\u0435 \u0440\u0430\u0437 <a href=\"https:\/\/github.com\/pavmav\/sandbox-learn\">\u0441\u0441\u044b\u043b\u043a\u0430 <\/a>\u043d\u0430 github. \u0418 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e \u043f\u0440\u043e <a href=\"http:\/\/www.pygame.org\/download.shtml\">pygame <\/a>\u0438 <a href=\"http:\/\/scikit-learn.org\/stable\/install.html\">sklearn<\/a>, \u0435\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u0443 \u0432\u0430\u0441 \u0435\u0449\u0435 \u043d\u0435\u0442.<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:\/\/habrahabr.ru\/post\/315424\/\"> https:\/\/habrahabr.ru\/post\/315424\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0448\u044c \u0434\u0435\u043d\u044c \u0432 \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u0445 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u0432 \u00ab\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432\u00bb \u0438 \u00ab\u0438\u0434\u0438\u043e\u0442\u044b\u00bb \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u0433\u043b\u0430\u0432\u043d\u043e\u043c\u0443 \u0431\u0443\u0445\u0433\u0430\u043b\u0442\u0435\u0440\u0443, \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0437\u0430\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0447\u0442\u0438 \u043d\u0430 \u043d\u0435\u0434\u0435\u043b\u044e \u0438\u0437-\u0437\u0430 \u043e\u0440\u0444\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438, \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0439 \u043a\u0435\u043c-\u0442\u043e \u0432 \u043a\u043e\u0434\u0435 \u0432 2009 \u0433\u043e\u0434\u0443. \u0412 \u0442\u0430\u043a\u0438\u0435 \u0434\u043d\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u043e\u0431\u043e\u0440\u0432\u0430\u0442\u044c \u0440\u0443\u043a\u0438 \u0442\u043e\u043c\u0443 \u0443\u043c\u043d\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0442\u0432\u043e\u0440\u0438\u043b \u044d\u0442\u043e\u0442 \u043c\u0438\u0440, \u0438 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0435 \u0441 \u043d\u043e\u043b\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/8fd\/c07\/73c\/8fdc0773c47140ddb1b93904dcbfdcbc.jpeg\" alt=\"image\"\/><\/p>\n<p>  TL;DR<br \/>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 \u0434\u043b\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f Python \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e \u0441\u0432\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%90%D0%B3%D0%B5%D0%BD%D1%82%D0%BD%D0%BE%D0%B5_%D0%BC%D0%BE%D0%B4%D0%B5%D0%BB%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5\">\u0430\u0433\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/a> \u0441 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0438 \u0431\u043e\u0433\u0430\u043c\u0438.<\/p>\n<p>  <a href=\"https:\/\/github.com\/pavmav\/sandbox-learn\">\u0421\u0441\u044b\u043b\u043a\u0430 <\/a>\u043d\u0430 github. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043d\u0443\u0436\u0435\u043d <a href=\"http:\/\/www.pygame.org\/download.shtml\">pygame<\/a>. \u0414\u043b\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f <a href=\"http:\/\/scikit-learn.org\/stable\/install.html\">sklearn<\/a>.  <\/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-281060","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/281060","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=281060"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/281060\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=281060"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=281060"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=281060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}