{"id":377171,"date":"2024-05-26T21:00:53","date_gmt":"2024-05-26T21:00:53","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=377171"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-26T21:00:53","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=377171","title":{"rendered":"<span>\u042f \u043d\u0430\u0443\u0447\u0443 \u0432\u0430\u0441 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438\u0433\u0440\u0430\u0442\u044c \u0432 Hearts of iron. \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u043e\u0432\u043e\u0435\u043d\u043d\u043e\u0439 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043a\u0438: \u0447\u0430\u0441\u0442\u044c 1<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u043b\u044e\u0434\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0433\u0440\u0430\u044e\u0442 \u0432 \u0438\u0433\u0440\u0443 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0443\u0434\u0435\u043b\u044f\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0432\u043e\u0435\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438, \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a! \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0438\u0433\u0440\u0430\u0442\u044c \u043c\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0438\u043c \u0432\u0441\u0435 \u0443\u0441\u0438\u043b\u0438\u044f \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0430. \u041e\u0441\u043d\u043e\u0432\u043e\u0439 \u0432\u0441\u0435\u0433\u043e \u0432 \u044d\u0442\u043e\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043a\u0430, \u043d\u0430 \u043d\u0435\u0451 \u043c\u044b \u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c. <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438\u0441\u044c \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u0430\u043c \u0432\u0430\u0436\u043d\u043e \u043e\u0441\u043e\u0437\u043d\u0430\u0442\u044c \u0447\u0442\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u043e \u0434\u0435\u043b\u043e \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0435 \u0438 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u043c\u044b \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0447\u0435\u0439 \u043b\u0438\u0431\u043e \u043e\u043f\u044b\u0442 \u0438\u043b\u0438 \u043c\u043d\u0435\u043d\u0438\u0435. \u041d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f! \u041a\u0440\u0430\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u044b\u043c \u043a\u0430\u043c\u043d\u0435\u043c \u0432 \u044d\u0442\u043e\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u041a\u0442\u043e-\u0442\u043e \u043c\u043e\u0433 \u0431\u044b \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u0447\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0432 \u0438\u0433\u0440\u0435, \u043d\u043e \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0443\u0439\u043c\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (\u0434\u0430 \u0438 \u043d\u0435 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u043c\u044b \u0441 \u0432\u0430\u043c\u0438 \u0437\u0434\u0435\u0441\u044c \u0441\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0447\u0442\u043e\u0431\u044b \u0438\u0433\u0440\u0430\u0442\u044c \u0432 \u0438\u0433\u0440\u0443). \u041d\u0435\u0442, \u043d\u0430\u0448 \u043f\u0443\u0442\u044c \u044f\u0441\u0435\u043d \u043a\u0430\u043a \u0434\u0435\u043d\u044c, \u044d\u0442\u043e \u043f\u0443\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438! <\/p>\n<p>\u0424\u043e\u0440\u043c\u0443\u043b\u044b \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0438\u0438\u0433\u0440\u043e\u0432\u0430\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043a\u0430 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0447\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u0443\u0434\u0430\u0447\u043d\u043e (\u0445\u043e\u0442\u044f \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044e \u0432\u0441\u0435 \u0442\u0430\u043a\u0438 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0438\u0433\u0440\u0435). \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043a\u043e\u0434 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432. \u0427\u0442\u043e \u0436\u0435, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0440\u0430\u0437\u0431\u043e\u0440\u0443 \u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u043a \u0438 \u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 python:<\/p>\n<h2>0. \u041e\u0431\u0449\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043e\u0431\u0449\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/Glasssparrow\/hoi4_economy\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>). \u041e\u0441\u043d\u043e\u0432\u0430 \u0432\u0441\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u044d\u0442\u043e \u0434\u0432\u0430 \u043a\u043b\u0430\u0441\u0441\u0430: Country \u0438 Region. \u042d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Country \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0435, \u0435\u0433\u043e \u0431\u043e\u043d\u0443\u0441\u0430\u0445 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u0430\u0431\u0440\u0438\u043a, \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b Region \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u0445 \u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u044f\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f (\u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0438\u043d\u0446\u0438\u044f \u043d\u0435 \u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f). \u041a\u043b\u0430\u0441\u0441\u044b Law, Order \u0438 Event \u043d\u043e\u0441\u044f\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. <\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043f\u043e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u0430\u043c.<\/summary>\n<div class=\"spoiler__content\">\n<p>\u042d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b Law \u0445\u0440\u0430\u043d\u044f\u0442 \u0431\u043e\u043d\u0443\u0441\u044b \u043e\u0442 \u0437\u0430\u043a\u043e\u043d\u043e\u0432 (\u043f\u0440\u0438\u0437\u044b\u0432, \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u044f, \u043c\u043e\u0431\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043a\u0438).<\/p>\n<p>Order \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430.<\/p>\n<p>Event \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 (\u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u0441\u0451 \u0442\u043e\u0433\u043e \u0436\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 Country.<\/p>\n<\/div>\n<\/details>\n<h2>1. \u0421\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e<\/h2>\n<p>\u0421\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u0441\u0442\u0440\u043e\u044f\u0442 \u043f\u043e 5 * \u0431\u043e\u043d\u0443\u0441_\u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0435\u0434\u0438\u043d\u0438\u0446 * \u0431\u043e\u043d\u0443\u0441_\u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b_\u0440\u0435\u0433\u0438\u043e\u043d\u0430, \u043d\u043e \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 15 \u0444\u0430\u0431\u0440\u0438\u043a \u043d\u0430 \u0440\u0435\u0433\u0438\u043e\u043d. \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0435\u043b \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0437\u0434\u0430\u043d\u0438\u0439. \u0412\u0441\u0451 \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0444\u0430\u0431\u0440\u0438\u043a \u043f\u043e 15 \u0448\u0442\u0443\u043a \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 Country<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">        while (                 free_factories > 0 and                 queue_position &lt; (len(self.queue)-1)         ):             queue_position += 1             if free_factories > 15:                 factories_for_region = 15                 free_factories += -15             else:                 factories_for_region = free_factories                 free_factories = 0             target_region_id = self.queue[queue_position].target_region_id             done = self.regions[target_region_id].construct(                 factories_for_region,                 self.queue[queue_position].building_type,                 civil_constr_bonus=civil_constr_bonus,                 mil_constr_bonus=mil_constr_bonus,                 inf_constr_bonus=inf_constr_bonus,             )<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u044f\u0447\u0435\u0435\u043a \u043f\u043e\u0434 \u0437\u0434\u0430\u043d\u0438\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 Region<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">    def construct(self, factories, type_of_building,                   civil_constr_bonus=0,                   mil_constr_bonus=0,                   inf_constr_bonus=0):         construction_complete = False         if self.is_on_construction_limit(type_of_building):             raise Exception(                 f\"\u041d\u0435\u043b\u044c\u0437\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 {type_of_building} \"                 f\"\u0432 \u0440\u0435\u0433\u0438\u043e\u043d\u0435 \"                 f\"{self.name}.\"             )         if type_of_building == MILITARY_BUILDING:             self.mil_constr_progress += (                 factories * FACTORY_OUTPUT *                 (INFRASTRUCTURE_BONUS * self.infrastructure + 1) *                 (mil_constr_bonus + 1)             )             if self.mil_constr_progress > MILITARY_FACTORY_COST:                 self.military_factories += 1                 self.mil_constr_progress -= MILITARY_FACTORY_COST                 construction_complete = True         elif type_of_building == CIVIL_BUILDING:             self.civil_constr_progress += (                     factories * FACTORY_OUTPUT *                     (INFRASTRUCTURE_BONUS * self.infrastructure + 1) *                     (civil_constr_bonus + 1)             )             if self.civil_constr_progress > FACTORY_COST:                 self.factories += 1                 self.civil_constr_progress -= FACTORY_COST                 construction_complete = True         elif type_of_building == INF_BUILDING:             self.inf_constr_progress += (                     factories * FACTORY_OUTPUT *                     (INFRASTRUCTURE_BONUS * self.infrastructure + 1) *                     (inf_constr_bonus + 1)             )             if self.inf_constr_progress > INFRASTRUCTURE_COST:                 self.infrastructure += 1                 self.inf_constr_progress -= INFRASTRUCTURE_COST                 construction_complete = True         else:             raise Exception(\"\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0442\u0438\u043f \u0437\u0434\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0439\u043a\u0438\")         return construction_complete<\/code><\/pre>\n<pre><code class=\"python\">    def is_on_construction_limit(self, type_of_building):         if (                 type_of_building == MILITARY_BUILDING or                 type_of_building == CIVIL_BUILDING         ):             if (                     (self.factories + self.military_factories +                      self.shipyards + self.fuel_silo + self.synth_oil                      ) >= self.factories_limit             ):                 return True             else:                 return False         elif type_of_building == INF_BUILDING:             if self.infrastructure >= self.infrastructure_limit:                 return True             else:                 return False         else:             raise Exception(                 f\"\u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u043b\u0438\u043c\u0438\u0442 \u0434\u043b\u044f \u0437\u0434\u0430\u043d\u0438\u044f \"                 f\"{type_of_building} \u0432 \u0440\u0435\u0433\u0438\u043e\u043d\u0435 \"                 f\"{self.name}\")<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>2. \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0444\u0430\u0431\u0440\u0438\u043a<\/h2>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0443\u043d\u043a\u0442 \u043f\u043b\u0430\u0432\u043d\u043e \u0432\u044b\u0442\u0435\u043a\u0430\u0435\u0442 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e. \u0412 hoi4 \u0435\u0441\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0430 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u043d\u0430\u0440\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u044f, \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043d\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u0442\u043e\u043c \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u0444\u0430\u0431\u0440\u0438\u043a \u0432\u0430\u043c \u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u0445 \u0444\u0430\u0431\u0440\u0438\u043a \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<p>\u0444\u0430\u0431\u0440\u0438\u043a\u0438_\u043d\u0430_\u0442\u043d\u043f = (\u0444\u0430\u0431\u0440\u0438\u043a\u0438+\u0444\u0430\u0431\u0440\u0438\u043a\u0438_\u043e\u0442_\u0442\u043e\u0440\u0433\u043e\u0432\u043b\u0438+\u0432\u043e\u0435\u043d\u043d\u044b\u0435_\u0437\u0430\u0432\u043e\u0434\u044b)*\u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442_\u0442\u043d\u043f<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u0432\u0441\u0451. \u0412\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u043d\u0435 \u0432\u0441\u0435 \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u0438 \u0437\u0430\u0432\u043e\u0434\u044b \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0432 \u043d\u0435 \u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0438\u043d\u0446\u0438\u044f\u0445. \u041f\u0440\u0438 \u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0441\u043a\u043e\u0439 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0434\u043e\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435:<\/p>\n<p>\u0434\u043e\u043b\u044f = 25% + 65%*\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c + 10%(\u0435\u0441\u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c>40%)<\/p>\n<details class=\"spoiler\">\n<summary>\u0420\u0430\u0441\u0447\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0444\u0430\u0431\u0440\u0438\u043a \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 Country<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">    def _calculate_factories(self):         civil_fact = 0         mil_fact = 0         shipyards = 0         for region in self.regions:             if self.tag in region.cores:                 civil_fact += region.factories                 mil_fact += region.military_factories                 shipyards += region.shipyards             else:                 civil_fact += (                     region.factories * region.get_compliance_modifier()                 )                 mil_fact += (                     region.military_factories *                    region.get_compliance_modifier()                 )                 shipyards += (                     region.shipyards * region.get_compliance_modifier()                 )         # \u041e\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u043c \u0432\u043d\u0438\u0437         civil_fact, mil_fact, shipyards = (             int(civil_fact), int(mil_fact), int(shipyards))         self.factories = civil_fact  # \u0412\u0441\u0435 \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0430         civil_fact += self.factories_from_trade  # \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u044e         self.consumer_goods = self._get_consumer_goods()         self.factories_for_consumers = floor(                 (civil_fact + mil_fact) * self._get_consumer_goods()         )         factories_available = (             civil_fact - self.factories_for_consumers         )         self.factories_total = civil_fact         self.factories = civil_fact - self.factories_from_trade         self.mil_factories = mil_fact         self.shipyards = shipyards         if factories_available > 0:             self.factories_available = round(factories_available, 0)         else:             self.factories_available = 0<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0420\u0430\u0441\u0447\u0435\u0442 \u0434\u043e\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u0444\u0430\u0431\u0440\u0438\u043a \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 Region<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">    def get_compliance_modifier(self):         # \u0414\u043b\u044f \u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0432. self.compliance = None         if not self.compliance:             raise Exception(                 \"\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0438.\"             )         industry_percent = self.compliance * 0.65 + 25         if self.compliance > 40:             industry_percent += 10         return industry_percent\/100    <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>3. \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0435 \u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0439<\/h2>\n<p>\u041c\u044b \u043e\u0431\u0441\u0443\u0434\u0438\u043b\u0438 \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0435 \u0444\u0430\u0431\u0440\u0438\u043a\u0438, \u043d\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u044d\u0442\u043e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u043d\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430\u044f. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043f\u043e \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435:<\/p>\n<p>\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435_\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f = 0.075 * (1+\u0431\u043e\u043d\u0443\u0441_\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f) &#8212; \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c * 0.00083<\/p>\n<p>\u0411\u043e\u043d\u0443\u0441\u044b \u043a \u0440\u043e\u0441\u0442\u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432 \u0446\u0435\u043b\u043e\u043c \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0447\u0430\u0441\u0442\u043e, \u043d\u043e \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a: \u0432 \u043c\u0438\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u0441\u0435 \u0441\u0442\u0440\u0430\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 +10% \u043a \u0440\u043e\u0441\u0442\u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f.<\/p>\n<details class=\"spoiler\">\n<summary>\u0420\u0430\u0441\u0447\u0435\u0442 \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f (\u043c\u0435\u0442\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430 Region)<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">    def calculate_day(self, compliance_modifier):         if self.compliance:  # \u0414\u043b\u044f \u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0432. self.compliance = None             grow = (1+compliance_modifier) * 0.075             decay = self.compliance * 0.00083             self.compliance += grow - decay         else:             raise Exception(                 \"\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0440\u043e\u0441\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432 \u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0438\u043d\u0446\u0438\u0438.\"             )<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>4. \u0423\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u044f\u0447\u0435\u0435\u043a \u0437\u0434\u0430\u043d\u0438\u0439<\/h2>\n<p>\u0412 \u043f\u0443\u043d\u043a\u0442\u0435 1 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u043e \u0442\u043e\u043c \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0434\u0430\u043d\u0438\u0439 \u0432 \u043f\u0440\u043e\u0432\u0438\u043d\u0446\u0438\u0438. \u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044f\u0447\u0435\u0435\u043a: \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430 100 \u043f\u043e\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u043b\u0430\u0441\u0442\u0438 \u0438 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u041f\u0435\u0440\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043a\u043e\u0440\u0435\u0435 \u0432 \u043f\u043e\u0437\u0434\u043d\u0435\u0439 \u0438\u0433\u0440\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u0441\u043e\u0432\u0435\u0442\u043d\u0438\u043a\u0438 \u0443\u0436\u0435 \u0432\u044b\u0431\u0440\u0430\u043d\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u043c. \u0410 \u0432\u043e\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0430\u043c \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u0435\u043d. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u043d\u0430\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430:<\/p>\n<p>\u043d\u043e\u0432\u044b\u0439_\u043b\u0438\u043c\u0438\u0442 = \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439_\u043b\u0438\u043c\u0438\u0442*\u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440_\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438<\/p>\n<p>\u041e\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0434\u0435\u043b\u043e \u0432\u043d\u0438\u0437 (\u043a\u0430\u043a \u0432\u043f\u0440\u043e\u0447\u0435\u043c \u0438 \u0432\u0441\u0451 \u0432 hearts of iron 4).<\/p>\n<details class=\"spoiler\">\n<summary>\u0420\u0430\u0441\u0447\u0435\u0442 \u043d\u043e\u0432\u043e\u0433\u043e \u043b\u0438\u043c\u0438\u0442\u0430 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 Region<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">    def _recalculate_available_slots(self):         self.available_for_construction = (                 self.factories_limit                 - self.factories                 - self.military_factories                 - self.shipyards                 - self.fuel_silo                 - self.synth_oil         )         self.available_for_queue = (                 self.available_for_construction                 - self.slot_for_queue         )         self.available_for_infrastructure = (             self.infrastructure             - self.infrastructure_queue_slots         )         self.available_for_infrastructure_queue = (             self.available_for_infrastructure             - self.infrastructure_queue_slots         )<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041c\u0435\u0442\u043e\u0434 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 Country<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">    def upgrade_industry_tech(self):         if self.industry_tech >= 5:             raise Exception(\"\u041b\u0438\u043c\u0438\u0442 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 5 \u0443\u0440\u043e\u0432\u0435\u043d\u044c\")         elif self._distributed_industry:             self.mil_output_bonus += 0.1         else:             self.mil_output_bonus += 0.15         self.industry_tech += 1         self.factory_limit_bonus += 0.2         for region in self.regions:             region.recalculate_factories_limit(self.factory_limit_bonus)<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>\u0417\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0438\u0435 \u0441\u043b\u043e\u0432\u0430 \u043e \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043a\u0438<\/h2>\n<p>\u0412 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u0438 4 \u0432\u0435\u0449\u0438 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0432\u0441\u044e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043a\u0443 hoi4. \u041e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u0432\u0435\u0449\u0438 \u044d\u0442\u043e \u043b\u0438\u0440\u0438\u043a\u0430 (\u043f\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043b\u0438\u0448\u044c \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 4 \u043f\u0443\u043d\u043a\u0442\u043e\u0432), \u043f\u043e\u043b\u0430\u0433\u0430\u044e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0441\u043e\u0431\u043e \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0430 \u043d\u0438\u0445 \u0432\u0440\u0435\u043c\u044f. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043f\u0430\u0440\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u043a\u043e\u0434\u0430.<\/p>\n<p>\u041d\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u0442\u0430\u043f\u0430\u0445 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0432\u044b\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 \u0441 \u0432\u043d\u0443\u0442\u0440\u0438\u0438\u0433\u0440\u043e\u0432\u044b\u043c\u0438. \u0418\u0441\u043f\u044b\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u043c \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u043e\u043c \u0431\u044b\u043b\u0430 \u0424\u0440\u0430\u043d\u0446\u0438\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0432\u0448\u0430\u044f \u0441\u0432\u043e\u0438 \u043a\u043e\u043b\u043e\u043d\u0438\u0438 (\u0442.\u043a.\u0444\u0430\u0431\u0440\u0438\u043a \u0442\u0430\u043c \u043f\u043e\u0447\u0442\u0438 \u043d\u0435\u0442, \u0430 \u0440\u0435\u0433\u0438\u043e\u043d\u044b \u043d\u0430 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e).<\/p>\n<details class=\"spoiler\">\n<summary>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u0441 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u043c\u0438)<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u044b\u0434\u0430\u0435\u0442 2092 \u0438 5455 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u043d\u0430 1 \u044f\u043d\u0432\u0430\u0440\u044f 1937 \u0433\u043e\u0434\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f46\/c1c\/24d\/f46c1c24d72de2bd718a882efbde2760.png\" width=\"1919\" height=\"1079\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f46\/c1c\/24d\/f46c1c24d72de2bd718a882efbde2760.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b37\/19b\/274\/b3719b27401800eb4f8727d8da1ee9a8.png\" width=\"1919\" height=\"1079\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b37\/19b\/274\/b3719b27401800eb4f8727d8da1ee9a8.png\"\/><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041d\u043e \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u044d\u0442\u043e \u0432\u0441\u0451 \u043d\u0435 \u0440\u0443\u0447\u043d\u044b\u043c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u0442\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0430\u0441\u044c \u043d\u0435 \u043e\u0434\u043d\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">class DayAfterDayFrance:     name = \"\u0414\u0435\u043d\u044c \u0437\u0430 \u0434\u043d\u0435\u043c \u0424\u0440\u0430\u043d\u0446\u0443\u0437\u0441\u043a\u0438\u0439\"      def __init__(self):         self.country = get_france_for_tests_2_and_3()         self.country.move_trade(+1)         self.country.move_trade(+1)         self.factories365 = 32         self.days = {             0: (0, 0, 0,),  # \u0441\u0442\u0430\u0440\u0442             1: (94, 12, 0,),             2: (189, 25, 0,),             3: (283, 37, 0,),             4: (378, 50, 0),             5: (472, 63, 0),             6: (567, 75, 0),             7: (661, 88, 0),  # \u0441\u043c\u043e\u0442\u0440\u0438\u043c 1 \u043d\u0435\u0434\u0435\u043b\u044e             31: (2929, 390, 0),  # 1 \u0444\u0435\u0432\u0440\u0430\u043b\u044f             59: (5575, 743, 0),  # 1 \u043c\u0430\u0440\u0442\u0430             90: (8505, 1134, 0),  # 1 \u0430\u043f\u0440\u0435\u043b\u044f             120: (540, 1512, 0),  # 1 \u043c\u0430\u044f             151: (3469, 1902, 0),  # 1 \u0438\u044e\u043d\u044f             181: (6304, 2280, 0),  # 1 \u0438\u044e\u043b\u044f             212: (9234, 2671, 0),  # 1 \u0430\u0432\u0433\u0443\u0441\u0442\u0430             243: (1363, 3150, 0),  # 1 \u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f             273: (4198, 3717, 0),  # 1 \u043e\u043a\u0442\u044f\u0431\u0440\u044f             304: (7128, 4302, 0),  # 1 \u043d\u043e\u044f\u0431\u0440\u044f             334: (9963, 4869, 0),  # 1 \u0434\u0435\u043a\u0430\u0431\u0440\u044f             337: (10246, 4926, 0),  # 4 \u0434\u0435\u043a\u0430\u0431\u0440\u044f             339: (10435, 4964, 0),  # 6 \u0434\u0435\u043a\u0430\u0431\u0440\u044f             341: (10624, 5002, 0),  # 8 \u0434\u0435\u043a\u0430\u0431\u0440\u044f             343: (13, 5040, 0),  # 10 \u0434\u0435\u043a\u0430\u0431\u0440\u044f             353: (958, 5229, 0),  # 20 \u0434\u0435\u043a\u0430\u0431\u0440\u044f             365: (2092, 5455, 0),  # 1 \u044f\u043d\u0432\u0430\u0440\u044f             730: (0, 0, 8643)  # 1 \u044f\u043d\u0432\u0430\u0440\u044f         }      def check(self, text=False):         region_ids = [8, 10, 5]         regions = self.country.regions         no_problems = True         for day in range(731):             if day in self.days.keys():                 no_problem_in_the_day = True                 for x in range(3):                     # floor \u043d\u0435 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439, \u043e\u043d \u0441\u043f\u0435\u0440\u0432\u0430 \u043e\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u0442 \u0434\u043e 3 \u0437\u043d\u0430\u043a\u0430 \u043f\u043e\u0441\u043b\u0435 \",\"                     if (                         floor(regions[region_ids[x]].civil_constr_progress)                         != self.days[day][x] and                         self.days[day][x] != 0                     ):                         no_problems = False                         no_problem_in_the_day = False                 if not no_problem_in_the_day:                     for_print = []                     for i in region_ids:                         for_print.append(floor(                             regions[i].civil_constr_progress)                         )                     if text:                         print(                             f\"\u0414\u0435\u043d\u044c {day} \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442. \"                             f\"\u041e\u0436\u0438\u0434\u0430\u0435\u043c\/\u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 [{self.days[day][0]}, \"                             f\"{self.days[day][1]}, \"                             f\"{self.days[day][2]}]\/\"                             f\"{for_print}. \"                         )             self.country.calculate_day(day)         return no_problems<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u044f \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u043b \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u043c, \u043d\u043e \u0442\u0443\u0442 \u0443\u0436\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u043d\u0435 \u0441\u0442\u0430\u043b, \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u043b \u043f\u0430\u0440\u0443 \u0434\u0430\u0442 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u0441 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u043c\u0438)<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041e\u0436\u0438\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0441 77.60% \u043d\u0430 77.70% \u0441 1 \u043d\u0430 2 \u044f\u043d\u0432\u0430\u0440\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f62\/50c\/3cb\/f6250c3cbb450391fee0a4ddd328fe87.png\" width=\"1917\" height=\"1079\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f62\/50c\/3cb\/f6250c3cbb450391fee0a4ddd328fe87.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c77\/762\/945\/c77762945735dc7a058857a351e09d61.png\" width=\"1919\" height=\"1079\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c77\/762\/945\/c77762945735dc7a058857a351e09d61.png\"\/><\/figure>\n<p>\u0427\u0442\u043e \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c.<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 \u0442\u0435\u0441\u0442\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">class ComplianceTest:     name = \"\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f (\u0424\u0440\u0430\u043d\u0446\u0438\u044f)\"      def __init__(self):         data = get_data()         self.country = get_country(data=data, name_or_tag=\"FRA\", by_tag=True)         self.data = {             364: 77.6,             365: 77.7,         }         self.result = {}      def check(self, text=False):         successful = True         for day in range(367):             self.country.calculate_day(day=day)             target_region = None             for region in self.country.non_core_regions:                 if region.global_id == 781:                     target_region = region             compliance = floor(target_region.compliance*10)\/10             if day in self.data.keys():                 self.result[day] = compliance                 if self.data[day] != compliance:                     successful = False         if (             successful         ):             return True         else:             if text:                 print(                     f\"\u0426\u0435\u043b\u0435\u0432\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 {self.data}\\n\"                     f\"\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 - {self.result}\"                 )             return False<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>\u041e\u0442\u043a\u0443\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u044f \u043d\u0435 \u0432\u0432\u043e\u0434\u0438\u043b \u0432\u0440\u0443\u0447\u043d\u0443\u044e (\u043a\u0440\u043e\u043c\u0435 \u043f\u0430\u0440\u043e\u0447\u043a\u0438 \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u043d\u043d\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432). \u0414\u0430\u043d\u043d\u044b\u0435 \u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u0445 \u0432\u0437\u044f\u0442\u044b \u0438\u0437 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u0433\u0440\u044b (\/history\/states\/). \u041d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0433\u0438\u043e\u043d\u043e\u0432 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0432 \u0438\u0433\u0440\u0435 (\u0430 \u0432 \u0434\u0430\u043d\u043d\u044b\u0435 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043d\u0435 \u043b\u0435\u0437\u0442\u044c \u043b\u0435\u043d\u044c), \u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u0440\u0435\u0433\u0438\u043e\u043d \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0430 \u043d\u0430\u0437\u0432\u0430\u043d \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u043e. \u0414\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e \u0432 \u0444\u0430\u0439\u043b .json, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<details class=\"spoiler\">\n<summary>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434 \u0447\u0442\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u0433\u0440\u044b<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">from os import path, listdir from ast import literal_eval from constants_and_settings.constants import PATH_TO_PROVINCES, GAME_DATA_FILE_TYPE   def is_text(letter):     if letter.isalpha():         return True     elif letter == \"_\":         return True     else:         return False   # noinspection PyTypeChecker def add_quotes(string, maximum_phrases=20):     \"\"\"\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0443, \u0447\u0442\u043e\u0431\u044b python \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043b \u0435\u0433\u043e.\"\"\"     # \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f dlc     string = string.replace(         \"Arms Against Tyranny\",         \"Arms_Against_Tyranny\",     )     text = []     for x in range(maximum_phrases):         text.append([None, None])     # \u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0444\u0440\u0430\u0437\u044b     for x in range(len(string)-1):         # \u0418\u0437\u0431\u0435\u0433\u0430\u043d\u0438\u0435 \u043a\u0430\u0432\u044b\u0447\u0435\u043a \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e,         # \u0447\u0442\u043e\u0431\u044b \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441 \u043d\u043e\u043c\u0435\u0440\u043e\u043c.         if (             (not is_text(string[x]) and not string[x].isdigit())             and is_text(string[x+1])             and string[x] != '\"' and string[x+1] != '\"'         ):             for y in range(maximum_phrases):                 if not text[y][0] is None:                     continue                 text[y][0] = x+1                 break         if (             is_text(string[x]) and             (not is_text(string[x+1]) and not string[x+1].isdigit())             and string[x] != '\"' and string[x+1] != '\"'         ):             for y in range(maximum_phrases):                 if text[y][1]:                     continue                 text[y][1] = x+1                 break     # \u0411\u0435\u0440\u0435\u043c \u0432 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0444\u0440\u0430\u0437\u044b.     for phrase in reversed(text):         if phrase[0] and phrase[1]:             string = (                     string[:phrase[0]] + '\"' +                     string[phrase[0]:phrase[1]] + '\"' +                     string[phrase[1]:]             )     return string   def separate_numbers(string, max_spaces=6):     \"\"\"\u0420\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c \u0447\u0438\u0441\u043b\u0430 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0447\u0438\u0441\u043b\u043e \u0441\u0442\u0440\u043e\u043a\u0430, \u0442\u043e\u0436\u0435.     \u041b\u0438\u043a\u0432\u0438\u0434\u0438\u0440\u0443\u0435\u043c \u0432\u0441\u0435 \u0434\u0430\u0442\u044b.\"\"\"     for x in range(len(string)-2):         if (             string[x].isdigit() and             string[x+1] == \" \" and             string[x+2].isalpha()         ):             string = string[:x+1] + \",\" + string[x+2:]         # \u0422\u0430\u0431\u0443\u043b\u044f\u0446\u0438\u044e \u0442\u043e\u0436\u0435 \u0443\u0431\u0438\u0440\u0430\u0435\u043c         if (             string[x].isdigit() and             string[x+1] == \"\\t\" and             string[x+2].isdigit()         ):             string = string[:x+1] + \",\" + string[x+2:]     for y in range(max_spaces):         for x in range(len(string) - 2 - y):             if (                 string[x].isdigit() and                 string[x+1:x+y+2] == \" \"*(y+1) and                 string[x+2+y].isdigit()             ):                 string = string[:x+1] + \",\" + \" \"*y + string[x+2:]     return string   def create_provinces_file(tags):     provinces_dict = {}  # \u0421\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438     files_list = listdir(PATH_TO_PROVINCES)  # \u0421\u043f\u0438\u0441\u043e\u043a \u043f\u0443\u0442\u0435\u0439 \u043a \u0444\u0430\u0439\u043b\u0430\u043c     provinces_list = []  # \u0421\u043f\u0438\u0441\u043e\u043a \u043f\u0443\u0442\u0435\u0439 \u043a \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c     # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0443\u0442\u0435\u0439 \u043a \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c     for file in files_list:         if file[-len(GAME_DATA_FILE_TYPE):] == GAME_DATA_FILE_TYPE:             provinces_list.append(path.join(PATH_TO_PROVINCES, file))     # \u0426\u0438\u043a\u043b \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0441 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438     for file in provinces_list:         full_file_name = path.basename(file)  # \u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c         file_name = full_file_name[             :-len(full_file_name.split(\".\")[-1])-1  # -1 \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0442\u043e\u0447\u043a\u0438                     ]  # \u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430         province_number = int(file_name.split(\"-\")[0])  # \u041d\u043e\u043c\u0435\u0440 \u043f\u0440\u043e\u0432\u0438\u043d\u0446\u0438\u0438 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443         province_name = file_name[                         len(file_name.split(\"-\")[0]) + 1:  # +1 \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \"-\"                         ]  # \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0438\u043d\u0446\u0438\u0438         province_name = province_name.replace(\"-\", \"_\")         province_name = province_name.lower()         province_name = province_name.strip()  # \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0441 \u043a\u0440\u0430\u0435\u0432          with open(file) as link_to_the_file:  # \u0427\u0438\u0442\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435             raw_string = link_to_the_file.read()  # \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u044b\u0440\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445         # \u0423\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0435\u043c \u0432\u0441\u0435 \u0434\u0430\u0442\u044b         for year in range(36, 51):             for month in range(1, 13):                 raw_string = raw_string.replace(                     f\"{year}.{month}.\",                     \"\",                 )         # \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 \u0447\u0438\u0441\u0435\u043b \u044d\u0442\u043e \u0435\u0440\u0435\u0441\u044c.         # \u0421\u0443\u0434\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u0447\u0438\u0441\u043b\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u044d\u0442\u043e \u0434\u0430\u0442\u0430, \u0438\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435.         raw_string = raw_string.replace(             \"843.ETH_state_development_production_speed\",             \"Why_variable_starts_with_a_number\",         )         raw_string = raw_string.replace(             \"908.ETH_state_development_production_speed\",             \"Another_one\"         )         raw_list = raw_string.split(\"\\n\")  # \u0414\u0435\u043b\u0438\u043c \u0442\u0435\u043a\u0441\u0442 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c         new_list = []  # \u0411\u0443\u0434\u0443\u0449\u0438\u0439 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043b\u0438\u0441\u0442 \u0441 \u0444\u0430\u0439\u043b\u043e\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e         # \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438         for element_number in reversed(range(len(raw_list))):             if not raw_list[element_number]:                 raw_list.pop(element_number)         raw_list[0] = raw_list[0].split(\"=\")[1]  # \u0423\u0434\u0430\u043b\u044f\u0435\u043c \"state=\"          # \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0432 python \u043a\u043e\u0434         for old_line in raw_list:             if \"#\" in old_line:                 line = old_line.split(\"#\")[0]  # \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438             else:                 line = old_line             # \u0417\u0430\u043c\u0435\u043d\u044f\u0435\u043c \"=\" \u043d\u0430 \":\" \u0442.\u043a. \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044c             new_line = line.replace(\"=\", \":\")             # \u0417\u0430\u043f\u044f\u0442\u044b\u0435 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0440\u043e\u043a\u0438             if (                 \":\" in new_line and                 new_line[-1] != \":\" and                 not (\"{\" in new_line and \"}\" not in new_line)                 or \"}\" in new_line             ):                 new_line = new_line + \",\"             new_line = separate_numbers(new_line)  # \u0420\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c \u0447\u0438\u0441\u043b\u0430 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438             new_line = add_quotes(new_line)  # \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0432\u043e\u0438 \u043a\u0430\u0432\u044b\u0447\u043a\u0438             new_list.append(new_line)  # \u0414\u043b\u044f \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043b\u0438\u0441\u0442\u0430         # \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0442\u0435\u043a\u0441\u0442         new_text = \"\"         for line in new_list:             new_text = f\"{new_text}{line}\\n\"         data_dict = literal_eval(new_text)[0]          # \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043d\u0430\u0448 \u0441\u043b\u043e\u0432\u0430\u0440\u044c         provinces_dict[province_number] = {}  # \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0438\u043d\u0446\u0438\u0438         # \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0431\u0435\u0440\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u043b\u043e\u0432\u0430\u0440\u0438         prov = provinces_dict[province_number]         history = data_dict.get(\"history\", {})         buildings = history.get(\"buildings\", {})         # \u0427\u0438\u0442\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435         prov[\"name\"] = province_name.replace(\" \", \"_\")  # \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043c\u044f         prov[\"owner\"] = history[\"owner\"].lower()         prov[\"cores\"] = []         for line in new_list:             for tag in tags:                 if \"add_core_of\" in line and tag in line:                     prov[\"cores\"].append(tag.lower())         prov[\"infrastructure\"] = buildings.get(\"infrastructure\", 0)         prov[\"factories\"] = buildings.get(\"industrial_complex\", 0)         prov[\"military_factories\"] = buildings.get(\"arms_factory\", 0)         prov[\"shipyards\"] = buildings.get(\"dockyard\", 0)         prov[\"fuel_silo\"] = buildings.get(\"fuel_silo\", 0)         prov[\"anti_air\"] = buildings.get(\"anti_air_building\", 0)         prov[\"air_base\"] = buildings.get(\"air_base\", 0)         prov[\"radar\"] = buildings.get(\"radar_station\", 0)         prov[\"synth_oil\"] = buildings.get(\"synthetic_refinery\", 0)         # \u0421\u043f\u0438\u0441\u043e\u043a \u0442\u0438\u043f\u043e\u0432 \u0440\u0435\u0433\u0438\u043e\u043d\u043e\u0432 \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0430\u043c\u0438 \u0441\u043b\u043e\u0442\u043e\u0432         lands = {             \"wasteland\": 0,             \"enclave\": 0,             \"tiny_island\": 0,             \"pastoral\": 1,             \"small_island\": 1,             \"rural\": 2,             \"town\": 4,             \"large_town\": 5,             \"city\": 6,             \"large_city\": 8,             \"metropolis\": 10,             \"megalopolis\": 12,         }         for k, v in lands.items():  # \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0441\u043b\u043e\u0442\u043e\u0432             if data_dict[\"state_category\"] == k:                 prov[\"max_factories\"] = v     return provinces_dict<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0432\u0441\u0435\u0445 \u0442\u0435\u0433\u043e\u0432 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 json<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">from os import path, listdir from constants_and_settings.constants import PATH_TO_PROVINCES, GAME_DATA_FILE_TYPE   def create_tags_file():     files_list = listdir(PATH_TO_PROVINCES)  # \u0421\u043f\u0438\u0441\u043e\u043a \u043f\u0443\u0442\u0435\u0439 \u043a \u0444\u0430\u0439\u043b\u0430\u043c     provinces_list = []  # \u0421\u043f\u0438\u0441\u043e\u043a \u043f\u0443\u0442\u0435\u0439 \u043a \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c     # \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0443\u0442\u0435\u0439 \u043a \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c     for file in files_list:         if file[-len(GAME_DATA_FILE_TYPE):] == GAME_DATA_FILE_TYPE:             provinces_list.append(path.join(PATH_TO_PROVINCES, file))     # \u041b\u0438\u0441\u0442 \u0441 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043a\u043e\u0434\u0430\u043c\u0438 \u0441\u0442\u0440\u0430\u043d     tags = []     # \u0426\u0438\u043a\u043b \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0441 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438     for file in provinces_list:         with open(file) as link_to_the_file:  # \u0427\u0438\u0442\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435             raw_string = link_to_the_file.read()  # \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u044b\u0440\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445         raw_list = raw_string.split(\"\\n\")  # \u0414\u0435\u043b\u0438\u043c \u0442\u0435\u043a\u0441\u0442 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c         # \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438         for element_number in reversed(range(len(raw_list))):             if not raw_list[element_number]:                 raw_list.pop(element_number)         for line in raw_list:             if \"add_core_of\" in line:                 core = line.split(\"=\")[1]                 if \"#\" in core:                     core = core.split(\"#\")[0]                 core = core.strip()                 if core not in tags:                     tags.append(core)     return tags<\/code><\/pre>\n<pre><code class=\"python\">from read_game_data.create_tags_file import create_tags_file from read_game_data.create_provinces_file import create_provinces_file from json import dump   tags = create_tags_file() with open(\"tags.txt\", \"w\") as json_file:     dump(tags, json_file) provinces_dict = create_provinces_file(tags) with open(\"provinces.txt\", \"w\") as json_file:     dump(provinces_dict, json_file)<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430\u0448\u0438\u0445 \u0442\u0435\u043e\u0440\u0438\u0439, \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e. \u0425\u043e\u0442\u044f, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0435 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u0435\u0442 (\u043d\u0435 \u0442\u043e \u0447\u0442\u043e\u0431\u044b \u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043d\u0430\u0434 \u043d\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0442\u0430\u043a \u0447\u0442\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e&#8230;). \u0420\u0430\u0441\u0447\u0435\u0442 2 \u043b\u0435\u0442 \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u0434\u043e 100 \u043c\u0441, \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0438 \u043e\u0434\u043d\u043e\u043c \u0440\u0430\u0441\u0447\u0435\u0442\u0435, \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0435\u0433\u0440\u0430\u0434\u043e\u0439 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432. \u041d\u043e \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0438\u0447\u0443\u0442\u044c \u043d\u0435 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0442 \u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435 \u0441\u0442\u0430\u0442\u044c\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0443\u043d\u044b\u0432\u0430\u0442\u044c!<\/p>\n<h2>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u0438 \u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c<\/h2>\n<p>\u0412\u044b\u0440\u0430\u0436\u0430\u044e \u043e\u0441\u043e\u0431\u0443\u044e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e pokewars (\u043a\u0435\u043c \u0431\u044b \u043e\u043d \u043d\u0438 \u0431\u044b\u043b) \u0438\u0437 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u043e\u0440\u0434 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 hoi4. \u0415\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u044b \u0432 \u043a\u0430\u043d\u0430\u043b\u0435 modding \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043c\u043e\u0433\u043b\u0438 \u043c\u043d\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0430\u0445, \u0441\u0430\u043c \u044f \u0442\u043e\u0442 \u0435\u0449\u0435 \u0437\u043d\u0430\u0442\u043e\u043a hoi.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 \u0437\u043d\u0430\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430 \u043a\u0440\u0438\u0442\u0438\u043a\u0430 (\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0441\u043e\u0446 \u0441\u0435\u0442\u0438) \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043c\u0435\u043b\u043e \u043a\u0440\u0438\u0442\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0441\u0430\u043c\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u0442\u0430\u043a \u0438 \u043a\u043e\u0434. \u0412 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u044e \u0431\u043e\u0433\u0430\u0442\u044b\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u043d\u0438 \u0432 \u0442\u043e\u0439, \u043d\u0438 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 (\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438 \u0432 \u044d\u0442\u043e\u0439 \u0442\u043e\u0436\u0435 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u043b\u044e).<\/p>\n<h2>\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p><a href=\"https:\/\/github.com\/Glasssparrow\/hoi4_economy\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439.<\/a><\/p>\n<p><a href=\"https:\/\/dicord.gg\/fPXrnT9p8F\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \u0434\u0438\u0441\u043a\u043e\u0440\u0434\u0435 (\u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439).<\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/817161\/\"> https:\/\/habr.com\/ru\/articles\/817161\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u043b\u044e\u0434\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0433\u0440\u0430\u044e\u0442 \u0432 \u0438\u0433\u0440\u0443 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0443\u0434\u0435\u043b\u044f\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0432\u043e\u0435\u0439 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438, \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a! \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0438\u0433\u0440\u0430\u0442\u044c \u043c\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0438\u043c \u0432\u0441\u0435 \u0443\u0441\u0438\u043b\u0438\u044f \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0430. \u041e\u0441\u043d\u043e\u0432\u043e\u0439 \u0432\u0441\u0435\u0433\u043e \u0432 \u044d\u0442\u043e\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043a\u0430, \u043d\u0430 \u043d\u0435\u0451 \u043c\u044b \u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c. <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438\u0441\u044c \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u0430\u043c \u0432\u0430\u0436\u043d\u043e \u043e\u0441\u043e\u0437\u043d\u0430\u0442\u044c \u0447\u0442\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u043e \u0434\u0435\u043b\u043e \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0435 \u0438 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u043c\u044b \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0447\u0435\u0439 \u043b\u0438\u0431\u043e \u043e\u043f\u044b\u0442 \u0438\u043b\u0438 \u043c\u043d\u0435\u043d\u0438\u0435. \u041d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f! \u041a\u0440\u0430\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u044b\u043c \u043a\u0430\u043c\u043d\u0435\u043c \u0432 \u044d\u0442\u043e\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u041a\u0442\u043e-\u0442\u043e \u043c\u043e\u0433 \u0431\u044b \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u0447\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0432 \u0438\u0433\u0440\u0435, \u043d\u043e \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0443\u0439\u043c\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (\u0434\u0430 \u0438 \u043d\u0435 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u043c\u044b \u0441 \u0432\u0430\u043c\u0438 \u0437\u0434\u0435\u0441\u044c \u0441\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0447\u0442\u043e\u0431\u044b \u0438\u0433\u0440\u0430\u0442\u044c \u0432 \u0438\u0433\u0440\u0443). \u041d\u0435\u0442, \u043d\u0430\u0448 \u043f\u0443\u0442\u044c \u044f\u0441\u0435\u043d \u043a\u0430\u043a \u0434\u0435\u043d\u044c, \u044d\u0442\u043e \u043f\u0443\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438! <\/p>\n<p>\u0424\u043e\u0440\u043c\u0443\u043b\u044b \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0438\u0438\u0433\u0440\u043e\u0432\u0430\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043a\u0430 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0447\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u0443\u0434\u0430\u0447\u043d\u043e (\u0445\u043e\u0442\u044f \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044e \u0432\u0441\u0435 \u0442\u0430\u043a\u0438 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0438\u0433\u0440\u0435). \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043a\u043e\u0434 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432. \u0427\u0442\u043e \u0436\u0435, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0440\u0430\u0437\u0431\u043e\u0440\u0443 \u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u043a \u0438 \u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 python:<\/p>\n<h2>0. \u041e\u0431\u0449\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043e\u0431\u0449\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/Glasssparrow\/hoi4_economy\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>). \u041e\u0441\u043d\u043e\u0432\u0430 \u0432\u0441\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u044d\u0442\u043e \u0434\u0432\u0430 \u043a\u043b\u0430\u0441\u0441\u0430: Country \u0438 Region. \u042d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Country \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0435, \u0435\u0433\u043e \u0431\u043e\u043d\u0443\u0441\u0430\u0445 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u0430\u0431\u0440\u0438\u043a, \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b Region \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u0445 \u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u044f\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f (\u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0438\u043d\u0446\u0438\u044f \u043d\u0435 \u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f). \u041a\u043b\u0430\u0441\u0441\u044b Law, Order \u0438 Event \u043d\u043e\u0441\u044f\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. <\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043f\u043e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u0430\u043c.<\/summary>\n<div class=\"spoiler__content\">\n<p>\u042d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b Law \u0445\u0440\u0430\u043d\u044f\u0442 \u0431\u043e\u043d\u0443\u0441\u044b \u043e\u0442 \u0437\u0430\u043a\u043e\u043d\u043e\u0432 (\u043f\u0440\u0438\u0437\u044b\u0432, \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u044f, \u043c\u043e\u0431\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043a\u0438).<\/p>\n<p>Order \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430.<\/p>\n<p>Event \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 (\u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u0441\u0451 \u0442\u043e\u0433\u043e \u0436\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 Country.<\/p>\n<\/div>\n<\/details>\n<h2>1. \u0421\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e<\/h2>\n<p>\u0421\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u0441\u0442\u0440\u043e\u044f\u0442 \u043f\u043e 5 * \u0431\u043e\u043d\u0443\u0441_\u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0435\u0434\u0438\u043d\u0438\u0446 * \u0431\u043e\u043d\u0443\u0441_\u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b_\u0440\u0435\u0433\u0438\u043e\u043d\u0430, \u043d\u043e \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 15 \u0444\u0430\u0431\u0440\u0438\u043a \u043d\u0430 \u0440\u0435\u0433\u0438\u043e\u043d. \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0435\u043b \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0437\u0434\u0430\u043d\u0438\u0439. \u0412\u0441\u0451 \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0444\u0430\u0431\u0440\u0438\u043a \u043f\u043e 15 \u0448\u0442\u0443\u043a \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 Country<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">        while (                 free_factories > 0 and                 queue_position &lt; (len(self.queue)-1)         ):             queue_position += 1             if free_factories > 15:                 factories_for_region = 15                 free_factories += -15             else:                 factories_for_region = free_factories                 free_factories = 0             target_region_id = self.queue[queue_position].target_region_id             done = self.regions[target_region_id].construct(                 factories_for_region,                 self.queue[queue_position].building_type,                 civil_constr_bonus=civil_constr_bonus,                 mil_constr_bonus=mil_constr_bonus,                 inf_constr_bonus=inf_constr_bonus,             )<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u044f\u0447\u0435\u0435\u043a \u043f\u043e\u0434 \u0437\u0434\u0430\u043d\u0438\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 Region<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">    def construct(self, factories, type_of_building,                   civil_constr_bonus=0,                   mil_constr_bonus=0,                   inf_constr_bonus=0):         construction_complete = False         if self.is_on_construction_limit(type_of_building):             raise Exception(                 f\"\u041d\u0435\u043b\u044c\u0437\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 {type_of_building} \"                 f\"\u0432 \u0440\u0435\u0433\u0438\u043e\u043d\u0435 \"                 f\"{self.name}.\"             )         if type_of_building == MILITARY_BUILDING:             self.mil_constr_progress += (                 factories * FACTORY_OUTPUT *                 (INFRASTRUCTURE_BONUS * self.infrastructure + 1) *                 (mil_constr_bonus + 1)             )             if self.mil_constr_progress > MILITARY_FACTORY_COST:                 self.military_factories += 1                 self.mil_constr_progress -= MILITARY_FACTORY_COST                 construction_complete = True         elif type_of_building == CIVIL_BUILDING:             self.civil_constr_progress += (                     factories * FACTORY_OUTPUT *                     (INFRASTRUCTURE_BONUS * self.infrastructure + 1) *                     (civil_constr_bonus + 1)             )             if self.civil_constr_progress > FACTORY_COST:                 self.factories += 1                 self.civil_constr_progress -= FACTORY_COST                 construction_complete = True         elif type_of_building == INF_BUILDING:             self.inf_constr_progress += (                     factories * FACTORY_OUTPUT *                     (INFRASTRUCTURE_BONUS * self.infrastructure + 1) *                     (inf_constr_bonus + 1)             )             if self.inf_constr_progress > INFRASTRUCTURE_COST:                 self.infrastructure += 1                 self.inf_constr_progress -= INFRASTRUCTURE_COST                 construction_complete = True         else:             raise Exception(\"\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0442\u0438\u043f \u0437\u0434\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0439\u043a\u0438\")         return construction_complete<\/code><\/pre>\n<pre><code class=\"python\">    def is_on_construction_limit(self, type_of_building):         if (                 type_of_building == MILITARY_BUILDING or                 type_of_building == CIVIL_BUILDING         ):             if (                     (self.factories + self.military_factories +                      self.shipyards + self.fuel_silo + self.synth_oil                      ) >= self.factories_limit             ):                 return True             else:                 return False         elif type_of_building == INF_BUILDING:             if self.infrastructure >= self.infrastructure_limit:                 return True             else:                 return False         else:             raise Exception(                 f\"\u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u043b\u0438\u043c\u0438\u0442 \u0434\u043b\u044f \u0437\u0434\u0430\u043d\u0438\u044f \"                 f\"{type_of_building} \u0432 \u0440\u0435\u0433\u0438\u043e\u043d\u0435 \"                 f\"{self.name}\")<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>2. \u0414\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0444\u0430\u0431\u0440\u0438\u043a<\/h2>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0443\u043d\u043a\u0442 \u043f\u043b\u0430\u0432\u043d\u043e \u0432\u044b\u0442\u0435\u043a\u0430\u0435\u0442 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e. \u0412 hoi4 \u0435\u0441\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0430 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u043d\u0430\u0440\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u044f, \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043d\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u0442\u043e\u043c \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u0444\u0430\u0431\u0440\u0438\u043a \u0432\u0430\u043c \u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u0445 \u0444\u0430\u0431\u0440\u0438\u043a \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<p>\u0444\u0430\u0431\u0440\u0438\u043a\u0438_\u043d\u0430_\u0442\u043d\u043f = (\u0444\u0430\u0431\u0440\u0438\u043a\u0438+\u0444\u0430\u0431\u0440\u0438\u043a\u0438_\u043e\u0442_\u0442\u043e\u0440\u0433\u043e\u0432\u043b\u0438+\u0432\u043e\u0435\u043d\u043d\u044b\u0435_\u0437\u0430\u0432\u043e\u0434\u044b)*\u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442_\u0442\u043d\u043f<\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u0432\u0441\u0451. \u0412\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u043d\u0435 \u0432\u0441\u0435 \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u0438 \u0437\u0430\u0432\u043e\u0434\u044b \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0432 \u043d\u0435 \u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0432\u0438\u043d\u0446\u0438\u044f\u0445. \u041f\u0440\u0438 \u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0441\u043a\u043e\u0439 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0434\u043e\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0435:<\/p>\n<p>\u0434\u043e\u043b\u044f = 25% + 65%*\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c + 10%(\u0435\u0441\u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c>40%)<\/p>\n<details class=\"spoiler\">\n<summary>\u0420\u0430\u0441\u0447\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0444\u0430\u0431\u0440\u0438\u043a \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 Country<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">    def _calculate_factories(self):         civil_fact = 0         mil_fact = 0         shipyards = 0         for region in self.regions:             if self.tag in region.cores:                 civil_fact += region.factories                 mil_fact += region.military_factories                 shipyards += region.shipyards             else:                 civil_fact += (                     region.factories * region.get_compliance_modifier()                 )                 mil_fact += (                     region.military_factories *                    region.get_compliance_modifier()                 )                 shipyards += (                     region.shipyards * region.get_compliance_modifier()                 )         # \u041e\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u043c \u0432\u043d\u0438\u0437         civil_fact, mil_fact, shipyards = (             int(civil_fact), int(mil_fact), int(shipyards))         self.factories = civil_fact  # \u0412\u0441\u0435 \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0430         civil_fact += self.factories_from_trade  # \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u043e\u0440\u0433\u043e\u0432\u043b\u044e         self.consumer_goods = self._get_consumer_goods()         self.factories_for_consumers = floor(                 (civil_fact + mil_fact) * self._get_consumer_goods()         )         factories_available = (             civil_fact - self.factories_for_consumers         )         self.factories_total = civil_fact         self.factories = civil_fact - self.factories_from_trade         self.mil_factories = mil_fact         self.shipyards = shipyards         if factories_available > 0:             self.factories_available = round(factories_available, 0)         else:             self.factories_available = 0<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0420\u0430\u0441\u0447\u0435\u0442 \u0434\u043e\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u0444\u0430\u0431\u0440\u0438\u043a \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 Region<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">    def get_compliance_modifier(self):         # \u0414\u043b\u044f \u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0432. self.compliance = None         if not self.compliance:             raise Exception(                 \"\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0438.\"             )         industry_percent = self.compliance * 0.65 + 25         if self.compliance > 40:             industry_percent += 10         return industry_percent\/100    <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>3. \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0435 \u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0439<\/h2>\n<p>\u041c\u044b \u043e\u0431\u0441\u0443\u0434\u0438\u043b\u0438 \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0435 \u0444\u0430\u0431\u0440\u0438\u043a\u0438, \u043d\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u044d\u0442\u043e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u043d\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430\u044f. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043f\u043e \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435:<\/p>\n<p>\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435_\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f = 0.075 * (1+\u0431\u043e\u043d\u0443\u0441_\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f) &#8212; \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c * 0.00083<\/p>\n<p>\u0411\u043e\u043d\u0443\u0441\u044b \u043a \u0440\u043e\u0441\u0442\u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432 \u0446\u0435\u043b\u043e\u043c \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0447\u0430\u0441\u0442\u043e, \u043d\u043e \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a: \u0432 \u043c\u0438\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u0441\u0435 \u0441\u0442\u0440\u0430\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 +10% \u043a \u0440\u043e\u0441\u0442\u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f.<\/p>\n<details class=\"spoiler\">\n<summary>\u0420\u0430\u0441\u0447\u0435\u0442 \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f (\u043c\u0435\u0442\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430 Region)<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">    def calculate_day(self, compliance_modifier):         if self.compliance:  # \u0414\u043b\u044f \u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0432. self.compliance = None             grow = (1+compliance_modifier) * 0.075             decay = self.compliance * 0.00083             self.compliance += grow - decay         else:             raise Exception(                 \"\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0440\u043e\u0441\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432 \u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0438\u043d\u0446\u0438\u0438.\"             )<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>4. \u0423\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u044f\u0447\u0435\u0435\u043a \u0437\u0434\u0430\u043d\u0438\u0439<\/h2>\n<p>\u0412 \u043f\u0443\u043d\u043a\u0442\u0435 1 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u043e \u0442\u043e\u043c \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0434\u0430\u043d\u0438\u0439 \u0432 \u043f\u0440\u043e\u0432\u0438\u043d\u0446\u0438\u0438. \u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044f\u0447\u0435\u0435\u043a: \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430 100 \u043f\u043e\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u043b\u0430\u0441\u0442\u0438 \u0438 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u041f\u0435\u0440\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043a\u043e\u0440\u0435\u0435 \u0432 \u043f\u043e\u0437\u0434\u043d\u0435\u0439 \u0438\u0433\u0440\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u0441\u043e\u0432\u0435\u0442\u043d\u0438\u043a\u0438 \u0443\u0436\u0435 \u0432\u044b\u0431\u0440\u0430\u043d\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u043c. \u0410 \u0432\u043e\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0430\u043c \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u0435\u043d. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u043d\u0430\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430:<\/p>\n<p>\u043d\u043e\u0432\u044b\u0439_\u043b\u0438\u043c\u0438\u0442 = \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439_\u043b\u0438\u043c\u0438\u0442*\u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440_\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438<\/p>\n<p>\u041e\u043a\u0440<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-377171","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/377171","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=377171"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/377171\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=377171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=377171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=377171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}