A Trading Simulator Model for the Wholesale Electricity Market

Currently, to meet the requirements of modern power systems as fully and efficiently as possible, the electricity markets have diversified greatly. Under these conditions, it becomes difficult for a producer to determine the structure of transactions that is financially optimal. Starting from the operational rules of the power systems that have shaped the electricity markets structure, the objective of this paper is to develop an electricity market simulator model that includes the basics of a best practice guide for producers that compete on various electricity markets to carry out the trading activities and enhance their financial results. The market simulator model considers both the bilateral long- or mid-term agreements and short-term offers on day-ahead, ancillary services and balancing markets providing the entire trading scenario and associated cash-flow and risks. Its significance consists in assisting the producer to plan its resources and create projections by performing multiple trading scenarios and selecting the best one. Thus, this paper proposes to uncover constraints and business rules for a simulator model assisting the market players to access the electricity markets and select the best option using Multiple-Criterial Decision-Making (MCDM) methods (Electre, Topsis, Analytical Hierarchy Process) or the weighted Euclidean distance. The simulations comprise four trading scenarios for different types of producers (gas or fossil-powered generators) generating 100 MW, that are ordered by independent criteria. The results obtained with MCDM and the proposed method showed that they indicated the same scenario as the best trading option based on the type of the producer.


I. INTRODUCTION AND LITERATURE REVIEW
The goal of the whole-sale electricity market with its components (i.e. for long-term contracts -Bilateral Contract Market (BCM), mid-term contracts -Day Ahead Market (DAM) and Intra-Day Market (IDM), and short-term transactions -Balancing Market (BM)) is to provide a temporal balance between load and generation, ensuring a high quality of supply and financial efficiency of the market players.
A different market for the Ancillary Services (ASM) is also taking place to enhance the security of the electricity supply. Providing the primary reserve (frequency reserve) is mandatory for all electricity generators in accordance with the provisions of the European technical regulations. Thus, usually 3% The associate editor coordinating the review of this manuscript and approving it for publication was Zhouyang Ren . of the installed power is reserved for maintaining the safety and quality operation of the power systems.
Considering a daily typical load curve, the BCM transactions are located at the bottom of the curve, while the other markets follow the variability of the load ensuring a fine balance at the power system level. The transactions on BCM are generally characterized by firm bilateral contracts with medium to long durations: from few months up to few years and by fixed hourly quantities during the day. Usually, the transactions of BCM are secure, the prices are the lowest and the products that can be sold on this market are quite rigid and are not able to follow the variability of the load.
The scheduled transactions of electricity with delivery on the day following the day of trading are carried out on DAM. The transactions performed on this market are covering the area between BCM and the load curve itself. DAM provides the market players with a functional market to set a better balance between the bilateral contracts, short-term consumption forecast and the availability of the generating units for the next delivery day. Hence, the surplus or shortage can be balanced by selling or buying on DAM. Participation in this market is voluntary. DAM consists in firm electricity transactions based on the bids submitted by the DAM players who receive the marginal price of an auction mechanism.
IDM is also a component of the wholesale electricity market. The hourly transactions are concluded for each day of delivery, after the transactions on the DAM are finalized with some time before the start of delivery. Usually, 4 IDM take place at each 6 hours. IDM as well as DAM are voluntary markets.
The Transmission and System Operator (TSO) handles transactions on the BM from or to the generators to compensate the deviations from the electricity consumption or generation schedules. All dispatchable units are obliged to offer on BM -for power increase, the entire quantity of available power considering previous markets (BCM, DAM, IDM) engagements, and all power for power decrease up to the technical minimum power. As for the ASM, ensuring enough ancillary services is usually performed through nondiscriminatory market mechanisms using fixed-term auctions. Thus, the generating units are obliged to offer on the BM at least the quantities corresponding to the contracted ancillary services. The temporal sequence of the trading possibilities for an electricity producer and the main characteristics of various markets are depicted in Figure 1.
The use cases technique is chosen to model the first stages of the proposed simulator development cycle: identification of requirements and system analysis. This technique is commonly used in software design and is often associated with the well-known Unified Modelling Language (UML) [1], [2], a standard commonly used for object-oriented modelling. The UML diagrams are used to document the simulator's functionalities.
In this paper, we have two main objectives: drafting the basics of a best practice guide for generators types to participate on different electricity markets (wholesale and day-ahead) in order to enhance their financial results and ensure a sustainable operation; and proposing a methodology for market trading simulations considering the business rules, the weighted Euclidean distance and MCDM methods suitable for each type of generator. Furthermore, we will design a market simulator showing the gain that could be obtained from electricity markets considering their particularities. The simulation is performed for a gas or a fossil powered generating unit of 100 MW with four trading scenarios.
To the best of the authors knowledge, similar approaches that consider a single user at a time (that could be an electricity producer or a supplier or a trader or a dispatchable consumer) that simulates the trading activities on various market, have not been yet implemented. Most of the implementations regarding the electricity transactions have a single market (on the long or short-term) focus with multiple users, whereas our approach considers a single user that focuses on trading on multiple markets (bilateral contract, day-ahead, ancillary services and balancing markets). Hence, the market simulator becomes a valuable decision-making tool for trading. The user can assess various trading scenarios on each market, setting the quantities and choosing the risks of no trading, obtaining the associated cash-flow. By means of the proposed weighted Euclidean distance, the user chooses the best trading option. The results of the selection method were sustained by similar results obtained with well-known MCDM methods, such as: Electre, Topsis and AHP.
Hence, the paper is structured in five sections. The current section briefly describes the electricity markets on long and short-run horizon. In this regard, we considered a broad vision that is not concentrated only on one wholesale market structure, but a structure that is currently in operation in the European countries. Hence, any producer from any European Union country can use the market simulator as a decisionmaking tool for trading activities. Also, in this section, a couple of related scientific researches are discussed emphasizing on similar electricity market simulators. Section 2 is providing insights of the usage of electricity markets for different power generators and synthetic recommendations for approaching various electricity markets, while section 3 is dedicated to the methodology for designing and implementation of the market simulator, including business rules that consist in defining the weights for generator type and scenario selection, whereas section 4 underlines the findings of our research. In the fifth section, conclusion is draw and future works are shortly presented.
The literature review is classified in the following subsection:

A. ELECTRICITY MARKET MODELING
With the liberalization of electricity markets and the increasing share of Renewable Energy Sources (RES), energy markets must adapt to ensure economic efficiency and reliability. Since the early 2000s, there has been numerous researches for modeling electricity markets, and their number has increased in recent years. At European level, one of the priorities is the formation of a pan-European energy market, which, however, encounters difficulties related to the operational constraints of the electricity grids. In this direction there are numerous projects that focus on market mechanisms, market operation and validation, which led to the emergence of a significant number of market simulators. But the resulting tools focus less on supporting market participants in the negotiation decision-making process [3].
Modeling and simulating the market and electricity is important because it provides answers to many questions about complex scenarios and what-if situations. These scenarios can be modeled and simulated before they are implemented in the real market.
Electricity systems can be considered as Complex Adaptive Systems (CAS) [4]. By definition, CAS are heterogeneous, interacting and adaptive units with adaptive behavior that can range from simply reacting to environmental conditions, to directing actions [5]. Individual behaviors and interactions between entities lead to effects on the aggregated level of the total system. Pricing mechanisms in any electricity market are a critical foundation on which the entire electricity market is built [6].
Operators and regulators need to anticipate market developments and test new market rules and mechanisms. Crampton [7] identifies two elements needed to design a market model: finding a market target and understanding the preferences and restrictions of market participants. Several modeling methods can be used, but each of them has its own shortcomings [8]: a. Equilibrium models [9], [10] -such models offer a high level of formalization, but do not incorporate the strategic behavior of market participants and do not take into account the knowledge that a participant accumulates through daily market operations; b. Game theory [11], [12] -these models are limited to specific situations, in which the market and the behavior of the participants depend on only a few factors. The level of formalization is also high, but the ability to capture details of reality is quite low; c. Research on human subjects [13], [14] -these models require a very high level of expertise to describe the behavior of market participants in a realistic way. Formalization is low, but an advantage would be a better ability to describe the results; d. Agent-based models [15]- [19] -these models are proposed to remove the shortcomings listed above. Systems are based on the interaction between autonomous intelligent agents, each with its own goal and behavior. Following these interactions, the complex behavior of the market and the flexibility in modeling the dynamic conditions result in which the transactions take place. Agent-based modeling and simulation were proposed by many researchers as a suitable modeling approach for complex, socio-technical problems.

B. SIMULATORS FOR THE ELECTRICITY MARKET
In order to foresee the results, identify and limit the risks of electricity markets, it is necessary to provide a simulation environment. In the 2000s, there were many scientific researches proposing simulators for the electricity markets. In addition, numerous prestigious papers reviewed those simulators [20]- [23]. However, the electricity market simulators that have been or are still being continuously developed have very different characteristics and objectives. Some focus on the study of market mechanisms, others focus on physical implications, such as network stability, and a third category is concerned with complex interactions between partners and comparing different scenarios to predict future market developments. In the following paragraphs, we will briefly present some of those simulators, taking into account their characteristics, the proposed models, markets on which they operate, but also the number of subsequent references to these works.
A DEcision-support Simulator for POwer Trading, DESPOT [24] is a short-term wholesale electricity market simulation tool providing unit commitment, system hourly prices, profit and expected bid. Hourly supply curves are the final output of an operation planning decision support model. PowerWeb [25] is a web platform that allows users to simulate a large number of market scenarios, with different rules and restrictions. It is controlled by a central agent, which acts as an independent system operator, which guarantees system reliability.
Many of the simulators are based on software agents. Thus, EMCAS [16] is a simulator that describes the behavior of consumers and producers, and calculates the price of electricity for each hour and each location in the network. The price depends on the demand, the production cost, the congestion of the transmission grid and external factors (delays in production, distributors' strategies). In this market simulator, the players' strategies are based on adaptive learning algorithms.
NEMSIM [17] was the first large-scale agent-based simulation model to represent the Australia's electricity market. The simulator uses a huge amount of historical data to simulate the structure of the market. Agents can be manufacturers, network service providers, retailers and the national electricity market management authority. The models used are bidding and bilateral contracts. Unfortunately, the model is far too specific to be adapted to other markets.
MASCEM [18] is a learning simulator based on a reinforcement learning algorithm providing participants with strategic skills. It implements the day ahead market, forward market, bilateral market and bilateral contracting market. Agents apply a predefined set of behaviors and strategies. This simulator can be used to evaluate the efficiency of trading mechanisms on the electricity market. More recent results are presented in [26], that also explores the impact of trading mechanism market players behavior on electricity markets. Agent-based modeling and simulation methods are applied for symmetric electricity market considering pricebased demand response.
Aspects regarding decision making in the context of electricity market were presented by [19]. In this case, the approach is based on artificial intelligence and data mining algorithms and provides a simulation tool that processes data from real electricity markets. The main goal was to create realistic scenarios that consider the modeling of electricity market players' behavior and characteristics. Furthermore, one objective was to gain insight about the interactions between involved parties.
An object-oriented implementation of electricity market mechanisms is presented in [27]. Day ahead market and intraday market mechanisms were modeled for the German electricity power system. Hybrid simulation and mathematical optimization were used to study different exchange mechanisms and behavior patterns.
Nevertheless, it can be noticed that although the participation of players on several types of market intensifies the need for decision support, few of the existing simulators can provide support in deciding whether or not to participate in a certain type of market.

C. KEY PERFORMANCE INDICATORS (KPIS), BUSINESS RULES AND MCDM METHODS FOR SIMULATORS
The KPIs are directly correlated with the efficient operation of the electricity markets from the technical and financial point of view. In [28], a list of qualitative assessment criteria of electricity markets are proposed: efficiency, effectiveness, robustness, applicability and fairness. Then, a set of KPIs is proposed to evaluate quantitatively the impact of different market design options, considering both long-time and shorttime design options. All the quantitative KPIs are associated with the qualitative ones. Thus, in the context of integration of a large volume of RES, the main purpose is to define KPIs for the electricity markets operation.
In the context of the future pan-European electricity system, different possible future balancing market mechanisms are evaluated in [29]. Both traditional power plans and renewable energy sources are considered, and the main outcomes of the electricity markets are analyzed: average price levels of balancing products, marginal costs, costs of electricity dispatch, costs for procuring the balancing capacity, etc. The focus is on the procurement of balancing capacity.
Based on these indicators, complex decisions can be made. However, well-founded decisions depend, to a large extent, on the proper understanding of the business rules underlying the system processes. Since the scope of the business rules is to describe the operations, definitions and constraints that apply to an organization [30], it can be stated that the correct identification and the appropriate specification of business rules will significantly influence the decision-making process.
Knowledge embedded in business rules comes from many years of successes, failures, test and simulation results, optimizations, maintenance operations and so on. In many economic fields, business rules could become part of an efficient information system. Also, several issues related to business rules management can been found in the literature, such as: knowledge elicitation, rule modeling and formalization, completeness and consistency of a business rules set and automated rule checking [31].
Participants in various electricity markets are faced with complex decisions, with long-and medium-term implications that cannot be anticipated, both due to the complex business rules, as well as due to the large number of participants and transactions. Aspects regarding the formalization of business rules related to day-ahead markets, which encourage momentary balance between supply and demand, can be found in [32]. Also, a realistic simulator of the DAM of Spain, where all the rules that govern this market are modeled, was proposed by [33].
Whereas the coupling of the European electricity markets has been fully achieved for DAM, a joint integrated IDM based on the continuous trading mechanism is under implementation, formalizing the market rules needed for the harmonization of two distinct trading mechanisms used by European countries [34].
Reference [35] presents several decision-support models suitable for managing the bidding and scheduling processes for aggregators that supply electricity to prosumers with flexible generating units. Considering the penalization due to imbalance volume, these models focus on specifying the bidding process and bidding rules and handling the interrelations at hourly level.
MCDM have been successfully applied in a wide range of applications related to energy and sustainability problems [36], [37]. Methods such as: technique for the order of preference by similarity to the ideal solution (TOPSIS); analytical hierarchy process (AHP); preference ranking organization method for enrichment evaluation (PROMETHEE); elimination and choice translating into reality (ELECTRE), can be used to support stakeholders and decision makers in making decisions in real situations, in which they must take into account many quantitative and qualitative criteria, often contradictory. They can use more of these methods or use their extension to consider stochastic inputs and assign confidence levels in the resulting outputs [38]. MCDM methods are frequently used lately on numerous renewable energy applications [39]. VOLUME 8, 2020

II. USAGE OF ELECTRICITY MARKETS FOR A POWER GENERATOR
One of the objectives of this paper is to draft the basics of a best practice guide for generators for usage of the different electricity markets in order to improve their financial results and efficiency. Considering that starting from their primary energy source, there are significant differences between power generators both from technical and efficiency point of view, the following power generators categories are analysed: fossil and nuclear fuels powered; hydro powered; photovoltaic and wind powered; storage facilities.

A. GENERATORS POWERED BY FOSSIL AND NUCLEAR FUELS
They have similar characteristics in what it concerns the electricity market participation. The main characteristic from this perspective is the strong correlation between the generation efficiency level and the variation of the electricity generation volumes. In order to achieve high levels of efficiency, this type of electricity generators requires a very constant generation volume and a high level (80% or even more for the nuclear generators) of capacity usage. An aspect that significantly influence the generation costs for this type of units is the necessity to create fuel stocks. Hence, this type of units usually requires large amounts of fuel to allow a longterm operation at close to full capacity. Large amounts of fuel stocks require specific financial resources and thus if not used in due time they may significantly increase the generation costs.
Taking into account the above-mentioned aspects, this type of generators must focus on the transactions performed on the BCM to achieve sustainable financial results. Transactions performed on this market provide both long-term and constant values for each time interval, but it must be mentioned that prices levels are relatively low as compared with the other markets, so an optimization must be made regarding the volume of generation.
The DAM and IDM are usually not providing good opportunities for these types of generators and therefore they should be used only for small amounts from the available capacity or in emergency conditions. The prices on these markets are extremely volatile and, if there is available capacity, the generators owners should take advantage of the opportunities that may show up and increase the financial outcomes.
According to the European regulations, all the generator units must participate in the BM. The volume of transactions performed on this market are determined by the TSO's requirements and they are performed practically in real time. In these conditions, there is practically no room for optimization, but the electricity prices on this market are very high and so even if the volumes and durations are low, the financial revenue may be significant if the operational schedule of the units is optimised accordingly.
Another electricity market that provides transactions with appropriate conditions for this type of generators is the ASM.
From the technical point of view, this market has suitable but not ideal conditions because the transactions are long-term and constant values, but there is no guarantee that fuel stocks will be used in due time. From the financial point of view, this market usually provides a long-term and reliable revenue, but not at the same level as the BM.
Among the electricity generators in this category, there is one that requires a special attention: gas turbine powered generators. From the technological point of view, these generators are very similar with the other ones included in this category except they have one particular feature: extremely fast start from black start. For a nuclear-powered generator takes days to reach the nominal power following a black start. A thermal powered generator needs more than 10 hours to reach the nominal power following a black start, while the generators powered by gas turbines can reach the nominal power in less than 3 minutes. Hence, the fast start they can perform make them extremely suitable for providing ancillary services like Frequency Containment Reserve (FCR) and Frequency Restoration Reserve (FRR) and thus they are usually a major player on ASM. Obviously, BM is also a major source of revenue for this type of generators because the level of electricity prices on this market is usually higher than the generation costs of this generators.

B. HYDRO POWERED GENERATORS
Based on their constructive characteristics, hydro power plants may be grouped into two main categories: -On the Run of River (RoR). This type of power plants is built on the big rivers and takes advantage of the big volume of water flows while the accumulation lake capacity is normally rather low. -With dam and accumulation lake. These power plants are built usually on mountain rivers where the volume of water is not so big, but by building a high dam, a large accumulation lake is created and the power plant takes advantage of the big difference of level between the top and the bottom of the lake. As there is a large volume of the lake, this type of power plants usually has a significant water storage capacity. Although both types of power plants are equipped with similar hydro generating units, their behaviour on the electricity market considerably varies. The electricity generation efficiency is not so much related to the level of capacity as it is the case with thermal generators (nuclear or fossil fuel). Also, the hydro power plants are much more flexible in what it concerns the variation of the generation amount. In these conditions, their area of interest is limited in BCM area (especially for the RoR power plants) and much more in the DAM/IDM (for both types of power plants). Another important aspect that makes hydro power plants more suitable for DAM/IDM and less suitable for BCM is the dependency on the hydraulic conditions which cannot be estimated accurately enough to safely sign long-term contracts.
Together with the gas turbines, the hydro generators are playing a major role on BM due to their capacity to change the generation volume very fast and without significant changes in the efficiency.

C. GENERATORS POWERED BY RES
The transition from present situation when generation powered by fossil fuels, nuclear and large hydro is covering more than 80% of the generation needs to the future power systems in which generation powered by RES will cover even more than 80% of the requirements obviously implies the replacement of the first category with the second one, at a very large level.
From the technical point of view, wind generators and solar panels have the following main characteristics: -they are using convertors for connection to the grid. The photovoltaic or solar panels are generating the electricity in direct current while the wind power plants generate electricity at low level and variable frequency so both require a convertor to be able to inject the electricity into the power systems. However, the existence of the convertors induces a set of technical and financial characteristics that will be addressed in more detail in the following. -their generation volume is strictly related to the weather conditions: brightness for photovoltaic panels and wind speed for wind generators. This aspect makes the generation volume highly unpredictable on medium and long-term in accordance with the accuracy level of the weather forecast. Considering the above-mentioned aspect, the generators powered by RES are not suitable for contracts on BCM. In order to access long-term transactions, this type of electricity generators must find a solution for compensating the imbalances either by a supplementary contract with an electricity storage facility or by accepting a lower price for electricity, offsetting this way the financial loss due to the imbalances.
Hence, DAM/IDM are generally the most suitable markets for this type of generators. It must be mentioned that weather forecast, respectively generation forecast has to be accurate: the error it may go less than 3% per time interval if the forecast is performed with around 2 or 3 hours in advance. The main problem under these conditions is the risk of no finding the consumers for the available generation, in due time. In case this problem is properly mitigated, DAM/IDM may provide significant revenue.
Similar with other generators, RES powered generators are obliged to participate in BM, but only for the reduction of generation, for obvious reasons.
The high level of unpredictability induced by the weather forecast dependency makes ASM not very suitable. Transactions performed on this market require a very high level of certainty because they are meant to support the power systems operation in case of emergency situations like large outages. Usually, this type of generators will not access the ASM. Nevertheless, this conclusion is based on the existing structure of the ASM. The use of renewable energy sources has created new challenges in planning systems to track grid loading. The integration of different energy sources requires a plus of flexibility, new structures and new methods in order to maximize its benefit considering uncertainties related to renewable resources. Recent studies have substantiated the conclusion that increasing the level of RES powered in future, up to more than 50% of the total generation of the system, will require new ancillary services and therefore a new structure of ASM. Adding this information with the existing trend to design new types of converters: smarter, faster, more reliable, etc. the ASM may provide interesting opportunities in the future.

D. STORAGE FACILITIES
Storage facilities have a long history in the power systems. They have developed in parallel with the nuclear-powered generators as a support for their requirement for a constant electricity generation level. At that moment only one technology was sustainable from economic point of view: pump storage and the situation stayed like that until recently when the new developments in the battery industry have provided a new sustainable technology. Moreover, the tremendous development of the battery technology may lead to the conclusion that in the next future this type of technology will become more significant than hydro pump storage, from both points of view: installed volume and technical capabilities.
Irrespective the technology used for storage, the behaviour on the electricity market is obviously different for the two operational modes that characterize this type of facilities: consumption mode and generation mode. The business model of this type of facility is basically the following: when the price of electricity is low, for example during night time, consumption mode will be activated and the electricity will be stored in water or battery, if possible up to full capacity, whereas when the price of electricity is high, for example during the evening peak, the generation mode will be activated and the electricity will be sold on the market as much as possible. The difference of prices multiplied with the volume of traded electricity must ensure the financial sustainability of the facilities also considering the efficiency of the storage process itself. Considering the volatility of the prices on the electricity market, the storage facilities have to relentlessly monitor the market and react very promptly when an opportunity shows up maintaining the financial efficiency at an appropriate level for a long-term sustainability.
Under these circumstances, the most suitable transactional platforms are DAM and IDM because they offer the best conditions for maximizing the price difference and thus the revenue. In the same context, because of the dual character of the storage facilities, according to the regulatory framework, they not allowed to participate in the BM. Participation to ASM is very often an interesting opportunity because the storage facilities can provide a very fast reaction in both operational modes. Accessing the ASM transactions requires an optimization mechanism from the financial point of view. For example, to provide frequency reserves, the storage facility must store a certain electricity volume without using it in transactions on other electricity markets no matter the price level opportunities. In the same context, a certain storage capability must be kept available, again no matter the price level opportunities on other markets are, for the same reason.
Considering the above-mentioned aspects regarding the particularities of power generators and other facilities in relation with various electricity markets, the conclusions on evaluating the opportunities of accessing these markets are briefly presented in the Table 1.
The abbreviations used in Table1 have the following signification: The proposed market simulator is built considering the qualitative conclusions and assessments presented in Table 1 that are correlated with the existing electricity market structure. Its operation is based on several steps as in Figure 2.
As a first step, we need to define the market constraints for BCM, DAM, IDM, ASM, BM as in section 4.1. Then, the user will be identified as producer (that can be fossil, nuclear, hydro, gas, storage) or supplier. As we mentioned, some markets can be accessed only by producers (e.g. ASM, BM). The third step consists in defining the trading scenarios setting the quantities, prices and risk levels for trading on each market. The number of scenarios is not limited. However, they should take into account the flexibility and capacity particularities of the user. Performing of scenarios leads to a set of results that consists in specific financial and technical indicators. The fifth step consists in defining the criteria and weights for selecting the best scenario (risk, revenue, mean price, etc.). After the simulations are finalized, the best scenario can be selected using the weighted Euclidean distance.

III. METHODOLOGY AND MATHEMATICAL MODEL FOR DESIGNING THE MARKET SIMULATOR A. MARKET RULES
An electricity producer, at present, has the possibility and even the obligation, for some of them, to participate in various electricity markets. In these conditions, it is obvious that his revenue for a certain period, will be composed of the sum of where: I total -total revenue for a period of time t; I (Q, P) -the revenue obtained from an electricity market as a function of two variables; Q -power quantity hourly traded on various markets; P -hourly price on various markets.
The electricity transactions consider the following constraints: where: Q total -total available power of a producer. The Q total is an input data depending on the availability of the fuel, stocks, forecast, installed power Pi, maintenance and other obligations (such as to contribute to the primary reserve, that is around 3% of Pi).
The structure of functions from eq. (1) varies from market to market. Hence, in order to define I BCM , the trading rules for BCM will be considered. Although these rules may differ from country to country, the principals are common, thus the mathematical approach has a high level of generality. Trading on the BCM is heavily constrained by standardized bids in terms of delivery intervals. For a certain period, several complementary bids can be used to cover both peak and off-peak hours. The rigid structure of these bids leads to financial loss due to imbalances. The assessment of the loss is difficult and requires a large volume of historical data (hourly prices) that should be periodically updated. Hence, it is recommended to estimate the loss as a percentage of the revenue from BCM. Thus, the revenue function can be defined as: where: D -coefficient of imbalance that leads to revenue reduction, [%]; N -number of bids; Q i -power traded for a bid i. P i -price for a bid i.
The price is an average from historical datasets or it is negotiated by the user.
Considering the following constraint: Although, the prices on BCM are lower compared with other markets, usually the transactions are carried on medium-and long-term, with no risks of price variation or non-payment, offering a stable and predictable revenue.
In order to define I DAM , the power bids differ on hourly basis. This specific characteristic of DAM imposes setting the generation or load curve in advance to the trading period. It should take into account: hourly prices and the available power for trading excluding the contracts concluded on BCM and the capacity allocated for primary reserve.
DAM operates as a stock market; the generation bids and suppliers' requests are setting the hourly marginal price. This characteristic could not guarantee the transactions before closing the bidding session. Hence, we define a level of risk of the partial or total failure of the transactions, estimated for each time interval or groups of time intervals. The revenue function for DAM is the following: where: The price can be hourly forecasted and should take into account seasonal influence and information regarding other market participants' bidding strategies using large datasets with historical prices.
Considering the following constraint: The risk value may be defined by the user based on the information regarding the power system operation and trading experience or a standard risk value could be considered.
In order to define the I BM , some characteristics of BM should be mentioned. The BM is mandatory for dispatchable producers and consumers. The suppliers and traders are not eligible to trade on BM. The trading on BM is highly improbable because the trading requests are coming from the TSO due to the real-time power system operation that is influenced by the forecasts. Hence, the power and the price are variable for each interval. TSO may request to increase or decrease the power, thus the pairs (quantity, price) vary for the two cases. The revenue function for BM can be defined as following: where: Due to the high uncertainty regarding the hourly prices on BM, it is recommended to calculate the average price separately for the analyzed period for transactions that suppose increasing or decreasing the power. The risk is relatively high to obtain a too optimistic forecast of the revenue considering that the prices on BM (set by the pay-as-bid pricing mechanism) are usually higher compared to the other markets.
The participation in the ASM that actually takes place before BM is similar to it, open only to electricity producers and dispatchable consumers. Unlike the BM, their participation in the ASM is not compulsory, except for the provision of the primary adjustment reserve (hereinafter referred to as FCR), which is mandatory only for dispatchable producers and not for dispatchable consumers.
A very important feature of ASM is the fact that there are two components that are traded, respectively are paid: hourly power capacity available for ASM and electricity resulting from activation of the power capacity available for ASM, for a given period of time.
The transactions that can be carried out at present on ASM are the following: FCR, secondary reserve for frequency adjustment (hereinafter referred to as FRR), rapid tertiary backup for frequency adjustment (hereinafter referred to as Replacement Reserve Fast -RRF), slow tertiary backup for frequency adjustment (hereinafter referred to as Replacement Reserve Slow -RRS). VOLUME 8, 2020 The revenue function obtained from transactions with system services has two components and is as follows: The mathematical formula for the revenue function obtained from the ancillary services, by trading the availability of power capacity, is the following: (10) where: Until not so long ago, these prices were regulated by the national authority, but recently they are set by market mechanism. It should be noted that the revenue obtained from trading system services are completely determined (there is no uncertainty or risk factor) making this market stable and attractive for reserves providers. The quantities of the available power capacity for the ancillary services must satisfy the condition: These quantities are correlated with the quantities from the previous markets: BCM and DAM (as in eq. 2).
The mathematical equation for the second component of eq. (9), the function of revenue obtained from the ancillary services by trading the electricity resulting from a reserve activation order, is the following:  It should be noted that the values of the risks of nonfulfillment of the transactions are estimated values, evaluated on the basis of information from previous operating periods. If no such information is available, it is recommended to use high values that reflect the high degree of uncertainty.
The function represents the forecast of a financial revenue. Under these conditions, it is desirable that the resulting values are rather lower (positive forecast errors are favored).
Finally, for a better appreciation of the level of confidence that the user can have in the predicted value, the level of general risk that is achieved by corroborating the levels of risk assumed for each of the components related to electricity markets must be evaluated. Based on the experience, it is recommended that the amount of power available for the extremely low-risk components (bilateral contracts and power reserves) be at least 50% for nuclear and fossil-based generators to ensure an adequate level of confidence in the medium-and long-term revenue.

B. MCDM METHODS
Several scenarios S i of trading on the electricity market can be simulated for a certain period, lasting for at least one month to one year. Given that the user, that can be an electricity producer or supplier, has full control only on the amount of power traded on each market, and that, for simulations, historical prices are provided, as indication of past markets behavior, it can be concluded that the structure of quantities offered on each market represent the defining element of a market scenario.
To select one of the scenarios, we propose a simple, but efficient approach: the weighted Euclidean distance and the results are compared with a MCDM, such as Electre or Analytical Hierarchy Process. The selection of the scenario could be at a first sight a linear optimization problem, in which the trading quantities for each market are optimal when maximizing the revenue that can be easily solved with a Mixed Integer Linear Programming (MILP) approach. However, this is not the case of the electricity market as not only revenue is essential, but also the other criteria are significant.
As concluded in Table 1, producers have different opportunities of trading on various electricity markets. Thus, for nuclear and fossil-based generators, BCM is more appropriate than other markets, whereas for gas and hydro generators trading on DAM or BM is better than BCM. Hence, an important criterion is the electricity volume traded on BCM, that securely ensures a sustainable revenue level for certain producers, that is: where: W total -total traded electricity volume for a scenario.
As has been previously mentioned, a revenue level will be able to encompass an aggregated level of uncertainty associated with a simulated offer. The revenue level for each scenario i S i is determined according to the following equation: where: I S i -revenue for a certain scenario; I RF -revenue free of trading risks associated with a scenario.
The revenue level estimates the influence of trading risks over the total revenue. I RF total can be determined based on I total equation, by removing the influence of risk coefficients from all electricity markets. Therefore, when calculating the I RF total , the following coefficients will be equal to zero: D coefficient on BCM, R DAM on DAM, R BM on BM and The risk associated with each scenario is calculated according to the following equation. Based on its values, several categories for revenue level can be defined, as follows: low (0-10%); medium (10-20%); high (20-30%) and very high (>30%). Values that are greater than 30% for this coefficient denote an indication for rejecting the scenario due to a high risk of transactions failure, (19), as shown at the bottom of the page.
Also, a relevant indicator for evaluating the overall financial efficiency of the simulated transactions is the mean price associated with a scenario MP S i , that can be determined by the following equation: Also, the revenue I S i is a significant criterion that can be assessed at the scenario level.
When assessing a trading scenario on the electricity market, there are two types of aspects that must be considered. First, there are aspects related to the type of user. As presented in Table 1, the characteristics of power generators may impose trading restrictions in relation with various electricity markets. Also, depending on characteristics such as availability of the primary source, time to reach the nominal power after a black start, generation costs, fuel costs and so on, producers may exploit the opportunities of accessing these markets by focusing on those that are more suitable. Second, there are aspects related to efficiency, such as to maximize the financial results, that usually are associated with higher risks of trading failures.
Based on these observations, five business rule procedures weight_type (w type ) where type can be FOSS_NUCL, HYDRO, RES, STORAGE or GAS are proposed to evaluate the simulation scenarios on the electricity markets. Written in the ''IF conditions THEN actions'' format, each procedure applies to a category of power generators and implies four independent criteria that refer to: 1) electricity volume traded on BCM (v S i BCM ); 2) risk (R S i ); 3) mean price (MP S i ); 4) revenue (I S i ).
Analytic Hierarchy Process (AHP) is a MCDM that can help the decision process by breaking down a complicated problem into a hierarchical structure with several levels of objectives, criteria and alternatives. AHP performs comparisons between pairs to obtain a relative importance of the variable (criteria) at each level of the hierarchy and/or evaluates the alternatives at the lowest level of the hierarchy to choose the best alternative. AHP is an effective method, especially when there is subjectivity, and is very suitable for solving problems in which decision criteria can be organized hierarchically in sub-criteria.
The prioritization mechanism, developed by Saaty (1980), is achieved by assigning a number from a comparison scale (as in Table 2) to represent the relative importance of the criteria. The parallel comparative matrices of these factors provide the means of calculating the importance.
For instance, for a gas-powered producer, the following matrix for pairwise comparisons of the four criteria (the criteria were ordered according to their importance) is considered. For example, Revenue has a moderate importance in relation to Mean price and BCM traded volume (score 2 and, respectively, 3), but has very strong importance in relation to Risk (score 6). The diagonal elements will always be equal to 1 as in Table 3.
The decision maker takes into account m attributes of alternatives to reach a selection decision (m = 4 in this case). That is, the decision maker's underlying utility function is multiple-attribute and non-linear, but additive, as following: is the utility of attribute i of alternative x, and a i is the weight related to attribute i. For the considered example, the multiple-criteria utility function resulted is: However, if we repeat the analysis for the case of a fossil/nuclear producer, the matrix for pairwise comparisons of the four criteria will look different (as in Table 4).    As a result, the multiple-criteria utility function has changed: . Therefore, rules regarding the criteria weight stipulate that, for instance, for fossil and nuclear fuel-based producers, 50% of the energy must be traded on BCM, whereas for gas turbine powered generators, more important is the revenue as in Table 5. Therefore, a business rule procedure will be applied based on the user type of the simulator to determine the weights: IF producer = ''FOSS_NUCL'' THEN w FOSS_NUCL . With these sets of weights, in the next section, Euclidean distance and several MCDM approaches such as Electre, AHP, and TOPSIS are applied to select the best scenario.

IV. FINDINGS AND RESULTS WITH THE MARKET SIMULATOR A. FIRST TRADING SCENARIO S0
For simulations, we considered a generating unit of 100 MW simulating four trading scenarios. It contracted, in the first scenario, for an entire year, four standard products (peak1, peak2, peak3 and off-peak that are characterized by fixed trading hours and quantities) on BCM as in Table 24 for  weekdays and Table 25 for weekend days from Annex. After introducing the available power, automatically decreased in case of producers by 3% for frequency regulation, it represents the maximum power that can be traded on the electricity markets. Also, for some producers, the minimum power can be different from zero. For BCM, if the price is known it can be considered in the simulation, otherwise the average price from historical datasets will be considered as estimation. The imbalances costs may vary between 5 and 10% of the revenue from BCM. Considering the price estimations, financial loss due to imbalances, the total estimated annual revenue from BCM can be predicted as in Table 6.
Participation in DAM is also voluntary, being a component of the wholesale electricity market that offers a functional tool to establish the balance between bilateral contracts, the consumption forecast and the technical availability of the producers on the day of delivery. The hourly average prices for a certain period are considered in simulations.
Also, a more complex estimation of the price can be considered with respect to the seasonal influence and other criteria.
Based on power allocation set in Table 26 for weekdays  and Table 27 for weekend days, and average hourly price estimations for each month as in Table 28, the total estimated annual revenue from DAM is calculated as in Table 7. After converting the revenue from Table 7 from RON to Euro (that is 14,813,121 Euro), we can estimate the revenue considering the risk of transaction failure associated with this market as in Table 8. As for the ASM participation, in case a reserve capacity is activated, the producer receives an extra revenue for the energy produced, only for the activation period, in addition to the revenue obtained for the availability of the power reserve capacity. The risk of not being activated can be taken from experience of the producer or is 60-70% by default. Also, the activation period can be estimated as 40 or 50% of the simulation period.
The participation in BM is mandatory for all dispatchable generating units; the power increase offered to balance the system being is calculated at hourly level as a difference between the available power and quantities contracted by participating in the other markets; the power decrease offered to balance the system represents the difference between already allocated power for BCM, DAM, ASM and minimum technic power. The historical hourly average prices for deficit and surplus will be taken from the electricity market operator web-site. The user will choose a level of risk, which by default has a value of 30% and can be modified. Thus, a percentage correction (α) is applied to the estimated revenue or expenses for the simulation period. The total revenue is calculated by weighting with 50% the price for the increase and the price for the decrease of power, the probability of occurrence of the surplus or the deficit being equal.
The revenue from BM can be calculated as following: where: P + BM , P − BM -power for increase/decrease; p + , p − -price for increase/decrease; n -number of days per month or per year depending on the simulation period; α -revenue probability.
The estimated annual revenue from BM and ASM is calculated as in Table 9. The revenue from all markets as resulted from simulation and the total traded electricity volume are calculated for the first trading scenario as in Table 10. Table 10. Overall results for market trading simulation in the first trading scenario -S0 The breakdown in terms of the traded electricity volume and revenue at the market level are calculated for the first trading scenario as in Table 11.
The hourly loading of gas generating unit for the first trading scenario is depicted in Figure 3 for weekdays and weekend days.
The revenue estimation and the electricity volume traded in each market for the first scenario are depicted in Figure 4. Although, most of the electricity volume is traded on DAM and IDM, the revenue level is 27% of the total revenue, whereas in case of BM and ASM, the electricity volume is   about 3% but the revenue level is up to 29%. Thus, similar revenues could be obtained with significant different electricity volume.

B. SECOND TRADING SCENARIO -S1
In the second trading scenario, for the same gas generating unit of 100 MW, the contracted power for BCM was halved and the reserve capacity for ASM was doubled, performing required changes at the DAM level to engage the  entire available power of the generating unit. In this scenario, the results are given in Table 12, showing an increase of the revenue by 10%.
The breakdown in terms of the traded electricity volume and revenue at the market level are calculated for the second trading scenario as in Table 13.   TABLE 13. Breakdown results at the market level in the second trading scenario -S1.
The hourly loading of gas generating unit for the second trading scenario is depicted in Figure 5 for weekdays and weekend days.
The revenue estimation and the electricity volume traded in each market for the second scenario are depicted in Figure 6. Although, most of the electricity volume is traded on DAM and IDM, the revenue level is 28% of the total revenue, whereas in case of BM and ASM, the electricity volume is about 8% but the revenue level is up to 52%.

C. THIRD TRADING SCENARIO -S2
In the third trading scenario, for the same gas generating unit of 100 MW, the contracted power for BCM was increased by 184222 VOLUME 8, 2020 FIGURE 5. Loading of gas generating unit for the second trading scenario -S1. 50% and the reserve capacity for ASM was kept as in the second scenario, performing required changes at the DAM level to engage the entire available power of the generating unit. In this scenario, the results are given in Table 14, showing an increase of the revenue by 13% compared with the first scenario and 3% compared with the second scenario.
The breakdown in terms of the traded electricity volume and revenue at the market level are calculated for the third trading scenario as in Table 15.   The hourly loading of gas generating unit for the third trading scenario is depicted in Figure 7 for weekdays and weekend days.
The revenue estimation and the electricity volume traded in each market for the third scenario are depicted in Figure 8. Although, most of the electricity volume is traded on BCM, DAM and IDM, the revenue level is 75% of the total revenue, whereas in case of BM and ASM, the electricity volume is about 4% but the revenue level is up to 25%.

D. FOURTH TRADING SCENARIO -S3
In the fourth trading scenario, for the same gas generating unit of 100 MW, the contracted power for DAM+IDM and BM represent 86% of the total generation. In this scenario, the results are given in Table 16, showing an increase of the revenue by 34% compared with the first scenario, 27% compared with the second scenario and 25% compared with the third scenario.  The breakdown in terms of the traded electricity volume and revenue at the market level are calculated for the third trading scenario as in Table 17.
The hourly loading of gas generating unit for the fourth trading scenario is depicted in Figure 9 for weekdays and weekend days.
The revenue estimation and the electricity volume traded in each market for the second scenario are depicted in Figure 10. Although, most of the electricity volume is traded on DAM and IDM, the revenue level is 16% of the total revenue, whereas in case of BM and ASM, the electricity volume is about 18% but the revenue level is up to 76%. Thus, similar  revenues could be obtained with significant different electricity volume.
After simulating several scenarios, the market simulator offers variants of approaching various electricity markets estimating potential results for trading. Therefore, the owner of the gas generating unit of 100 MW may choose to allocate the generation capacity based on the simulation results.
The simulation results for the four scenarios are summarised in Table 18, in order to allow a comparative analysis. Elements regarding efficiency and risk were also included.  The proposed model has been implemented and tested as a market simulator application into a software prototype with several modules developed in the SMARTRADE project [41]. Two interfaces of the market simulator application are presented in Figure 11. Thus, the simulator model that we propose is implemented and represents a practical decision-making tool for market participants.

E. SELECTING THE BEST SCENARIO
Taking into account the weights in Table 5 and the summarized results in Table 18 for a gas generator, we propose to compare the scenarios by using a Euclidean type metric on R 4 , where the weights correspond to a gas generating producer type, that is, the values from the last line in Table 5. Therefore, we consider on R 4 the metric d, where for any x, y ∈ R 4 , x = (x 1 , x 2 , x 3 , x 4 ), y = (y 1 , y 2 , y 3 , y 4 ), we have, (24), as shown at the bottom of the page.
Next, for each scenario S i in part we will associate a vector in R 4 denoted S i , having as components the values in table 16 In order to compare the scenarios by using metric d, we will normalize the components in the vectors S i . Let us start with the traded volume on BCM. In our case, the minimum traded volume can be 0% and the maximum traded volume can be 100%. So, we assign to 0% the value 0 and to 100% the value 1. Thinking by direct proportions, it is immediate that we assign to the first component in S 0 the value 0.3875. Let us continue with the discussion on the revenue. Suppose that in the worst case the revenue is 20000000 and in the best possible scenario it is 70, 000, 000. It means that we assign to 20, 000, 000 the value 0 and to 70, 000, 000 the value 1. Now Consequently, the vector S 0 is transformed into a normalized vectorS 0 = (0.3875, 0.42214, 0.2075, 0.41543). Repeating this reasoning, we will transform the vectorsS 1 , S 2 ,S 3 , respectively, into the vectors: Now, we need a so-called ideal vector, for which all characteristics take the best value. It is obvious that the normalized ideal vector is v = (1, 1, 1, 0). The best scenario is the one which is the solution of: VOLUME 8, 2020 By calculation, we get: By using the weighted Euclidean distance, we conclude that the best scenario is S 3 . Let us conduct the same study for a fossil or nuclear type producer. Taking into account the weights for each characteristic in Table 5, this time the metric is given by (26), as shown at the bottom of the page.
For the mean price and revenue, we approximate the same minimal and maximal values. Considering the traded volume on BCM, the minimum is 30% and the maximum is 100%. Therefore, scenarios S 1 and S 3 do not qualify for this evaluation. Next, associate the value 0 to 30% and the value 1 to 100%. It means that for the first component in S 0 , we assign the value: 38.75 − 30 100 − 30 = 0.125 Considering the risk characteristic, in our case this parameter varies between 0% and 35%. Therefore, for the fourth component in S 0 , we assign the value: 29.08 35 = 0.83086 Consequently, the melanized vectorS 0 associated to S 0 isS 0 = (0.125, 0.42214, 0.2075, 0.83086). Repeating this reasoning for the components of scenario S 2 , we obtain the associated vectorS 2 = (0.39157, 0.536, 0.26442, 0.70543). In order to select the best scenario, we need to compute d 2 S 0 , v and d 2 S 2 , v . The smaller value will give us the best scenario. By calculation, we obtain: Thus, in the case of a fossil or nuclear power producer, the best scenario is S 2 .
Using Electre method, implemented in Python, the best scenario is selected. In case the producer is fossil and nuclear type, the best scenario is S2 whereas the gas-powered producer the best scenario is S3 as in Figure 12. Figure 12 (a) shows that S2 is better than S0, S1 and S3 are not viable options, whereas Figure 12 (b) shows that S3 is better than S0, S1 and S2, S1 is better than S0 and so on, helping the producer to choose the best alternative.
For a gas-powered producer, the application of the TOPSIS method on the decision matrix shown in Table 19 recommended the same decision: the choice of scenario S3. With AHP, considering a gas power producer, for each of the four criteria, an analysis of local priorities will be performed for the four scenarios. The following priorities have been assigned for the criteria as in Tables 20-23.
The result indicates the scenario 3 as recommended (as in Figure 13(a)). For a nuclear/coal producer, the result indicates the scenario 2 as recommended (as in Figure 13      It is also important to perform sensitivity analysis (a 'Whatif' analysis) to get an idea of how the results would have changed if the weights of the criteria would have been different. Sensitivity analysis ( Figure 14) allows us to understand how robust our decision is. The more is the sensitivity index, the more is the variable's contribution to making the decision. In the example below, the decision will switch  between S3 and S2 if the value for Revenue changes by (1-48.98%) = 51.02%.
The use of a Euclidean type metric recommends the third scenario as being the best choice for a gas generating producer and the second scenario for a fossil/nuclear producer. Also, the MCDM: Electre, TOPSIS and AHP selected the same best trading scenarios.

V. CONCLUSION
Since any market player (electricity generator, consumer, trader, supplier, etc.) aims to optimize his participation both VOLUME 8, 2020     from technical and financial point of view, according to its technical characteristics and cost, this paper proposes a hybrid approach based on business rules and constraints for modelling the main functionalities of an electricity market simulator, and then focuses on further assisting the user to choose the best of the simulated alternatives.
The main objective of the simulator is to evaluate the expected cash-flow and traded energy for each market, helping the user to make decisions in regards with fuel stocks, trading activities, approaching different electricity markets.
Thus, we have used the European electricity market structure to substantiate and exemplify the analyses, statements and conclusions. Four trading scenarios were simulated for a gas unit and fossil/nuclear unit of 100 MW using updated large data sets of the financial results of the existing electricity markets, scenarios that offer the best trading option. The estimated results of these simulations are analyzed, calculating the total revenue, the traded energy, the financial efficiency and the general risk per scenario. The four scenarios analyzed variants of the producer's participation on four markets: BCM, DAM, ASM and BM, varying the energy quantity contracted on each market.
To select one of the trading scenarios, a MCDM method has to be applied. Four independent criteria were considered the most important for assessing a scenario: the electricity volume traded on BCM, revenue level, risk and also mean price associated with a scenario. Five business rules procedures were proposed to assess the simulation scenarios, considering the criteria weights depending on the user type.
The article proposes the selection of the scenarios by using a Euclidean type metric. The results are validated by applying three other well-known MCDM methods: Electre, AHP and Topsis which indicated similar results. Tables 24-28.