• No results found

Global Structure and Integration with MASCEM

Chapter 3. ALBidS: Adaptive Learning Strategic Bidding System

3.2. Global Structure and Integration with MASCEM

ALBidS integration with MASCEM is an essential process for the success of this work. This integration had to take into account the good practices in terms of software engineering, and high care had to be taken when defining ALBidS architecture.

The definition of the ALBidS global structure has been based on a careful analysis on how the system should behave, both in an internal, independent perspective, and also in what concerns its connection and efficient communication with MASCEM. For that it was necessary to consider in a high account the design of its structure in terms of programming issues, while at the same time guaranteeing the higher possible performance in what concerns the agent’s (both ALBidS’ internally, and with MASCEM’s) interconnectivity and communications.

To provide players adequate decision support, the system agents access a database containing the log of the system’s events, and the historic electricity market data. Figure 3.1 presents the data model used by ALBidS.

Figure 3.1 – Data Model [Sousa, 2011].

Each MASCEM negotiating agent bids in the market for each period of each day. The information regarding all the agents’ bids is stored in the Bids table. This data includes the indication of the success that each bid got on the market. These bids are subject to an error, which is especially relevant in the case of bids resulting from strategies based on forecasting techniques. The error is saved in the ErrorData table. This information is used by several strategies which require the competitors’ log of actions to support the self strategy’s action proposal. These tables are dependent on a ScenarioID, indicating the scenario that the simulator is running. When a new simulation is started, the user is able to choose to continue an existing scenario, with a specific number of agents, with already set characteristics, or, on the other hand, to create a new scenario, defining all the MASCEM simulation options. When ALBidS is being used for a previously existing scenario, it is able to use the simulation data that was saved before to support the strategic behaviour. The scenario dependent data includes the statistics used by the Main Agent to choose among the proposed bids, and also the historic market prices, saved in the MarketData table. This table is filled with the historic market prices, which may be from different markets relevant to the required studies. This historic data is used as reference for the market price forecasts, and it is updated, depending on the scenario, with the prices resulting from the simulation, this way it is kept updated with the actual market prices.

When designing the ALBidS system, high importance had to be given to defining its architecture, as it is one of the first decisions and steps to take when one pretends to develop a computer system. The architecture depends on the characteristics of the system, and will influence all its conception. Choosing the MVC (Model-View-Controller) architecture (Figure 3.2) ensured the independence between the data (model), the user interface (view), and the business layer (controller).

Figure 3.2 – Interaction between the MVC architecture components.

ALBidS is integrated with the MASCEM simulator through the MainGUI class, the class that is responsible for the ALBidS user interface (presented in section 3.4) and for creating the ALBidS model classes. The MainGUI class contains an instance of the AlbidsController class, which is responsible for making the connection with the rest of the ALBidS system, manipulating the domain objects and the system’s agents (Figure 3.3).

Figure 3.3 – Controller and Domain classes.

As it can be seen in Figure 3.3 the AlbidsController class contains the list of the MASCEM agents (AlbidsAgent instance) to which the ALBidS system will be providing decision support. The selection of these MASCEM agents is done by the user when creating a new scenario or starting a simulation. Each AlbidsAgent instance contains an AlbidsRla instance, with the information regarding the reinforcement learning algorithm that will be used (see section 3.6 – Main Agent), and a list of the strategy agents that will contribute to the decision support of this particular MACEM agent (AlbidsStrategy instances).

These domain objects are created when the user chooses to initiate a simulation in MASCEM. The controller provides the required information to the ALBidS agents (see the sequence diagram of Figure 3.5), completing the connection between the MASCEM simulator and ALBidS.

Figure 3.4 shows the connection between the controller class and the ALBidS Main Agent.

Figure 3.4 – Controller and ALBidS agents’ classes.

The ALBidSMainAgent class creates an agent for each strategy (instances of the ALBidSStrategyAgent class), which will be responsible for executing the corresponding strategy.

Figure 3.5 contains a sequence diagram, demonstrating the full system interaction, from MASCEM to ALBidS, starting from the request for the beginning of a simulation. Figure 3.6 presents the detailed process of the initializeSimulation method, of the AlbidsController class, where the creation of the ALBidS system classes takes place.

Figure 3.5 – Sequence diagram of when a simulation is started.

Figure 3.6 – ALBidS classes instantiation.

From an agents’ perspective this system is composed by the following entities, which will be presented throughout this chapter: Main Agent, Prolog Facilitator Agent, Game Theory Agent, Regression Agents, Composed Goal Directed Agent, Adapted Derivative Following Agent, Market Price Following Agent, NN Agent, AMES Agent, Average Agents, SA-QL Agent, Error Theory Agents, Economic Analysis Agent, Determinism Theory Agent, and Metalearner Agents.

ALBidS is connected with the MASCEM simulator, providing a response to the negotiating players when they require intelligent support to act in the market. The connection between the two systems is managed by the Main Agent, using the Prolog Facilitator. This agent, presented in section 3.6, acts as an intermediary between the two systems. It receives requests from the negotiating players when they require decision support, and provides them the corresponding answers. These answers are provided after managing the ALBidS internal mechanism, including the interactions with the strategy agents (or bid proposal agents) – the agents responsible for executing the different strategies. The ALBidS integration with the MASCEM simulator is presented in Figure 3.7.

Figure 3.7 – ALBidS integration with MASCEM [Pinto et al., 2011c].

The communications between the agents of this system are managed by the Prolog Facilitator presented in the section 3.3, this way making it possible for this system to be integrated in MASCEM, with the communications treated separately from the rest of the simulation, guaranteeing the independence and parallelism between the distinct groups of agents.