On technology for modeling and forecasting the interrelated development of regional fuel and energy complexes of Russia and Mongolia

. The paper considers the main ideas of proposed computational technology for scenario modeling and forecasting the development of the national fuel and energy complexes of Russia and Mongolia, regarding to the intercountry trade in fuel and energy resources. The proposing technology exploits the ideas of multi-agent systems (MASs) and agent-based simulation models (ABSMs) as they can act as unifying means for different types of decision-making methods by distributed objects. Methodological principles and architecture for ABSM of the national fuel and energy complexes of Russia and Mongolia were proposed. The implementation issues of the model in the Adskit software tool is discussed. The problem of laying routes of extended energy objects is also considered. Based on the principles of geometric optics the author's solution algorithm in the form of a special case of the variational problem was proposed to deal with this problem. The application of MAS and ABSM paradigms for forecasting and evaluating the state of the fuel and energy sector in Russia and Mongolia allows one to organize a step-by-step research of the energy system with the gradual development of the model: increasing the types of objects and agents; improving decision-making algorithms, including those based on mathematical models; creating complex scenarios. The technology forms methodological basis for supporting decision-making process of evaluation the prospective variants of bilateral energy cooperation of Russia and Mongolia and related project effectiveness.


Introduction
In recent years, the role of Northeast Asia (NEA) in the global economy has been rapidly growing. This process is accompanied by increasing demand for fuel and energy resources in the region's countries. In this situation, it is extremely important for Russia to make every effort to increase its presence in the dynamically developing energy markets of the NEA countries. That is why Eastern Siberia and the Russian Far East become of strategic importance for entering Asian markets. The importance of Mongolia as a contact zone for the NEA region is also increasing. Thus, Russian-Mongolian cooperation in the energy sector goes beyond purely bilateral relations and takes on a macro-regional character [1].
In this context, the subject of this study, which is devoted to the development of methodological principles for creating computing technology (CT) for scenario modeling and forecasting the interconnected development of national fuel and energy complexes in Russia and Mongolia, is particularly relevant. The principles of agent-based simulation and mathematical modeling serve as the basis for CT. Its implementation in the form of a software system will make it possible to give scientifically-based assessments of the effectiveness of cooperation projects between Russia and Mongolia in the energy domain.

Problem statement
In the post-war years close cooperation in the field of energy between the USSR and the MPR (Mongolian People's Republic) was developed, but in the post-Soviet period, the intensity of contacts has significantly decreased. In both ongoing and prospective projects for the supply of Russian energy resources to China, transportation routes are bypassing Mongolia. In our opinion, this logistic situation is unjustified, since Mongolia can become a convenient transport corridor for the supply of electricity, petroleum products, and natural gas from Russia to China and other NEA countries [2]. The latter circumstance will also contribute to the gasification of the territory of Eastern Siberia and Mongolia, which in turn will have a social effect for Russian regions, contribute to ensuring connectivity of the territory of the Russian Federation, and also strengthen the authority and influence of Russia in the NEA [3,4].
Thus, the joint development of the energy infrastructure of the Eastern regions of Russia and Mongolia is an urgent need at the present stage, at least from the geopolitics point of view. However, in addition to political factors, there is also economic feasibility, which is a stumbling block for the implementation of the relevant plans in the considered situation. To scientifically substantiate projects of inter-country energy cooperation, in contemporary conditions it is impossible to do without the use of methods of mathematical and computer modeling.
Both Russia and Mongolia have developed systems of optimization economic and mathematical models for forecasting and research of priority areas for the development of national fuel and energy sectors, taking into account external (inter-country) fuel and energy relations. The models were implemented as computer programs and were widely used (see, for example, [5][6][7]), however, these developments belong to the Soviet period of history and need to be updated. The development of specific recommendations aimed at solving this problem is one of the goals that the authors of the paper together with their Mongolian colleagues set for themselves.
At the same time, in addition to optimization models, which, of course, remain relevant, in our opinion, in contemporary conditions, it is also necessary to use simulation methods. These include agent-based modeling, in accordance with the principles of which the objects under study are considered as elements of a decentralized system, and their functioning is subject to certain specific rules. Agent-based models can complement traditional economic and mathematical methods that allow us to find the equilibrium states of the system (stationary optima). Agent models, in turn, simulate transients, including the appearance of instabilities, and allow us to take into account the influence of micro factors on the behaviour of the system at the macro level.
In the paper methodological principles for creating an agent-based simulation model (ABSM) of the fuel and energy complex of Russia and Mongolia are proposed and its architecture is developed. In addition, the optimization mathematical models is constructed for the problem of routing the extended power objects with the special problems of calculus of variations to solve the author's algorithm based on the principles of geometrical optics.

Agent-based simulation technology description
An agent-based simulation model (ABSM) is a computational model considering the studied objects as elements of a multi-agent system. A multi-agent system (MAS), in turn, is a system of active and autonomous elements (namely the agents) interacting with each other to perform complex tasks. Hence, the behaviour of the MAS as a whole is defined as the result of the collective behaviour of agents: their decisions and actions.
The flexibility of the MAS-based approach is the ability to vary the internal structure of the agent without significantly changing the communication protocols with the outside world (other agents and the environment). Currently, a number of agent architectures have been developed. A simplified abstract agent model can be represented as a set of elements of the following type: S (sense) -sensor, perception; C (communicate) -block of interaction with other agents; D (decide) -decisionmaking block; A (actuate) -executive block (actions).
From the modeling process viewpoint, the use of MAS allows developers to focus on describing the individual logic of the agent behaviour, and the behaviour of the system as a whole is evaluated after conducting a series of computational experiments with ABSM. The application of ABSM as a research tool is most effective in solving problems for which the structure of the studied objects is initially similar to the MAS, i.e. the elements of the system are heterogeneously distributed, have proactive behaviour, and coordinate their actions with each other in the process of functioning.
The experience in applying ABSM together with other types of models (for example, discrete-event and discrete-continuous) shows that ABSM more and more acts as a coupling element, since agents can use a variety of decision-making methods: simple reactive rules in the «IF ... THEN» form; algorithms based on dynamic mathematical models; complex cognitive behavioural patterns (for example, a BDI model of beliefs, desires, and intentions [8]). Thus, the application of MAS and ABSM for forecasting the long-term development of the fuel and energy sector in Russia and Mongolia makes it possible to expand the methodological framework for developing scientific bases for forming priority areas of cooperation in the energy sector, both through new types of models and a combination of existing ones.

The requirements for ABSM creation tool
When developing the ABSM for the fuel and energy complex of Russia and Mongolia, the following features should be taken into consideration. First, research in this domain is interdisciplinary. Therefore, particular attention should be given to the problem of developing a unified conceptual framework and model of the domain area, the elements of which can be used as a specification to describe the components of the designed ABSM.
Second, due to the exploratory nature of the research, the structure, type, and decision-making methods of agents can often change, and the ABSM development process will necessarily be iterative. Therefore, it is necessary to rapidly reconfigure the architecture of ABSM agents in order to test various hypotheses about their structure and behaviour and conduct massive computational experiments to calibrate parameters of ABSM elements.
Third, to simplify the ABSM modification procedures, it is advisable to explicitly separate the agent-specific and domain-specific parts of the ABSM. In this case, domain experts will be able to design knowledge bases relatively independent, and then, with the help of specialists in simulation modeling, create various versions of the agent model.
Fourth, as domain experts are not enough familiar with programming skills, it is necessary to provide visual, intuitive, and easy to use design tools for conceptual models and knowledge bases creation as well as tools for review and editing of ABSM and management of computational experiments.
The described features of the ABSM development process for the fuel and energy complex of Russia and Mongolia impose certain requirements on the modeling and simulation tools: the formulation of tasks should be carried out in meaningful terminology, which in turn determines the need for an explicit application of the domain conceptual model in the ABSM design process; to describe the domain and agent-specific regularities, it is appropriate to use intuitive tools (for example, rules and visual programming); there must be opportunities for rapid prototyping of the applied AIM and the consistent detailing of its behaviour.
These requirements are satisfied by a tool for the development of agent-based simulation models Adskit [9], which contains an extensible set of components: the web editor of conceptual models in the form of ontologies "concept-property-relation", the web editor of rule-oriented knowledge bases; the web editor of domain-independent agent behaviour in the form of a workflow; the web editor for managing computational experiments. The sequential process of ABSM creation with the help of Adskit is performed in accordance with the following generalized algorithm. 1 Creating a conceptual model of the ABSM architecture, i.e. defining the basic elements from which particular agent models will be formed. For example, specialization of mentioned blocks in the abstract agent model. 2 Development of the domain conceptual model and related knowledge bases that describe the meaningful behaviour of constructing ABSM elements.
3 Creating an agent model by establishing a correspondence between the domain concepts and rules obtained in step 2 and the architectural elements specified in step 1. 4 Determining the initial conditions for ABSM elements as well as other parameters of the computational experiment. 5 Performing scenario calculations based on the obtained model and in accordance with the specified experimental conditions.

About the technology
At the domain-independent level, the following ABSM architecture can be utilized to create the ABSM of the fuel and energy complex of Russia and Mongolia: <ABSM>= < Agent, Environment, Action, Event>, <Agent >=<Lifecycle of the agent>{<Role>}{<Sensory function>}, <Environment>= <Lifecycle algorithm of environment> {<Object>}{<Constraint>}. The meaningful behaviour of an agent is determined by its roles, whereas each role contains a knowledge base as well as a set of properties and characteristics. The set of roles for a specific agent can change dynamically during the modeling process. The environment has a set of macro-level parameters (for example, geo characteristics of space, the temperature of the medium, etc.) and a set of reactive objects, which are modeled in a special way. The <Constraint> architectural element provides information about the ABSM restrictions on the rules of agent behaviour. So, if necessary, their actions can be blocked at the macro level. The set of constraints can also change dynamically during the modeling process. An event is defined as an entity that is created at a specific moment and can lead to changes in the state of model elements. Events can vary by type and area of influence. The action can be roughly divided into three abstract kinds: sending a message, a state change, causing the event. The idea of "lifecycle algorithm" abstraction is describing the sequence of action performed by some ABSM element. This architectural element is utilized by Adskit, for example, to construct different types of agents that are differing from each other by domain-independent decisionmaking procedures.
For instance, the agent can implement the following standardized sequence • Receiving data from various sources (messages, sensors, events).
• Forming a set of alternative responses or actions depending on the current set of agent roles (i.e. a set of related knowledge bases). • Selection of responses or actions based on the specialized knowledge base. • Assessment of actions by the environment (checking constraints). • Performing selected and approved actions.
In accordance with the Adskit approach, all the mentioned architectural elements should be interpreted from a subject domain viewpoint. It is proposed to adapt the existing agent models [10][11][12][13][14] taking into account the regional and problem specifics of the fuel and energy sector of Russia and Mongolia.
As an example, we can extend the EMMAS model [12], designed to describe the electric power market. The EMMAS structure has a sufficient level of abstraction and prospects for further development. In particular, agents in this model can perform the following roles: • electricity consumer (purchases electricity for their own needs); • electricity producer (sells the produced electricity with the help of wholesalers); • system operator (performs centralized operational and technological management in the energy system); • distributor (manages the distribution network, ensures the safety and reliability of the distribution system), • wholesaler (buys electricity from producers for resale to retailers; does not own generation, transmission, or distribution facilities); • retailer (purchases electricity from wholesalers and resells it to consumers; does not own generation, transmission, or distribution facilities); • regulator (performs control functions in the electricity market through laws or other legal means, monitors the behavior of market participants, mediates conflict situations, and is responsible for planning and long-term security of electricity supply).
There are other ABSM in the energy domain. They can solve a wide range of tasks at different time horizons: strategic planning [12]; energy market modeling [11]; network management and modeling [13]; monitoring and diagnostics of energy systems [14]. Due to the capabilities of Adskit, one can gradually increase the complexity of the behavior algorithms, as well as add new types of agents, events, and actions (either expanding or replacing existing).
Forecasting the long-term development of regional fuel and energy complexes and related industry systems with the help of discussing ABSM is carried out in the form of scenario analysis. Meanwhile, information support for multivariate computational experiments and subsequent evaluation of the obtained results are maintained by the domain experts. To create a scenario, it is necessary to determine which types of agents and objects are involved in the experiment, set their initial state and quantity; generate environment parameters, and the initial set of constraints at the macro level.
Different sources can be utilized in the course of scenario creation: research findings; programs, strategies, and energy system development projects in Russia and Mongolia; expert assessments, and so on. • Use of renewable sources (solar, wind, biomass, etc.) for electricity supply to households, businesses, and remote localities. • Import and export of electricity.
The feature of the ABSM approach application is that the scenarios of different types can be considered both independently and together, defining comprehensive strategies for long-term development.

Mathematical model and tracing algorithm
Assume that the service polygon M has m objects A1,…,Am that need to be provided with communications (roads, pipelines, power lines, etc.). Their total cost should be as low as possible. We assume that there are no branching points (Steiner points), i.e. it is necessary to construct a minimal spanning tree. This formulation is relevant, in particular, when laying power lines, since it is difficult to construct branch points.
Note that the cost is determined not only by the length of the edges but also depends on the coefficients of increase in the cost of specific capital investments (up to prohibitive values) in relation to standard conditions. Besides, it is necessary to take into account the fulfilment of certain restrictions, in particular, include a penalty for passing through certain areas (reserves, national security facilities, etc.). The coefficients of increasing the cost of specific investments in the linear part are the following indicators: soil type (sandy, clay, rock, swampy, etc.); seismicity; length and depth of water crossings; height differences; the presence of buildings, etc.
Thus, the weight of the section between the i-th and k-th object is unknown in advance and directly depends on the chosen route. In this formulation, the problem can be divided into two subtasks: finding the best (minimum cost) routes between all the considered objects and constructing a minimum spanning tree.
To solve the first subproblem, we use the approach proposed in [15], which implies solving the infinitedimensional optimization problem , , , min ( , ) .
Here Fi,k is the cost of communications construction between Ai and Ai along the optimal route Γ * i,kG, , = 1, ; i k m k i  , where G is a set of curves connecting given points; v(x,y) ≥ γ > 0 is a piecewise continuous function that characterizes the construction cost at any point (x,y).
As a result of solving the first subproblem, we obtain a connected undirected weighted graph W(U, Γ * ), where 1 = m i i UA  U is a set of vertices, and Γ * is the set of their possible pairwise connections (edges), and for each edge (i,k) its weight is uniquely determined, w(i,k)=Fi,k.
The problem is to find such a connected acyclic subgraph that contains all vertices, and the total weight of its edges is minimal.
To solve the obtained mathematical problem, we use the previously developed optical-geometric approach [15,16]. The essence of the approach is to apply an analogy between the propagation of light in an optically inhomogeneous medium and finding the minimum of integral functional (1). According to Fermat's principle, light chooses the route along which allows it to move with the greatest speed; in other words, an extremal. This allows you to initiate a light wave from a point A with a local velocity f(x,y) = 1 / v(x,y), track the position of its front, and find the moment when the first "photon" reaches the point B , and, moving in backward time, obtain the trajectory of its movement. This will be the desired curve that ensures the optimum. Note that in this case, the speed of wave propagation is inversely proportional to the construction cost.
To construct the front of a light wave emitted from a point source, we use the following algorithm.
Algorithm "Wave". 1. We introduce a uniform grid with a step h. Then, instead of the set M, we consider the grid set = {0 The function v(x,y) has a complex structure and includes 4 truncated cones ( Fig.  1).   The mathematical models, software and computing tools for forecasting the long-term development of regional fuel and energy complexes in Russia and Mongolia and their industry systems were improved and new ones were developed.
A justification of the multi agent paradigm and agent-based simulation approach as effective tool for studying the development of regional fuel and energy complexes is presented. The choice of software tool for creating the ABSM of the fuel and energy complex of Russia and Mongolia is clarified. The model methodological principles and architecture are proposed. The analysis of existing ABSM in the energy domain and their application experience confirm the prospects of research based on the MAS paradigm.
In addition, mathematical models are proposed for the problem of laying routes for extended energy objects (tracing power lines, gas pipelines, etc.), which have the form of calculus of variations problems. To solve these problems, the original algorithm is considered. This algorithm is based on the optical-geometric approach that is developing in recent years by the authors.