0% found this document useful (0 votes)
10 views

GRENAD

This document presents GRENAD, a framework for simulating and managing smart grids using a multi-agent systems approach. GRENAD allows developing modular and reusable components that can be combined to model complex smart grid applications. It also enables easily integrating optimization algorithms to coordinate smart grid operations.

Uploaded by

Nathaniel Saura
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

GRENAD

This document presents GRENAD, a framework for simulating and managing smart grids using a multi-agent systems approach. GRENAD allows developing modular and reusable components that can be combined to model complex smart grid applications. It also enables easily integrating optimization algorithms to coordinate smart grid operations.

Uploaded by

Nathaniel Saura
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Proceedings of the Federated Conference on DOI: 10.

15439/2015F310
Computer Science and Information Systems pp. 1781–1792 ACSIS, Vol. 5

GRENAD, a Modular and Generic Smart-Grid


Framework
Sylvain Ductor, Jesus-Javier Gil-Quijano, Nicolas Stefanovitch, Pierrick Roger Mele
CEA-LIST, Département Métrologie Instrumentation et Information (DM2I),
Laboratoire d’Analyse de Données et Intelligence des Systèmes (LADIS),
Digiteo lab - bat 565 - Point courrier 192,
91191 Gif-sur-Yvette Cedex - France Bâtiment 425,
Email: {surname.name}@cea.fr

I. I NTRODUCTION consumed locally. Lastly, increased interconnection and infor-


mation exchange between actors enables them to coordinate
Abstract—We present in this paper GRENAD, a Multi-
Agent System based framework for the simulation and pilot- more closely, providing thus a new opportunity to reach higher
ing of power-grids and particularly smart grids. Exploiting a efficiency and revenues.
component-based approach, it allows a flexible design of complex One of the most challenging aspects of smart grids is thus
smart grid applications by providing a generic canvas where ex- at the engineering and at the logical level: the development
tensible, modular and reusable components, defined on the basis of efficient control and coordination algorithms that are able
of their functionalities, can be easily combined and connected.
Thanks to Multi-Agent approach, a set of such components to fully exploit their different potentialities. In order to tackle
can naturally be integrated into a coherent economical agent. these challenges the use of a Multi-Agent Systems (MAS)
GRENAD makes no assumption on the energy definition and approach is particularly relevant as the structure of MAS
eases the development of MAS control algorithms for smart closely match the structure and behaviour of smart grids:
grids. The level of details of the energy-related information is They are constituted of a set of interconnected distributed
controllable. This information is computed either through inter-
nal physical models or by interfacing with external simulators. autonomous actors, each aiming at maximising their respective
We present here our model, illustrate its features with a rich goals through coordination. Also, a given smart grid is com-
example which exhibits its genericity, and demonstrate how a posed by interconnecting differents components (production,
coordination protocol can easily be integrated to it. distribution or storage) that may be used, as is, on another
NERGY supply is at the core economy while being
E also one of the major items of expenditure. Decreas-
ing fossil energy supplies as well as rising concerns about
smart grid. It is thus relevant to adopt a modular approach for
modeling the equipments in a reusable, and thus capitalizable,
way. Therefore a key driver for the deployment of smart grids
climate made it critical to change in the near future the is the conception of a dedicated platform that ease their devel-
way energy is produced, distributed and consumed. Smart opment by exploiting both oriented-component paradigm for
grids are highly automated power networks that possess fine equipment modelisation aspects and oriented-agent paradigm
grained monitoring and control capabilities, from the power for coordination and optimisation aspects.
plant to the domestic appliance. Easy access to information In the context of the Resilent FP7 project [20], we have
and autonomous decision making allow smart grids to save developed such a platform, GRENAD, which stands for
energy by quickly reacting to changes in the environment and “Gestion des Ressources ENergétiques,
reorganising demand, production and distribution. Smart grid Autonome et Distribuée” (Autonomous and
are also meant to allow the massive integration of distributed Distributed Management of Energetic Resources). GRENAD
renewable energy resources (DER) as well as new equipments presents two main aspects. The first is a feature rich API
such as combined heath and power (CHP) generation and and Domain Specific Language (DSL) based on JADE [11]
energy storage. As such smart grids are called to play a crucial which allows to construct component-based JADE agents. As
role in the coming years for the efficient control of power such it benefits of all the features and standard compliance
systems. of JADE and can natively be used in conjunction with other
Hardware for production, monitoring and storage in smart JADE-based applications. The second is a generic smart grid
grids already exist. While still not being widely deployed, model implemented on top of this DSL. Thanks to these two
the penetration of such equipments is constantly progressing aspects, it is possible to easily capitalize and reuse developed
and increasingly supported by legislations. However they raise software across different smart grid applications.
new challenges. Indeed, as opposed to the traditional power While most MAS publications in the smart grid domain
grids approches, energy flows may be intermittent and/or focus on the connection with a simulator or the conception of a
bidirectional. Moreover smart grids technologies also foster new control algorithm, our contribution is a platform that offer
a radical change in the business of energy supply, by allowing enough flexibility to allow an easy interfacing with simulators
the energy to be islanded, it is to say produced, sold and and an easy implementation of control algorithms. Also, each

978-83-60810-66-8/$25.00 c 2015, IEEE 1781


1782 PROCEEDINGS OF THE FEDCSIS. ŁÓDŹ, 2015

main grid (an energy system can work either in connected


or islanded mode w.r.t the main energy grids). In our scenario
we considered a system connected to the main gas and power
grids (represented as components 3 and 4 in Figure 1).
Among the different existing business and organizational
models we can list:
• Free markets: the components are competitors and in-
teract via a market mechanism [12];
• Virtual Power Plant (VPP): combination of produc-
tion storage and consumption resources. A VPP [18] is
adapted when all the resources belong to or are managed
by a single actor;
• Cooperative Virtual Power Plant (CVPP): In a CVPP
Fig. 1. A rich scenario [3] different actors manage/own the different components,
they coordinate in a cooperative way to use shared
resources (for instance centralized storage systems, the
component defining the smart grid can natively be monitored, distribution network, etc.) and provide global services
or even controlled, either by an agent, a GUI, or a remote (for instance: grant the energy balance, the security of
optimisation algorithm. the network and/or the quality of service).
In Section II we present a smart grid scenario exhibiting All these different organizational models can be considered
all critical features for the applications we are interested in. In in our approach. In our scenario we model interactions be-
Section III we present the related work and how they answer to tween components as a free market.
the objectives highlighted by our scenario. In section IV we
present the GRENAD agent and smart grid models and we B. Roles
describe how to implement the scenario with them. In Section
The main roles that we support are producer, storage,
V we show how to easily integrate a smart grid optimization
consumer, prosumer and distribution. The different constraints
algorithms in GRENAD.
and characteristics associated to those roles are described
II. A R ICH S CENARIO below:
In this section we present a district energy system scenario. 1) Producer components: The characteristics of the gen-
The richness of this scenario allows us to demonstrate the eration of energy provided by producers depend on several
capabilities of our MAS based tool to model complex energy aspects:
management systems at the district-level. This scenario ex- • Internal physical constraints: the nominal power (max
hibits most of the main characteristics that challenge today power capabilities), start/stop conditions (time to be op-
the design of smart grid energy management systems [19]: erational/off operation), their efficiency (it is the rate be-
• Interdependence of several energy flows (electricity, heat tween the output generated energy and the input primary
and gas) used energy), and for renewables the variability and the
• Distributed generation and storage capabilities intermittence.
• Interaction with the main energy grids (electricity and • Controllability: The controllability of a given generator

gas) depends on the primary energy source that it uses and on


• Local renewable energy generation capabilities internal state variables. Most of renewable-energy sources
• Prosumers (e.g. wind, solar) are considered non-controllable, it is,
• Diverse consumption profiles their availability and level of energy cannot be controlled.
In the scenario, the considered components (producers, Nevertheless, some renewable based generators can adapt
distribution grid, consumers/prosumers and storage systems) their internal state (i.e. orientation of wind turbines or
are modelled as autonomous agents that interact with the solar trackers) in order to secure and optimally generate
intention of providing real time management at the district energy according to the primary-source real time condi-
level and optimizing the energy production and distribution in tions. Generators whose primary energy supply can be
the district, in conjunction with the main energy networks. controlled provide different control levels, for instance
some generators can only provide on/off control while
A. Business and organizational models others can provide intermediate levels of functioning.
The behaviors of the different components are defined by In our scenario we consider two producers (the components
their individual roles and their internal characteristics (phys- 1 and 2 in Figure 1): a set of wind turbines for power gen-
ical, economical, quality of service, etc.). Those behaviors eration and a Combined Heating and Power (CHP) generator
are constrained by the business and organizational models of that generates both power and heating from combustion of
the system as well as by the interconnection mode to the gas. Gas is provided by the main gas grid (component 3 in
SYLVAIN DUCTOR ET AL.: GRENAD, A MODULAR AND GENERIC SMART-GRID FRAMEWORK 1783

Figure 1) and can be stored nearby the CHP. The system is also C. Planing and operation
connected to the main power grid (component 4 in Figure 1). Due to the temporal inertia of most of the components
The gas and the power main grids are considered in our model (e.g. time to start or change generator command level;
as controllable producers, it is, we consider that the quantity of thermal inertia on houses and distribution networks; time
gas or the power drawn from the main grids can be controlled. to charge/discharge storage systems) and the use of non-
In the real system only the gas flow can be directly controlled, controllable sources (that are intermittent and variable), the
the drawn power from the main grid is indirectly controlled energy usage needs to be planned before actual generation and
and corresponds to balance needed power, it is, the consumed delivery. In our approach, we consider planning strategies that
power minus the local producer power. are combined to real-time operation strategies. Planning is
2) Storage components: The behavior of a storage com- based on estimation of the consumption loads and generation
ponent depends mainly on its nominal capacity, its rate of capabilities and allows to establish negotiated (i.e. agreed by
charge/discharge and its instantaneous state of charge (SoC). all parties) generation, storage and consumption schedules.
Other important variables are the efficiency of the conversion For the renewable based generators, the estimation depends
in the charge and discharge phases and the self-discharge rates. on weather and generation capabilities forecasting. For end
The usage of some storage systems, for instance batteries, is consumers, the estimation depends mainly on weather and us-
constrained by the charge/discharge cycling conditions that age forecasting, as well as on thermal inertia evaluation. Those
optimize their efficiency and increase their lifetime. In our different forecasting based estimations lead to inaccuracies at
scenario we consider a thermal storage component (see com- the planning phase. In order to maintain the balance between
ponent 6 in Figure 1). consumption and generation and minimize the use of external
generated energy, we implement and operate a mechanism that
3) Distribution components: The distribution of energy allows the near real-time correction of energy schedules when
generates losses due to the physical characteristics of the deviations of generation and load are detected (monitored or
transportation system used (i.e. transmission capabilities, dis- forecasted). This mechanism can be seen as a capacity market
sipation rates, etc.) and the distances of transmission of the where global flexibility is provided by the combined individual
energy. In general, at the district level, the electricity losses due flexibility capabilities (e.g. deferrable load, dedicated storage
to distribution are negligible while the heating and hydraulic capabilities, etc.)
(heating network related) losses are not. Some distribution
components (as valves in heating networks and some types D. Real-Time payment
of transformers) allow the dispatching of input energy among Smart-Grid also aims to adapt the consumption to the energy
different outputs. While the availability of energy over elec- production capacity. This is particularly critical when some
trical networks is instantaneous (electricity is transmitted at producers are not controllable (e.g. weather dependant renew-
about the speed of light), the transmission of energy over able energy source). By exploiting for instance a building
heating and cooling networks, due to the transport inertia, thermal inertia, it is possible to respect a required comfort
needs significant time (several minutes per km) to go from level while adapting the actual consumption.
the injection to the consumption points. In our scenario we A commitment of the consumer on how it will consume
consider local heating and power networks: all the production energy allows to optimise energy production and distribution
and consumption components considered in the scenario are during the planning. Several payment approaches [22] propose
connected to at least one of these distribution networks. to impose penalties if such a commitment is not respected
4) Consumer components: The characteristics of the energy during operation phase. The actual payment of a consumer
consumed, basically their load curves, depend mainly on the is thus computed by comparing its planned and operational
buildings physical characteristics (i.e. thermal inertia, storage consumption along with some other production-related and/or
capabilities), the behaviors of the inhabitants (presence/ab- conventional parameters.
sence, used services) and the comfort constraints (e.g. ambient III. R ELATED W ORKS
temperature set points). In our scenario we consider two
Actual testing and deployment of smart grid software
consumers, the components 7 and 8 in Figure 1.
require platforms able to directly support the execution of
5) Prosumer components: Besides the characteristics that control software developed following as well as the ability
define the load curves of the consumer components, prosumers simulate or even pilot power systems. Among the few available
can partially or totally cover their needs in energy and under commercial systems that target specifically smart grids, only
some conditions produce energy surplus that can be injected a bit of them follow the MAS approach.
into the main or local energy grids. In our scenario we consider The available commercial software that simulate and control
one prosumer (component number 5 in figure 1), that locally traditional grids [15], [7], can to some extent be used to
produces power thanks to the PV solar panels installed on its simulate parts of a smart grid, notably for the distribution
roof. It uses part of this energy for self-consumption and is aspect. However, smart grids possess several specificities that
able to inject part of this energy into the power distribution preclude the use of such software for the full chain control.
network. On the other hand, smart grid software have not reached
1784 PROCEEDINGS OF THE FEDCSIS. ŁÓDŹ, 2015

this level of maturity and are mostly experimental or at the We first present our agent model, then we present our smart-
level of academic research. Dedicated software solutions for grid model and last we describe how to formalize the scenario
smart grids exist independently, for different aspects presented thanks to this model.
in this scenario: storage simulation and dimensioning [10],
DER integration [5], demand side management [9] and VPP A. Agent Model
[2]. While none of these commercial software uses a MAS GRENAD is implemented as an overlay of JADE. It pro-
approach, PowerMatcher [17] is an exception. It can perform vides a Domain Specific Language (DSL) that exploits a
simulation and piloting and uses auction protocols to interact component-based approach in order to describe the agents and
over a market of flexibilities. enhance JADE with a set of native services (agent building
Among non commercial software, GridLab-D [4] is a no- system, ergonomic agent messaging service, generalized sup-
table one, it is a low level electrical simulation tool based port of a publish/subscribe system, . . . ). The agent building
on a MAS paradigm. It allows to assign different profiles system simplifies the use of JADE for defining agents at
of consumption to the devices on the network, but fails to compile time and runtime (initialisation step). The first class
represent economic actors and is not able to endow agents to understand in the agent building system is GrenadAgent.
with advanced smart behaviours that react to change in their A GrenadAgent<ID extends GrenadIdentifier>
environment. can be viewed as a pair made of an identifier of type Id and
Most academic works in smart grids consider separately the a list of components. It is an implementation of the builder
development of a platform, a model and control algorithms. pattern from [6, p. 97]: the identifiers and components hold all
As such they provide very limited reusability and interoper- the information required to build a JADE Agent exposing all
ability between the different layers. Platforms in the literature the natively proposed features of JADE as well as non natively
mostly act as a middleware and focus on the coupling of a proposed ones.
MAS platform (JADE [11] being the most popular) with an A GrenadIdentifier is the specification of a JADE
electrical simulator and data exchange formats[1], [23], [21]. AID (the JADE Agent IDentifier): GrenadIdentifier
The designs provided in papers that present models [16], [8] allows to obtain the AID once the JADE agent is set up by
fail to acknowledge either the simulation or the control aspects JADE1 . A component is a stateful and active object that is
and often both of them, limiting their applicability. Finally, executed within the environment of the hosting agent. Such
while most control algorithms are backed by experimental an environment provides access to a set of services shared by
simulations, they are coded specifically for non smart grid all the components of the same agent. We distinguish three
environments and therefore fail to be reused and extended. We groups of components:
believe this shows a clear need for a generic and flexible tool • Action components are components that produce a list
for smart grid algorithms conception, testing and deployment. of JADE Behaviour objects that are to be added in the
In this paper we propose such a tool: a platform and a model to-be-constructed JADE Agent.
that have been thought for reusability in smart grid applications • Runtime components allow to modify the way a
and aims at supporting different smart grid applications at GrenadAgent is handled by JADE. They can modify
all levels. We demonstrate this by exhibiting the coupling the GrenadAgent or execute side effects that depend
of a state of the art distributed control algorithm. Previously on it, at agent set up or take down. They can specify
mentioned works lack an abstract representation encompassing actions to realise while cloning or moving the agent. They
both the socio-economical actors and the physical devices, in can also catch and handle exceptions issued by the agent
GRENAD both are explicitly modeled. execution, which is a functionality not natively proposed
The implementation of GRENAD is based on JADE. JADE by JADE.
is a widely popular generic purpose MAS execution platform • Composite components are collections of components
providing primitives to ease the development of agents and (as such they follow the composite pattern from [6,
deployment of agents [11]. This platform, by being generic, p. 163]). They allow to manipulate a bag of components
lacks support for smart grid elements needed to represent, as if it was a single one. From the agent point of view,
simulate or even control a smart grid. GRENAD extends JADE loading a Composite component is equivalent to
and enrich its capabilities with additional communication loading each component of the collection it represents.
mechanisms and smart grids specific objects and proposes a By definition a component is an independent piece of
component based architecture. software: it has its own state (set of constants, variables and
methods) and has no access to the other components of the
IV. O UR M ODULAR AGENT-BASED S MART-G RID M ODEL hosting agent (except for certain Runtime Components, as it
In this section we present and illustrate our contribution: an is their goal). Certain actions allow to specify their state in a
agent model implemented on top of JADE and a smart-grid separate class and thus easily share it with other components
model implemented on top of our agent model. The conception 1 JADE agent life cycle starts by building the agent, then executes the
has been driven by the Design Pattern approach. For more method setup once the agent is alive. It then executes the method
information about Design Patterns please have a look at [6]. takeDown if the agent is required to terminate, and finally kills it
SYLVAIN DUCTOR ET AL.: GRENAD, A MODULAR AND GENERIC SMART-GRID FRAMEWORK 1785

of the same agent. The goal is to enhance component re- in the latter the sender of a message is decided by the receiver.
usability by separating configuration/decision aspects to ac- Natively proposing both approaches brings a great flexibility
tion/communication ones. For example, different behaviours or in the way of establishing communication neighbourhoods.
protocols may require at some point to have access to the agent Publish/Subscribe Pattern is also well suited for the event-
launch date, its neighbourhood, its preferences or abilities driven approach that characterizes reactive agents.
such as computing an optimal path. Exploiting the Template The approach proposed so far achieves modularity in the
Method Pattern from [6, p. 325] allows to identify those production of multi-agent systems by applying the Builder
methods that ought to be placed in interfaces implemented Pattern on a class that encapsulates its own strategy (i.e.
by the component state. It is then the responsibility of the the list of components), thus allowing to get rid of the
agent to globally implement them in states shared by its “extends” keyword for varying the characteristics of the in-
components, thus ensuring both coherence of its actions and stantiated agent. Indeed the Strategy Pattern, by promoting
efficient factorisation of its code. encapsulation, is more suited than inheritance when it comes
Let us consider, for instance, an auction about a certain to flexibility, re-usability and modularity. Modularity comes
type of objects that runs between an auctioneer and several from the fact that a component can informally be seen as a
bidders. In this process each bidder is characterized by the full and independent functionality. It can be assembled with
value it attributes to the objects. Except for this decision other components in order to easily define a complex agent.
function, all other actions executed during this auction process Component independence is the first root of re-usability. The
are conventions specified by the auction rules. A correctly second root lies in the ability to delegate the responsibility of
factorized implementation would thus define a component the configuration or decision methods to the agent rather than
that encodes the behaviours resulting from those rules and to the components. Hence, given a set of already implemented
exploits the evaluation function on the considered bidders, components, it is possible to build heterogeneous agents
implemented in a separated state. Let us suppose now that by varying their preferences, planning methods, etc.. Lastly,
one of these same bidders has latter participates in a different flexibility is provided by the simultaneous native support
kind of auctions about the same type of objects. The expected of traditional mail-box based message sending and reactive
behaviour for this agent is to evaluate the objects in the same Publish/Subscribe Pattern, which avoids imposing constraints
way. Our "correctly factorized" approach does it naturally upon the initial coupling of neighbours.
since the agent will only need to share the previously used
state with the component executing this new process. B. Smart-Grid Model
Please note that we strongly recommend to avoid data muta-
bility in this approach by only sharing constants and methods. On the basis of the agent structure presented in section IV-A,
If the state has variables, it is up to the programmer to ensure, we propose here a model that allows to describe, simulate
when building the agent, that the different components that and pilot complex smart-grids. In order to do so, it exploits
exploit it do not modify them in an incoherent way. physical models of atomic components as well as simulators
Besides, all the components of a same agent share three of groups of components. It allows a fine-grained remote
services : monitoring and control of the energy distribution given infor-
• Access to the unique identifier of the agent. mation about consumption, production and a “configuration”
• Access to the agent communication service, which allows of each component (i.e. an instantiation of its actuators).
to send messages and have access to the mailbox. Also, actuators can be remotely controlled, thus allowing the
• Access to the publish/subscribe service of the agent. smart-grid to be controled by a user interface (GUI, service
The Publish/Subscribe Pattern (also known as the Observer web, . . . ) or an autonomous decision mechanism. Considered
Pattern, see [6, p. 293]) is natively proposed by GRENAD, be- energy information is projected over time and includes generic
cause it provides an efficient way to decouple communication, multi-flow energy demand, generic offer characteristic and
as opposed to the natural approach of message sending. In the whether the offer can meet the demand at each point of the
Publish/Subscribe Pattern, an agent, the publisher, publishes grid. Relevant physical model can simulate the propagation
whenever it decides any information it finds relevant. It does of blackouts or brownouts. Also several simulations can run
not know a priori who is interested by this information. A simultaneously on the same smart-grid, made mutually depen-
published information is identified by its type, a name set by dent (e.g. planning and operation) and easily compared (e.g.
the publisher, and the identifier of the publisher. A subscriber real-time payment).
agent knows a priori which publication of which publisher it The model proposed here has been implemented in
is interested in. It thus subscribes to it, and indicates at the GRENAD as a collection of components (see Section IV-A).
same time the action it will execute upon the reception of a Hence it can naturally be integrated with other components
new publication (how it will react). It may stop this behaviour and distributed over a network in order to be used in various
at any time by unsubscribing. situations. For instance, it can get its values and set its
Simple direct message exchange and the Publish/Subscribe actuators from and to a physical smart-grid ; it can be used
Pattern are opposed approaches to communication: in the for- as an isolated simulator ; it can be used in conjunction with
mer, the receiver of the message is decided by the sender, while a coordination protocol ; encapsulating agents may interact
1786 PROCEEDINGS OF THE FEDCSIS. ŁÓDŹ, 2015

with real clients ; encapsulating agents may negotiate on stock may define an IncoherentNeighbourhood while it has
market, . . . not received the updated information of the other component.
In this section we present the different aspects of our smart- We distinguish five types of SGField. The first,
grid model: how energy is represented by the different roles, Fixed<A>, has a constant value and, thus, should always
how information about energy is stored and updated, how it be valued. The second and third fields have dynamic values
is transmitted between the agents and projected over time. and exploit the Publish/Subscribe pattern: Output<A> is an
1) Energy and Roles: We consider three roles. observable field that is observed by a Sensor<A> field of a
• A consumer expresses a demand as an amount of energy neighbour. Whenever a new value is set in an Output<A>, it
on the different flows considered (e.g. heat, electricity, is published. The neighbour’s Sensor<A>, upon the recep-
. . . ). tion of the publication, will trigger the occurrence of a new
• A producer expresses an offer, as a function that, given event within the component. This will typically result to the
a demand, returns whether it can be produced. If so, it call of the internal model of the component, which may in
returns also what would be the Quality of Service (QoS) turn update some outputs, thus propagating the information.
(e.g. CO2 impact (in kgCO2 ), base cost (in euros), . . . ). The fourth field, Actuator<A>, is an Output<A> that can
• A distributor distributes the energy among its neigh- be remotely controlled by the fifth field, Controller<A>,
bours. It associates with each consuming neighbour an which is a Sensor<A> that may send a request to implement
offer and each producing neighbour a demand. a new value on the actuator it observes, thus modifying the
A given component has a specific representation of the configuration of the smart-grid.
energy. This representation is structured among two aspects: Each class representing a smart-grid role (consumer, pro-
amount and QoS. No constraints at all are put on these objects: ducer or distributor) is associated in one hand to a set of fixed,
they are only defined w.r.t. the information required by the outputs, sensors and actuators (its state) and, in another hand,
physical models and the simulators used in the considered to an internal model. As stated above, the internal model is
application. However, some components require a manipula- triggered upon the reception of a new event, either a new
tion function to be provided. For this reason, we consider a value observed by some sensors, or the modification of some
dedicated algebra over amounts or QoS. This algebra allows actuators. When called, the internal model will read the value
the component to manipulate energy information as a black of the fixed fields, the sensors and the actuators and update
box, thus ensuring genericity. For instance, let A be an amount, the outputs. The internal model is an abstract method whose
⊕A : A × A 7→ A is an additive operator over A. It allows to implementation is application specific and may rely on some
compute the overall demand of two consumers. ∅A represent simple Java models or complex external physical simulators.
a null amount, i.e. the neutral element of ⊕A . The same goes 3) Links and Information Propagation: In our smart-grid
for QoS. model, the neighbourhood relation is defined using outputs
A Demand<A> is a container of several flows of energy and sensors: each component associates an output to each of
of type A. We implements a flow as a class that extends its neighbours. It also defines a sensor for each output that has
the class A. A Demand<A> can be manipulated, given been associated to him.
an aforementioned algebra over A by simply applying it Sensors may transform the observed information. This al-
independently on each of its flow. lows to easily implement link losses or maximal capacity. Sen-
An offer Offer<A, QoS> is a function from sors may also change the type of the information. Hence, given
a Demand<A> to an Optional<QoS>. An a function from A to B, an Output<A> can be observed by
Optional<QoS> can either be a value of type QoS, a Sensor<B>. This allows to easily connect heterogeneous
if the producer has the capacity to satisfy the demand, or be components.
empty if it cannot. Note that each component is associated to a group. Only
2) State, Fields and Internal Model: The state of a smart- outputs and sensors of the same group can interact. This
grid component is defined as a collection of a dedicated allows a same agent to load different instances of the same
class of fields, SGField<A>. An SGField<A> allows to component, each being uniquely identified by its group.
handle asynchronicity by outputting four types of values: (1) Thanks to this architecture, it is easy to do simultaneously
an object of type A if it has been correctly instantiated (in the current operation phase and tomorrow planning phase
this case, the field is said to be valued), (2) NotReady if on a same agent. The latter may easily compute its real-
some information is still missing or some computation is still time payment by comparing the outputs of its planning and
running on, (3) IncoherentNeighbourhood if an infor- operation components.
mation received from some neighbour is incoherent and (4) The three roles (consumer, producer or distributor) rely
InvalidInternalState if the instantiation of the state on a strict neighbourhood architecture. Figure 2 presents the
of the component is invalid w.r.t. the internal model. Note that neighbourhood relation between the roles. Next to the role
we do not throw any exception, since the states 2, 3 and 4 can is represented the type of its output; each output is mirrored
come from a delay of communication due to asynchronicity by a sensor of the neighbour. For clarity, we always consider
or distribution. For instance, if two neighbours are required to in this article homogeneous components: they use the same
modify their configuration, the first that receives the request energy representation, (A, QoS).
SYLVAIN DUCTOR ET AL.: GRENAD, A MODULAR AND GENERIC SMART-GRID FRAMEWORK 1787

implementations of the inner function model, which is set


Offer Supplier Demand Supplier
at construction time (see strategy pattern). For instance, a
* * constant will return the same value for all the dates, a scatter
Dist. graph is only defined on a discrete set of date, a step function
is defined on a range of dates . . . . Many other models can be
Demand Supplier * * Offer Supplier thought of, however, in order to be exploitable they have to
implement the following set of methods.
Offer Supplier 1 1 Demand Supplier Let us consider FV<A> (FV stands for Field Value), an
abstract class that can only be instantiated as one of the five
Prod. Cons. types of value that can be returned by an SGField<A>. An
SGField<A> delegates from its inner function model2 :
Fig. 2. Relation between roles • SGField<B> map(Function2<Date,FV<A>,FV<B>
> f), a function that transforms a SGField<A> to a
SGField<B>, given a function that takes a date, a
Consumers and producers are seen as clients of the distribut- FV<A> and output a FV<B>.
ing network. For this reason, they have exactly one neighbour, • SGField<C> zipWith(SGField<B> that,
which is a distributor. They are responsible for defining either Function3<Date,FV<A>,FV<B>,FV<C> >
their demand (consumers) or their offer (producers), which f), a function that aggregates a SGField<A> and a
is then observed by the distributor. A distributor may have SGField<B> into a SGField<C>, by applying a
several neighbours, either consumers or producers. The result function on the couple of values associated to each date.
of the distributed propagation of energy information is that Both functions aim to provide required generic features,
every distributor outputs an offer to each of its neighbour while preserving the fact that the inner model is a black
consumer and a demand to each of its neighbouring producer. box. map allows to modify the content of an SGField.
A distributor may also have several distributor neighbours. For For example, you can trigger a “maximum of capacity” for
each couple of distributor neighbours, one must be consuming a planning of offers or “losses” on link transmission by
and the other producing. The attribution of the role results from mapping the appropriate function into the initial planning.
the internal models that may rely, for instance, on the value of zipWith allows to combine two SGField objects into one.
actuators. Indeed, the distributor neighbour which consumes For example, a planning of demand and a planning of offer
outputs a demand and observes an offer, and conversely can be combined into a planning of Optional<QoS>, which
for the producing one. If the neighbours disagree on their results, at each date, from the application of the demand to
respective roles, they will output an IncoherentState. the offer. If the f parameter of zipWith is a binary operator
We refer to a distributor neighbour that has the consumer (rep. (i.e. A equals B equals C), zipWith may be used to fuse a
producer) role as a consumer (resp. producer) neighbour of a collection of SGField<A> into one SGField<A>.
distributor. We refer to a distributor neighbour that is either Note that the f parameters of zipWith and map take the
the consumer (rep. producer) or a distributor that is consuming date as argument. This allows to implement time-dependent
(resp. producing) as a consuming (resp. producing) neighbour operations which is critical for any application that depends
of a distributor. on the weather. For example the losses on a heat pipe may be
This model has been designed in order to perfectly separate dependent on the external temperature, which can be predicted
the responsibility of each role. Consumer internal models are with weather information.
only concerned by the definition of the demand. Producer Note that there exist several ways to simplify the f pa-
internal models are only concerned by the definition of the rameters of zipWith and map. First, if you do not con-
offer. Distributor internal models take as input the demand sider a time-dependent application, you can build a function
and the offer and are only concerned about their distribution. f : Date × A → B from a function f ′ : A → B
This abstract model is the basis of our components. Concrete by simply returning the application of A to f ′ whatever
classes require to implement specific internal models. Such the date is. Second, you can consider a conventional way
models exploit specific actuators or outputs/sensors. Con- of handling NotReady, IncoherentNeighbourhood
trollers allow a dynamic reconfiguration of actuators, by either and InvalidInternalState by order of criticality.
a distributed or centralised algorithm, in order to optimize the If the mapped initial value (or one of the zipped
energy distribution. value) is an InvalidInternalState, the resulting
4) Projection over time: In Section IV-B2, we value is an InvalidInternalState. Or if it is an
presented an SGField<A> as a container of either IncoherentNeighbourhood the resulting value is an
A, NotReady, IncoherentNeighbourhood or IncoherentNeighbourhood since the internal state is
IncoherentInternalState. However, it is a more valid but not w.r.t a neighbour internal state. If it is NotReady
complex class. Indeed, it is a planning, i.e. a function, that, the resulting value is a NotReady since it means that there is
given a date, returns one of those four values or Undefined
if no value is associated to the date. We propose several 2 this approach is inspired from the category pattern[13]
1788 PROCEEDINGS OF THE FEDCSIS. ŁÓDŹ, 2015

Dist0, then Dist3 then Dist1 then Dist2 to go back to Dist0.


ProsHouse Simultaneously, there is a tree shaped network, the electricity
PV Panel network, that connects the root, Dist0 to Dist1, Dist2 and
Dist3. For instance, the link between Dist0 and Dist1 only
Main Power Grid
transmits electricity information, the one between Dist3 and
Wind Farm Dist3 Dist1 only heating information and the one between Dist0
and Dist3 convey both. We choose to connect all the main
power producers into a single distributor, Dist0, however, Dist0
Main Gas Grid CHP Dist0 Dist1 House1
may hide a complex subnetwork. Indeed, it is possible to fuse
several distributors into one distributor. For instance, one could
Heat Storage Dist2 have modelled Figure 1 with only one distributor instead of
Dist0, Dist1, Dist2 and Dist3 or even including Heat Storage
and CHP. The same operation is feasible with consumers (or
producers) connected to a same distributor. Please note that,
House2 in this case, one looses direct access to some information.
For example, if one fuses every distributor into a single one,
GRENAD will provide an easy access to all the information
Fig. 3. Formalisation of Figure 1 scenario
from and to the producers and consumers but not necessarily
the information between the distributors. This feature allows to
a priori no error, but a computation is going on and we should design the application with total control of the level of details.
wait for its completion. Hence, it is possible, using these This is particularly useful for delegating the computation of
rules, to automatically build a Function<FV<A>,FV<B> the distribution of energy of certain local parts of the system
>, from a Function<Optional<A>,Optional<B> > to an external simulator.
where Optional<A> is of type A if a value is associated to We will now detail the implementation of the components.
the considered date or of type empty if no value is associated 1) Consumers: Consumers (a.k.a House1, House2 and
(i.e. type Undefined). The third and last way of simplifying ProsHouse) may be implemented in different ways. Each im-
the f parameter is to consider that if the mapped value or one plementation should provide an output that defines a demand
of the zipped value is Undefined, the result is Undefined. at any time and is aware of the neighbour distributor offer.
This allows to get rid of the Optional. Also, an enhanced consumer may implement a mechanism
Hence, given those three simplifying rules, to manipulate similar to the one described in Section V in order to adapt its
an SGField<A> one can rely most of the time consumption by coordinating, during the planning phase, with
on SGField<B> map(Function<A,B> f) and its distributor neighbour. Besides, thanks to the controller of a
SGField<C> zipWith(Function2<A,B,C> f) dedicated actuator, one can provide a total control to a remote
for time-independent application and on SGField<B> end-user during the operation phase.
map(Function2<Date,A,B> f) and SGField<C> 2) Common distributor: The distributors Dist0, Dist1, Dist2
zipWith(Function3<Date,A,B,C> f) for time- and Dist3 have as sole function to distribute the energy
dependent applications. The richness of our model allows coming from the producers to the consumers. The stability
however more fine-grained control on relevant cases. of a grid requires electricity to respects the Kirchoff law:
the flow in must equal the flow out3 . For this reason, we
C. Implementing the scenario propose a generic distributor class, the KirchoffStar.
Figure 3 is the formalisation of the scenario of Figure 1 This distributor is characterized by an actuator that indicates
described in Section II. Figure 3 uses the same convention the part of the overall demand associated to each of the
as Figure 2: producers are boxes, consumers circles and producing neighbours. Hence, this actuator holds a map that
distributors diamonds. One can verify that Figure 3 is conform associates, to each producer and distributor neighbour, n, a
to the specification of Figure 2. number pn ∈ [0, 100]. pn is the percent of the sum of the
Economic actors are modelled using different components, consumer neighbour demands that the producing neighbour
each one characterising one functionality of the actor. Com- n has to satisfy. The actuator values, at each time point, is
ponents House1 and House2 define the consumption of the valid if it respects the Kirchoff law, that is to say the sum of
elements 7 and 8 of Figure 1. They are respectively associated the pn equals 100. Note that if a distributor neighbour n is
to Dist1 and Dist2, which define the quality of production of consuming, pn will be null.
the energy they are supplied with. CHP and Heat Storage are Reciprocally, we associate to each consumer the QoS that
distributors since they both consume and supply energy. corresponds to the part of its consumption w.r.t. the overall
The links model interactions between actors; arrows are consumption. For example, let us suppose that three consumers
oriented from production to consumption. Both links and 3 Note that as explained in Section IV-B3, losses, or any link related
components are multiflow. There is a neighbourhood relation modification of the energy, are handled during the communication between
in form of a ring, the heating network, that goes along an output and its sensor
SYLVAIN DUCTOR ET AL.: GRENAD, A MODULAR AND GENERIC SMART-GRID FRAMEWORK 1789

with a demand expressed on the considered flow at the 4) Storage: The Storage unit is a distributor with two
considered time point, as 3, 2 and 5 kWh. Let us suppose neighbours that can be decomposed as three internal compo-
that there are two producers, the first assuming 30% of the nents. It holds a consumer, which defines a demand, an internal
consumption and the second 70%, as such, the first will assume state, which holds the information about the stored energy, and
3 kWh and the second 7. Let us suppose that the first producer a producer, which defines an offer. The demand is output to
emits 4 kgCO2 for producing 3 kWh and the second 6 for one of the neighbours and the offer to the other.
producing 7 kWh. Hence, the first consumer demand will be The decision related to the storage is about how much
associated to a QoS of 3 kgCO2 , the second to a QoS of 2 energy is stored and at which time, this is why the storage
kgCO2 and the third to a QoS of 5 kgCO2 demand is held by an actuator. The internal state is a pri-
However, our model requires the distributor to output not vate output that holds the stored energy in the form of a
a QoS but an offer, that is to say, a function that associates demand, which may be initially not null. It is updated by
to any demand a QoS, if this demand is satisfiable. The offer the storage demand, which adds energy, and the observed
output to each consumer is computed under the hypothesis consuming neighbour demand, which subtracts energy. Also a
that it is the only one changing its demand. Let proddist be special function defines losses by modifying the internal state
the offer function associated of a given distributor, dist. A accordingly.
given demand a is distributed by dist to each of its producing The maximum capacity offer is defined by the internal state.
neighbor, n, according to their associated pn . This offer is The QoS of energy offered to the storage consuming neighbour
computed for the demand a as the sum of the QoS returned by is independent of the consuming neighbours demand. Indeed,
each those neighbours for their associated part of the demand. the offered energy has already been produced at the time it is
Let P roducingdist be the set of the considered producing stored. Hence, the consuming neighbours are informed of this
distributor neighbours, QoS even if their demands are null. For any time point t, let
t
QoSstor be the QoS returned by the application of the demand
of the storage at time t to the offer of its producing neighbour
∀a ∈ Demand < A >, proddist (a) =
( at time t (assuming this demand is sustainable). Let storedt
empty if some neighbour can’t supply it’s part be a demand indicating the stored energy at time t (i.e., the
(1)
internal state). For any demand at of the consuming neighbour,
P
n∈P roducingdist of f ern (a × pn ) else
the storage can assume at if at is inferior to storedt , and the
t
The offer output to a consumer cons, outputcons , considers offered QoS is always equals to QoSstor .
proddist as if all other consumers had already consumed. Note that, if necessary, you can encode the fact that the stor-
Let Consumingdist be the set of the considered consuming age unit can not simultaneously store and deliver by triggering
distributor neighbours, and, for any c ∈ Consumingdist , let an InvalidInternalState whenever a positive value of
ac be its demand, the demand actuator matches a positive value of the observed
demand of the consuming neighbour.
∀a ∈ Demand < A >, outputcons (a) = 5) Main Grids: Main gas and power grids are typically
X producers that are out of the scope of control of the considered
proddist ( ca ⊕ a) (2) smart-grids. Hence, they do not provide any actuators. If
c∈Consumingdist \cons GRENAD is used as a simulator, they will be implemented
with a predefined offer to output. If it is used as a piloting tool,
Please note that this approach is coherent with the above they exploit the interface pattern for two purposes. Firstly, to
mentioned examples. It also provides more information and get the information from the external system they represent
allows to still use a simple model that only considers two and construct from it an offer, and secondly, ot transmit the
types of information, demand and offer. demand computed by GRENAD in the appropriate format.
3) Prosumer: The prosumer house with PV panel needs to 6) CHP: The CHP unit offers energy both on the heat
be separated into 3 components. One defining the offer (PV and the electricity flows. It is a distributor since it transforms
Panel), the other the demand (ProsHouse) and the third the energy by consuming it from the main gas grid and supplying
distribution (Dist3). Please note that, in case the PV panel it to Dist0. The CHP offer to Dist0 is computed from the main
does not have any actuator and provides energy only to the gas grid offer, and an internal actuator that indicates how much
house, it is possible to remove this component and only use of the energy consumed is used to produce electricity and how
a “gain” on the links, implemented thanks to the sensors much is used to produce heat. CHP demand to the main gas
(see Section IV-B3). In this case, the sensors of Dist3 and grid is computed back from Dist0 demand given the internal
ProsHouse both transform the observed output over time by actuator value.
applying the weather-dependent prediction of the production 7) Wind Farm: In our scenario, the orientation of the wind
of the PV Panel. If it is not the case, a separate element is farm turbines is controlled by the application. Hence, the
required, either to be able to receive actuator modifications wind farm producer provides a collection of actuators, each
or to be seen by Dist 3 as a source of energy that can be one defining the orientation of the turbine it is associated
distributed to the network. with, along the time. Those actuators can either be manually
1790 PROCEEDINGS OF THE FEDCSIS. ŁÓDŹ, 2015

controlled by a remote end-user or dynamically optimised by that the demand is satisfied or detects any demand that would
a coordination mechanism run by GRENAD (see for instance violate the flow conservation constraint or the capacity.
Section V). The algorithm requires the network to be tree shaped (e.g.
In the application we are considering, the objective is electric network), and proceeds in two phases. In the first,
typically to optimise the energy production, distribution, and the collect phase, information is going from the leaves to the
consumption as a whole. The optimisation of the wind farm root: each node acquires and transmits to its parent the overall
production is not about maximising independently their pro- consumption and production information about its subtree. In
duction but coordinating the production of the different pro- the second, the propagation phase, information is going from
ducers (main grids and CHP) as well as the storage units in the root to the leaves: each node decides an optimal power
order to optimise the overall QoS of the energy supplied to dispatching given the one of its parent.
the consumer. One may also wants to include the consumer in Implementing this algorithm in GRENAD is done in the fol-
order to match the consumption with the production capaci- lowing way: each distributor possesses an actuator named pro-
ties. GRENAD ergonomically supports the implementation of posal for each of its distributor neighbours, and observes with
such a coordination protocol by exploiting the state pattern a sensor the proposals of these respective neighbours. This
coupled with the natively proposed publish subscribe pattern, communication network allows the information required by
as described in the next section. However, the definition of the proposal phase to be transmitted from point to point. Each
such a protocol in the complex case of this rich scenario is actuator is updated by the optimisation algorithm. GRENAD
behind the scope of this article. allows transparently this optimisation algorithm to be either
located at the level agent or in a remote controller. For the
V. O PTIMISATION OF ENERGY DISTRIBUTION sake of clarity, in this section, we refer to the initial state of
sensors and outputs of the KirchoffStar as regular sensors
In order to present the genericity and flexibility of GRENAD
and outputs.
we describe in this section the port in GRENAD of a dis-
The implementation exploits the state pattern: a given
tributed algorithm that performs an optimal distributed dis-
behavior is associated to a certain instantiation of the proposal
patching of electrical power over radial networks. The pre-
and regular sensors, output and actuator. We distinguish three
sented algorithm solves a distributed constraint optimisation
states:
problem and is a part of [14], the port to GRENAD introduces
some modifications. First, GRENAD generic way of handling 1) Not Ready distributor: the distributor did not already
energy allows to easily apply the presented algorithm in a receive enough information from its neighbours to be
more general context than [14] (see Section V-B). Second, the able to act. It is therefore waiting.
combination of the State Pattern, from [6, p. 305], with the na- 2) Collect Ready distributor: all but one of the distributor
tively implemented publish/subscribe pattern allows a simple neighbours has instantiated their proposal actuator, the
description and implementation of the distributed algorithm. only neighbour that has not instantiated its proposal
In particular, no effort have to be put on the communication, is then considered as its parent and the others as its
one only needs to focus on how each component reacts to the children. When a distributor is in this state, it computes
observed state of its neighbourhood. and instantiates its proposal actuator.
We first expose an overview of the distributed algorithm, 3) Propagation Ready distributor: all distributor neighbours
then we describe some hypothesis on the production, and last, have instantiated their proposal actuator. The distributor
we details the two phases of the algorithm. has then enough information to compute an optimal
distribution between itself and its neighbours. The opti-
A. Overview of the Distributed Algorithm mal distribution for this component is implemented by
instantiating its regular outputs. Also, it is propagated
The application cases of the algorithm are composed of by providing instructions to its children by the mean of
consumers and producers with a static demand and offer. its proposal outputs.
All of them can be directly represented using the proposed
In the next section we detail how a proposal is computed
model, the nodes being modeled as distributors, which extend
and how the optimal configuration is determined.
the KirchoffStar class. We also use the sensor/output
algorithm, described in Section IV-B3 to implement maximum B. Production Characteristics
capacity of the links. The solution computed by the algorithm
defines: for each producer, the demand it will have to deliver, In order to compute an optimal distribution, certain hypoth-
for each consumer, the QoS resulting from its demand, and, esis have to be made on producers. We consider a smart-grid
for each distributor, the percent of the overall demand of where the energy demand is modeled as an amount A and
its consuming neighbours it will require from each of its the quality of production as QoS. We consider the following
producing neighbours. At the end, if the offer can answer algebra over A and QoS, required by the computation of the
the demand, an optimal distribution will be implemented, following sections:
A
otherwise all consumers will be informed that the network is • ⊕ is a binary operator over A,
QoS
overused. The use of the KirchoffStar class either ensures • ⊕ is a binary operator over QoS
SYLVAIN DUCTOR ET AL.: GRENAD, A MODULAR AND GENERIC SMART-GRID FRAMEWORK 1791

• ≻A is a preorder over A. neighbours, d,˙ which is its parent. The overall demand of
• ≻QoS is a preorder over QoS. d subtree4 is computed as the sum of the demands of its
In this section, a producer refers to a tuple (p, maxPp , ∝p consumer neighbours and its children proposals. The list of
, of f erp ), where p is its identifier, maxPp is the maximum producers of d subtree is computed as the union of both its
amount of energy it can produce, ∝p is a comparable object producer neighbours and the producers listed in its children
that allows to compare producers with respect to their quality proposals.
of production and of f erp is their offer function. A higher ∝ Let Excessd be the difference between the line capacity
(given ≻∝ ) is equivalent to a better quality of production, i.e. and the overall demand of d subtree. Two cases are possible:
: (1) Excessd is negative or null, in which case the parent can
answer the demand without any restriction. In this case, the
∀p, q producers, ∀a ∈ A, a ≺A maxPp ∧ a ≺A maxPq , proposal of d is defined as the list of producers and the overall
∝p ≻∝ ∝q ⇐⇒ of f erp (a) ≻QoS of f erq (a) (3) demand of its subtree; (2) Excessd is positive, in which case
the answer of the parent is limited by the transmission line.
In [14] the author considers a single energy flow whose amount The exceeding amount has then to be assumed by the subtree.
is expressed in kW h, and encodes ∝ as the slope of a linear In this case, d proposal demand is defined as the line transmis-
function that associates a CO2 impact to the production of a sion capacity. The exceeding power is dispatched in an optimal
given amount of energy. way using distopt on d subtree list of producers. For each
In this setting, given a set of producers, an optimal distri- producer p of d subtree, let localp be the demand attributed
bution is obtained by saturating the production of producers to p by the aforementioned call of distopt . d proposal offer
in decreasing order of ∝. This is done by distopt , a function is then a modified list of producers of its subtree. First, for
that considers a set of producers and an amount of energy that any p, localp is subtracted from maxPp . Second, for any p,
returns for each producer the amount of energy it must produce of f erp is modified into of f erp′ by assuming that localp is
ˆ opt is a function that exploits
in the optimal distribution. dist produced, i.e. :
the result of distopt and returns the part of the consumption
attributed to each producer in the optimal distribution, in order ∀a ∈ Demand < A >, of f erp′ (a) =
to instantiate the actuator of the KirchoffStar. of f erp (a ⊕Amount localp ) (4)
C. Collect Phase D. Propagation Phase
A proposal is computed by a Collect Ready Distributor A distributor, d,˙ is in the Propagation Ready state if all
and transmitted to its parent, which will have to decide the of its neighbours have either defined their proposal (i.e. they
flow of energy between them. The information provided by are its children) or they outputs (i.e. there is exactly one,
a Collect Ready Distributor in a proposal to its parents is which is its parent in the network tree or zero if it is the
(1) the list of producers of its subtree, composed of the root of the network). Such a distributor has the responsibility
producer neighbours listed in its children proposals and its to determine a globally optimal distribution to each of its
own producer neighbours, and (2) the overall demand of the neighbour by instantiating its outputs. To do so it considers
consumers of its subtree, computed from the overall demand the overall demand and the list of producers of its subtree.
provided by its children proposals and the demand of its Those information are computed from the children proposals,
consumer neighbours. Given this proposal, the parent has to the consumer and producer neighbours and the possible parent,
decide, during the implementation phase, whether it considers which can either be seen as a producing or as a consuming
neighbouring distributors to be producing or consuming. It neighbour.
also has to decide of the amount of energy demanded to For each producer p of its subtree, let prodopt p be the
producers, the remaining energy of the overall consumption demand it must assume in an optimal distribution. prodopt p
being assumed by the producers of the subtree. Please note is computed by distopt applied on the overall demand and
that the transmitted energy between a distributor and its parent the list of producers of d˙ subtree. To each child d of d,˙ is
cannot exceed the maximum capacity of their power line. attributed the total amount of energy, P rodopt
d , the child should
Hence, proposals are modified so that the overall demanded supply in a globally optimal solution. P rodopt d is computed
consumption does not exceed this limit. Exceeding energy is as the sum of prodp for any p belonging to P ropOf
opt
d
f er
.
deduced from the subtree producers offer. Three cases are possible: (1) P rodopt Demand
d = P ropd , which
The proposal of a Collect Ready Distributor, d, is a tuple means that in an optimal solution d subtree supports exactly
(P ropOf
d
f er
,P ropDemand
d ) where P ropOf
d
f er
is a list of pro- its demand. No energy is transmitted between d and d.˙ This
Demand
ducers and P ropd a demand. They are computed as subnetwork can be isolated; (2) P rodopt > P ropDemand ,
d d
follow: Let Consd be the set of consumer neighbours of d, which means that in an optimal solution d subtree supports
P rodd , the set of its producer neighbours, and Childd , the set its own demand and offers some exceeding energy. In this
of its distributor neighbours that have defined their proposals. case d˙ is configured so that it is demanding this exceeding
To say that d is a Collect Ready Distributor is equivalent
to say that Childd refers to all but one of its distributor 4 the subtree of the network whom root is d
1792 PROCEEDINGS OF THE FEDCSIS. ŁÓDŹ, 2015

opt Demand would be to improve the reliability of the platform by inte-


energy from d; (3) Рrodd < Рropd , which means
grating model checking capabilities.
that in an optimal solution d subtree does not support its own
demand. In this case, ḋ is offering the difference to d, REFERENCES
ḋ declares itself as a producer whose maximum produc- [1] Kyle Anderson, Jimmy Du, Amit Narayan, and Abbas El Gamal.
tion is the remaining demand. Please note that in this case, Gridspice: A distributed simulation platform for the smart grid. In
even if d does not support its own demand, some of its pro- Modeling and Simulation of Cyber-Physical Energy Systems
(MSCPES), 2013 Workshop on, pages 1–5. IEEE, 2013.
ducers may no be used in the optimal configuration. How- [2] BOSCH. Vppm. https://www.bosch-si.com/solutions/energy/virtual-
ever, a distributor always consumes first all the energy of- power-plant/virtual-power-plant.html.
fered by its parent. [3] Georgios Chalkiadakis, Valentin Robu, Ramachandra Kota, Alex
Rogers, and Nicholas R. Jennings. Cooperatives of distributed energy
resources for efficient virtual power plants. In The 10th International
VI. CONCLUSION Conference on Autonomous Agents and Multiagent Systems – Vo-
lume 2, AAMAS ’11, pages 787–794, Richland, SC, 2011.
In this work, we have presented GRENAD, a JADE-based International Foundation for Autonomous Agents and Multiagent
framework, that allows to describe, simulate and pilot smart Systems.
power grids. The aim of GRENAD is to provide a great flex- [4] US DOE. Gridlab-d. http://www.gridlabd.org/.
[5] HOMER Energy. Homer. http://www.homerenergy.com/.
ibility in the design and implementation of smart power grids [6] Ralph Johnson Erich Gamma, Richard Helm and John Vlissides.
applications, so that it can be used either as a standard basis Design Patterns: Elements of Reusable Object-Oriented Software.
to build and test such applications or as an interface to moni- Addison-Wesley, 1995.
tor and pilot actual grids. As such, it is compliant with the [7] ETAP. Etap. http://www.etap.com/.
[8] Bou Ghosh, Jingpeng Tang, et al. Agent-oriented designs for a self
main business and organizationals models: it proposes the healing smart grid. In 2010 First IEEE International Conference on
classical roles of production, consumption, prosumption, dis- Smart Grid Communications, pages 461–466, 2010.
tribution and storage. GRENAD allows time-dependant [9] TRILLIANT Inc. Trilliant. http://www.trilliantinc.com.
[10] Electric Power Research Institute. Esvt. http://www.epri.com/
monitoring and computation; it supports both internal physi- abstracts/Pages/ProductAbstract.aspx?
cal models and connection to external ones; it provides flexi- ProductId=000000003002000312.
bility in manual, automatic or autonomous processing of the [11] Tellecom Italia. Jade. http://jade.tilab.com/.
[12] J. K. Kok, C. J. Warmer, and I. G. Kamphuis. Powermatcher:
computed energy-related information; and finally it eases the Multiagent control in the electricity infrastructure. In Proceedings of
integration of distributed smart grid control algorithms. To the Fourth International Joint Conference on Autonomous Agents
meet these objectives, GRENAD exploits a combination of and Multiagent Systems, AAMAS ’05, pages 75–82, New York, NY,
USA, 2005. ACM.
Multi-Agent and component-oriented paradigms. Such an [13] Miran Lipovaca. Learn You a Haskell for Great Good!: A Beginner’s
approach allows to build complex agents using simple reus- Guide. No Starch Press, San Francisco, CA, USA, 1st edition, 2011.
able components and, thus, capitalize the development of ap- [14] Sam Miller. Decentralised coordination of smart distribution
plications. networks using message passing. PhD thesis, University of
Southampton, February 2014.
We also have proposed a model of smart-grid that handles [15] NEPLAN. Neplan. http://www.neplan.ch/.
demand and offer and rely on the most general interpretation [16] Manisa Pipattanasomporn, Hassan Feroze, and S Rahman. Multi-
of consumption, production and distribution. The informa- agent systems in a distributed smart grid: Design and implementation.
In Power Systems Conference and Exposition, 2009. PSCE’09.
tion about energy exchanged by the agents is complex. In- IEEE/PES, pages 1–8. IEEE, 2009.
deed, it does not impose any assumption on the energy defi- [17] Flexible Power. Powermatcher. http://flexiblepower.github.io.
nition, which can be a combination of several flows and it is [18] D Pudjianto, C Ramsay, and G Strbac. Virtual power plant and
system integration of distributed energy resources. IET
projected over time. Also, its management handles asyn- RENEWABLE POWER GENERATION, 1:10–16, 2007.
chronicity of computations and incoherence of states. The [19] Sarvapali D. Ramchurn, Perukrishnen Vytelingum, Alex Rogers, and
use of algebras and the category pattern[13] allows an effi- Nicholas R. Jennings. Putting the ’smarts’ into the smart grid: A grand
cient and ergonomic processing of this information. Also, challenge for artificial intelligence. Commun. ACM, 55(4):86–97,
April 2012.
GRENAD does not require to deal with communications, [20] Resilient. Resilient project. http://www.resilient-project.eu/.
since it implements a transparent event-driven approach for [21] S Schutte, Stefan Scherfke, and M Troschel. Mosaik: A framework for
information exchange, supported by the publish-subscribe modular simulation of active components in smart grids. In Smart
Grid Modeling and Simulation (SGMS), 2011 IEEE First
pattern. Lastly, we demonstrated the ease of implementation International Workshop on, pages 55–60. IEEE, 2011.
of a generic sophisticated optimization distributed algorithm [22] G. M. Team. Electricity and gas supply market report. Technical
thanks to this architecture and the state pattern. Report 176/11, The Office of Gas and Electricity Markets (Ofgem),
December 2011.
Future works include the development of more component [23] Chia-han Yang, Gulnara Zhabelova, Chen-Wei Yang, and Valeriy
libraries, of simulator interfaces and of dedicated optimiza- Vyatkin. Cosimulation environment for event-driven distributed
tion algorithms. Another interesting line of development controls of smart grid. Industrial Informatics, IEEE Transactions on,
9(3):1423–1435, 2013.

You might also like