<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Grid Mind: Prolog-Based Simulation Environment for Future Energy Grids</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Grid Mind: Simulating Future Energy Grids</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Faculty of Informatics, Masaryk University</institution>
          ,
          <addr-line>Brno</addr-line>
          ,
          <country country="CZ">Czech Republic</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Mycroft Mind</institution>
          ,
          <addr-line>a. s., Brno</addr-line>
          ,
          <country country="CZ">Czech Republic</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2015</year>
      </pub-date>
      <history>
        <date date-type="accepted">
          <day>5</day>
          <month>6</month>
          <year>2015</year>
        </date>
      </history>
      <abstract>
        <p>Fundamental changes in the current energy grids, towards the so called smart grids, initiated a range of projects involving extensive deployment of metering and control devices into the grid infrastructure. Since in many countries, the choice of supportive information and communication technologies (ICT) for the grid devices still remains an open question, benchmarking tools aimed at predicting their behavior in the deployed solution play an essential role in the decision-making process. This paper presents a Prolog-based simulation environment, named Grid Mind, primarily intended for the very purpose. The tool was successfully used to generate simulation scenarios in several smart-grid related projects and became a self-standing simulation tool for the evaluation of information and communication technologies used to deliver lowvoltage metering and monitoring data. The tool is continuously evolving, aimed to become an integral part of the future energy grid design in the Czech Republic and beyond.</p>
      </abstract>
      <kwd-group>
        <kwd>Simulation Environment</kwd>
        <kwd>Smart Grid</kwd>
        <kwd>Communication and Networking</kwd>
        <kwd>ICT</kwd>
        <kwd>Prolog</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>JAN ROSECKY1;2, FILIP PROCHAZKA2 and BARBORA BUHNOVA1</p>
    </sec>
    <sec id="sec-2">
      <title>1 Introduction</title>
      <p>
        With the growing emphasis on energy security policies, the electricity distribution
grids are currently facing a profound transformation challenge. The new approach,
referred to as the smart grid, implies intelligent distribution throughout the grid,
aiming at automated problem detection and handling as well as power balancing in
order to minimize distribution-related losses and fully use the potential of
unregulated renewable power sources
        <xref ref-type="bibr" rid="ref1">(Amin and Wollenberg 2005)</xref>
        .
      </p>
      <p>
        Having up-to-date, accurate and complete data is crucial for achieving the
aforementioned goals, hence serious attention must be paid to measuring and detecting
mechanisms as well as distribution of relevant data to other grid agents. The latter
implies the need for a solid communication and information-technology
infrastructure developed along with the energy infrastructure. Its requirements, side-by-side
with the economical and legal constraints, form an investment dilemma of vital
importance for the future development of the energy grids (
        <xref ref-type="bibr" rid="ref16">Patel et al. 2011</xref>
        ; Tref
        <xref ref-type="bibr" rid="ref12">ke
et al. 2013</xref>
        ).
      </p>
      <p>
        Apart from the pilot projects, simulation has been playing a major role in the
design of smart-grid solutions. A number of smart grid simulation tools and
environments has been introduced (Mets et a
        <xref ref-type="bibr" rid="ref13">l. 2014</xref>
        ), focusing on simulating the
communication and power infrastructure of the grid. However, power distribution companies
still require more detailed analysis of the behavior of regular data reading,
signaling and control processes planned in particular deployment scenario, which shall
better support the design of their smart grid solutions. Together with the
particularities of the Czech distribution grids, this need has formed an opportunity for
close academia and in
        <xref ref-type="bibr" rid="ref5">dustry cooperation in 2010</xref>
        , when the development of the Grid
Mind simulation environment began. Soon after that, the deployment of 3.5 million
intelligent end-point meters (smart meters) was simulated in the CERIT Scientific
Cloud with the help of the devised concepts
        <xref ref-type="bibr" rid="ref3">(Křenek et al. 2013)</xref>
        .
      </p>
      <p>
        In this paper, we introduce a SWI Prolog-based smart-grid simulation tool,
named Grid Mind, used as a rule-based simulation scenario generator in
        <xref ref-type="bibr" rid="ref3">(Křenek
et al. 2013)</xref>
        and continuously developed since. The tool has become a self-standing
smart grid simulator, whose second generation was successfully used in several
industrial projects with practical implications.
      </p>
      <p>The paper is structured as follows: An overview of related work, mainly focusing
on other smart-grid simulation tools and environments, is presented in Section 2.
Section 3 introduces the overall architecture of the domain-independent core of the
tool and its main components. A brief presentation of the modeling approach used
in a real industrial project is provided in Section 4. Finally, Section 5 sums up the
lessons learned, reflecting on the major issues and drawbacks, most of which are
being solved in the on-going work, also mentioned in the section.</p>
    </sec>
    <sec id="sec-3">
      <title>2 Related Work</title>
      <p>
        Recently, an extensive review on existing smart grid modeling and simu
        <xref ref-type="bibr" rid="ref13">lation tools
(Mets et al. 2014</xref>
        ) concluded that the growing importance of simulating smart grid
dynamics is mostly driven by two needs: to evaluate either (1) demand-response
strategies in local communities, so-called smart grid cells, or (2) overall wide-area
monitoring, protection and control architecture.
      </p>
      <p>
        As for the former, various agent-based energy and communication infrastructure
co-simulation tools have been introduced to analyze the influence of different types
of control strategies, e.g. dynamic pricing or centralized control algorithms, on the
grid cell sustainability. Mosaik (
        <xref ref-type="bibr" rid="ref19">Schütte et al. 2012</xref>
        ) is a powerful modular
Pythonbased simulation environment, enabling an integration of existing simulators in
order to simulate the power dynamics of areas comprising thousands of nodes.
        <xref ref-type="bibr" rid="ref11">(Kosek et al. 2014)</xref>
        present the comparison of two power and communication grid
co-simulation frameworks (MasSim resp. JadeSim and IPSYS-DE), orchestrated in
Mosaik.
        <xref ref-type="bibr" rid="ref15">(Mets et al. 2011)</xref>
        present a comprehensive simulation environment
using the OMNET++ simulator as a development platform. The Coupled Simulator
        <xref ref-type="bibr" rid="ref2">(Bergmann et al. 2010)</xref>
        is built on Network Simulator NS-2 and the commercial
Siemens’ Power System Simulation (PSSTM) as a benchmark to newly developed
communication and control techniques.
      </p>
      <p>
        The wide-area monitoring, protection and control simulators test the influence
of real-time sensor data availability on the overall grid stability guaranteed by the
supervisory control and data acquisition (SCADA) systems. EPOCHS
        <xref ref-type="bibr" rid="ref8">(Hopkinson
et al. 2006)</xref>
        combines the PSCAD/EMTDC power simulator and NS2 network
simulator in a co-simulation, glued together with the Runtime Infrastructure (RTI).
Another approach, based on the High-Level Architecture (HLA), is presented in
        <xref ref-type="bibr" rid="ref7">(Georg et al. 2012)</xref>
        , where DIgSILENT PowerFactory and OPNET network
simulator are coupled together as H
        <xref ref-type="bibr" rid="ref13">LA federates. (Lévesque et al. 2014</xref>
        ) have only
recently introduced a preliminary implementation of a HLA-based simulator with
the ambition to cover all the three smart grid perspectives, as presented in
        <xref ref-type="bibr" rid="ref10">(IEEE
2011)</xref>
        : the power systems, the grid communications and the related information
technology. The time-stepped co-simulator implementation integrates OMNET++
with Java processes generating IEC 61850 communication protocol messages.
      </p>
      <p>Our work touches both the measuring-data harvesting (e.g. for demand-response
strategies) and grid monitoring and control, complementing the state of the art
with a more in-depth analysis of the dynamics of metering-data delivery delay and
incompleteness, caused by simultaneous data transfers and communication channel
overloading, as well as the influence on the data volume and transaction load on
the metering data management system.</p>
    </sec>
    <sec id="sec-4">
      <title>3 Grid Mind Platform</title>
      <p>
        Grid Mind
        <xref ref-type="bibr" rid="ref18">(Rosecky 2015)</xref>
        is a modeling and discrete-event simulation tool built in
SWI Prolog, primarily aimed at analyzing the behavior of a particular smart-grid
information and communication infrastructure, hardly predictable due to the
emergent nature of the modeled environment. The platform supports automated
simulation execution and evaluation, including the export of the results into the GMIG
visualization framework
        <xref ref-type="bibr" rid="ref17">(Pompe 2015)</xref>
        . Primarily, the tool was used to estimate the
abilities of a given infrastructure to collect and provide particular types of data,
analyzing the data freshness, completeness and reliability, rapidly changing with
the number of concurrently executed data transfer jobs. The environment is
controlled via the Prolog console, the models are formed using a versatile Prolog-based
domain-specific language. The choice of a logical programming language facilitates
the knowledge representation and orientation in the muddle of models, information
from the simulation runs and their results. Moreover, the choice was made with
regards to several constrained optimization problems expected to be solved in the
future, e.g. synthesis of an optimal set of model parameters according to a specific
price function or solving complex constraint-based queries, indicating the future
integration of constraint logic programming (CLP).
      </p>
      <p>The overall architecture of the domain-independent environment core (of Grid
Mind v2), presented in this section, is depicted in Figure 1. Element storage and
transformation tools form the structural core of the environment, described in
Subsections 3.1 and 3.2 – a knowledge base to build the models in. The Modeler parses
the model language into a canonical representation using a definite clause grammar
(DCG). The three solver components, handling the model dynamics, are presented
in Section 3.3. Finally, Self Monitor provides a simple logging interface, and Model
Browser is responsible for json export to the GMIG visualization framework using
the HTTP JSON library.</p>
      <sec id="sec-4-1">
        <title>3.1 Knowledge Representation</title>
        <p>Model elements and relations between them form a (hyper)graph, stored in the
Storage component, extended and modified during the simulation using a set of
functions provided by the Transformer component. The elements and relations
are represented as Prolog terms and predicates, respectively, stored in a Prolog
database. An element in Grid Mind v2 notion is a compound term of arity 3, where
the first argument is the name of the element, the second argument is a list of its
abstractions and the third argument is so-called element construction, a list of roles
the element plays in domain relationships. An exemplary element is in Figure 2.
The relations used for orientation in the spectrum of elements, whose semantics is
described further in this section, are: (i) abstraction, (ii) role, (iii) context member,
and (iv) causality.</p>
      </sec>
      <sec id="sec-4-2">
        <title>Abstraction</title>
        <p>
          Elements represent concepts on various levels of abstraction and detail. Thus, in
order to enable the construction of more general models or meta levels, elements
are not classified into classes, instead, they are placed into an abstraction hierarchy,
inspired by the notion of concept lattices
          <xref ref-type="bibr" rid="ref21">(Wille 1992)</xref>
          . “To be an abstraction of” , or
“to be a specialization of” for the inverse direction, forms a many-to-many relation,
used to grow the element ontology, with the following semantics:
Definition 1. An element S is a specialization of an element A iff S possesses all
attributes of A except for those explicitly redefined.
        </p>
        <p>In the second generation of the tool, the notion of attributes referred to roles.
The third generation extends it to all relations (with the exception of abstraction).</p>
        <p>The environment is responsible for attribute inheritance, fostering the code
reusability: When an element attribute is searched, than if not found at the queried
element, it is sough on the higher levels of the abstraction hierarchy.</p>
        <p>An example of an abstraction hierarchy chain is:
power_grid_element secondary_substation node_substation substation_1234</p>
        <p>According to the hierarchy and the definition of node_substation in Figure 2,
substation_1234 will also power 30 consumption points without having to state
it explicitly.</p>
      </sec>
      <sec id="sec-4-3">
        <title>Role</title>
        <p>Domain relations, be it between elements or an element and a general term, are
modeled using so-called roles. “To play a role for” is a ternary relation, used to
model domain relations, with the following semantics:
Definition 2. Value V plays role R for element E iff E has a property named R
with value V .</p>
        <p>In Grid Mind v3, a role is also considered to be an element. That allows the
definition of role ontology as well as structuring the roles into contexts, facilitating
the queries (e.g. get all the location characteristics of a given element) by bringing
additional mechanisms of role polymorphism. Definition of node_substation in
Figure 2 assigns value 30 to node_substation role how_many_consumption_points</p>
        <p>If V is also an element, an inverse role can be defined:
Definition 3. IR is an inverse role to R iff for every pair of elements E 1, E 2: E 1
plays role R for element E 2 iff E 2 plays role IR for element E 1.</p>
        <p>The support of the use of the inverse roles in queries is now being implemented
in the third generation of the tool.</p>
      </sec>
      <sec id="sec-4-4">
        <title>Context</title>
        <p>Contexts form logical clusters of elements, often serving as sub-models of particular
problems. E.g.</p>
        <sec id="sec-4-4-1">
          <title>E.ON distribution grid; Procedures related to a data reading process; Simulation run. 6</title>
          <p>Definition 4. Element E is a member of context C iff it fits the context definition,
i.e. is a logical part of the context.</p>
          <p>In the third generation of the tool, the relation will become ternary, taking into
account the role a particular element plays in a given context.</p>
        </sec>
      </sec>
      <sec id="sec-4-5">
        <title>Causality</title>
        <p>The simulation nature of the environment implies the need to record the causalities
between events. As further mentioned, event reactions cause additional events in
the future, making the causal relationship ternary:
Definition 5. Action A is a causality between events E 1 and E 2 iff A caused E 2
in reaction to E 1.</p>
        <p>
          A series of predicates used to store, update and query the aforementioned
relations, as well as the transitive and reflexive closure of the binary ones, forms the
conceptual core of the simulation environment. Blurring the barrier between types
and instances naturally supports the construction of domain-specific modeling tools
without getting lost in "meta-muddle", as described in
          <xref ref-type="bibr" rid="ref6">(Favre 2005)</xref>
          .
        </p>
      </sec>
      <sec id="sec-4-6">
        <title>3.2 Lambda Elements</title>
        <p>
          Potential relation dependencies and stochastic relations motivated the need to work
with implicitly constructed relations, with actors derived as a result of an
operation. Procedural knowledge-base attachments called lambda-elements or lambdas
are used for this very purpose. The name has been chosen to emphasize the
conceptual connection to transparent intentional logic – TIL (
          <xref ref-type="bibr" rid="ref5">Duží et al. 2010</xref>
          ), built
upon the lambda calculus.
        </p>
        <p>Definition 6. Lambda element is a compound term of arity 4:
lambda_elem( Id, Variables, Guards, Predicates ),
evaluable for given Variables iff Guards hold, and
true for given Variables iff evaluable and Predicates hold.</p>
      </sec>
      <sec id="sec-4-7">
        <title>3.3 Solvers</title>
        <p>The dynamics of the environment is handled by a set of so-called solvers—engines
used to generate elements or generally modify the element graph using model
lambda elements. Lambdas are often parts of rules passed to the solvers.</p>
      </sec>
      <sec id="sec-4-8">
        <title>Extension Generator</title>
        <p>Depending on the nature of relations that an element participates in, it can be
classified either as an extension or an intension. The TIL-inspired classification indicates
to which extent the element is modeled explicitly or, complementarily, the amount
of lambda elements used in the element construction. An (ultimate) extension is
an element whose relations contain no lambda. The more the element relations are
constructed using lambdas, the more intensionally-modeled the element is.</p>
        <p>Intensions form a natural way of defining patterns for generating, especially
when particular role values for a given set of elements are picked randomly or
depend on one another. The generating process is realized by so-called extension
making—constructing explicit form of element by finding values of its
intensionallyconstructed relations, evaluating their lambda elements. When evaluated lambdas
contain non-deterministic predicates, multiple extensions with all admissible
relation combinations can be generated.</p>
        <p>Pseudo-code in Algorithm 1 in Appendix A represents a naive extension
making process used in Grid Mind v2, where an evaluable lambda is sought within
all element’s unevaluated lambdas. When the lambda is evaluated, the process
repeats, since the evaluation may have influenced evaluability of other lambdas by
instantiating a free variable shared by the lambdas. The cycle loops until a fixed
point is reached, meaning no further lambdas can be evaluated. Grid Mind v3 will
implement more sophisticated extension-making strategy, based on variable
dependency graph. In that case, when seeking an evaluable lambda, only so far untested
lambdas or those, whose guards variables may have been instantiated by one of the
evaluated lambdas, are to be tested on evaluability.</p>
      </sec>
      <sec id="sec-4-9">
        <title>Context Generator</title>
        <p>Also referred-to as Production Rule Solver, the Context Generator represents an
approach to element or general term generation, mainly used for the data exports.
Initial rules, containing lambdas returning initial collection content, form the
bootstrap of the resulting collection. Iterative rules contain lambdas determining the
set of records to be added to the resulting collection based on its current content.
The solver iteratively processes the collection until a fixed point is reached,
meaning no further new records are added. The pseudo code of the process is presented
in Algorithm 2 in Appendix A. The solver proves particularly useful for obtaining
constrained breath-first search results initiating from a given set of elements, e.g.
for finding transitive consequences of a given event.</p>
      </sec>
      <sec id="sec-4-10">
        <title>Consequence Generator</title>
        <p>Finally, the Consequence Generator handles the actual simulation process.
Simulation timeline is a queue of events to be processed, sorted by their timestamps.
Intensionally-defined registered actions (subscriptions) may react to the events,
producing a set of output events to be put back into the timeline. After adding the set
of initial events (e.g. “start a measuring process”) to the timeline, the Consequence
Generator can be executed to run a simulation, ending either when the queue is
empty, or with an explicit termination (while handling an event). Causalities are
recorded and stored during the simulation. Algorithm 3 in Appendix A represents
the pseudo-code of the simulation run process.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>4 Models</title>
      <p>
        Our approach to simulation analysis builds upon the TIL notion of possible worlds
(
        <xref ref-type="bibr" rid="ref5">Duží et al. 2010</xref>
        ), following the pattern:
1. Model world(s). The model data can be either (i) set manually in the model
files; (ii) imported, e.g. from csv files or (iii) modeled intensionally, using fuzzy
properties shared by classes of agents.
2. Extensionize world(s), use the Extension Solver to generate a set of
possible worlds containing individual agents, respecting the intensional model
definitions.
3. Simulate world(s), use the Consequence Generator to run the simulation
of each world.
4. Evaluate world(s), export and analyze the simulation results.
      </p>
      <p>This implies that apart from the simulation itself, the responsibilities of the
environment also include the execution of individual simulation runs, orchestrating
the entire analytical process. In its full extent, the environment and related
visualization framework should be able to provide extensive assessment of a given set of
possible technical solutions under different conditions. Practical reasons why so far
this has not been made possible are discussed in Section 5.</p>
      <sec id="sec-5-1">
        <title>4.1 Case Study: Communication Technologies Assessment in</title>
      </sec>
      <sec id="sec-5-2">
        <title>Low-Voltage Monitoring</title>
        <p>This section presents the crucial models and preview of result visualization from a
recent simulation project, assessing the communication technologies for transfer of
low-voltage metering and monitoring data in a prepared pilot project of a Czech
energy distribution company. Since the planed deployment of the monitoring devices
within the project scope only covered tens of secondary substations in different
locations, the simulation was used to assess the influence of sharing a communication
medium, particularly a base transceiver station (BTS), by multiple substations in a
fully-deployed setting, meaning every secondary substation equipped with a
monitoring device. Assuming the independence of an individual cluster of substations
around a BTS, the problem was reduced to simulating the behavior of 8 clusters,
each containing approximately 10 substations obtaining smart meter data from
individual consumption points. The simulated scenarios covered one week of life with
various cellular network communication technologies implemented, under changing
conditions including dynamic external load in the used communication network
infrastructure or dropouts of individual communication devices at end-point meters.
The dynamics of the following characteristics was observed: (i) data delivery
latency; (ii) reliability (percentage of successfully transferred data) of measurement
data reading, signaling and command transmitting; (iii) communication network
data load; (iv) end-system data and transaction load.</p>
        <p>The communication infrastructure was modeled as a graph of network devices
connected via communication lines. A channel connecting two devices refers to a
graph path (lines and devices) between them. The model of a network line has been
abstracted to the following characteristics with values added based on pilot project
observations:</p>
        <p>Throughput, meaning the amount of data transmitted through a line or
device at a time unit. Channel throughput is equal to the minimum throughput
of a channel component.</p>
        <p>Latency, constant delay added to the throughput-caused delay for every data
transfer. Channel latency is equal to the sum of the component latencies.
Reliability, i.e. the probability of losing or damaging a transferred message.</p>
        <p>Reliability of a channel is equal to the product of its component reliabilities.</p>
        <p>Expected delivery time of a data batch of size S , transferred through a channel
with latency Lch , comprising component C with throughput Tc, external load Exc
and amount of concurrent transfers Ac, was computed as:</p>
        <p>S
= min Tc Exc + Lch</p>
        <p>c2ch Ac</p>
        <p>
          When starting a new transfer or finishing an old one, the volume of transferred
data and new delivery-time estimates were computed for every transfer sharing
a channel component with the affected transfer. Transported data batches
corresponded to those of IEC 60870-5-104 protocol
          <xref ref-type="bibr" rid="ref9">(IEC 2006)</xref>
          , used in the pilot project.
        </p>
        <p>The used network communication models are a subject to further discussion and
verification, planned to be conducted in cooperation with other Czech universities
in the upcoming months. Our experience suggests that a similar abstraction can be
applied to the communication models without a significant loss of precision of the
behavior characteristics of the overall simulation setting. Interface to an existing
network simulator would inevitably cause a drop of performance, closing the door
to an efficient state-space analysis of a particular technical solution.</p>
      </sec>
      <sec id="sec-5-3">
        <title>Case Study Results</title>
        <p>The conducted project have shown that the introduced environment can be
successfully employed for realistic simulations demanded by industry. The SWI Prolog
database used as a knowledge base core is able to handle hundreds of thousands of
element records, each having from tens to thousands of connections. When loaded,
the overall general smart grid model comprised over 1,000 elements. Over 6,000
elements were stored in the knowledge base when the project models have been
extensionized. Apart from other elements, simulation runs ended up generating
150,000 up to 400,000 events during 5 to 20 minute run times, depending on the
complexity of the simulated scenario.</p>
        <p>Figure 3 represents an exemplary simulation output. The setting simulated daily
data reading procedures via the public GPRS infrastructure. The upper timeserie
presents normalized portions of hourly simulated dropouts of communication
devices at end-point meters and external network load, potentially caused by
extensive data transfers in the area when using a public telecommunication operator’s
network. The lower timeserie represents the resulting hourly line load caused by
(compressed) metering data transfers. As can be seen, lowering the capacity of the
communication media raises the overall volume of transferred data, due to
repetitive transfers. On the other hand, dropouts of individual communication devices at
end-point meters prevent them from communicating at all, shifting the load to the
following days.</p>
        <p>The crucial contribution of the project covered not only the results of the
conducted analysis but also the structured representation of the modeled problem,
revealing the potential of the used knowledge base architecture. Both helped
establishing a solid ground for the planned deployment of the metering and monitoring
devices onto the secondary substations in the Czech Republic.</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>5 Discussion</title>
      <p>The second generation of the tool proved its usefulness in a number of projects,
which at the same time helped us to identify the areas of possible future
development. This chapter sums up the lessons learned from the usage of Grid Mind v2.</p>
      <p>Due to complex model structure, dependencies and a set of specific predicates
designed to use the environment, there is room for improvement from the usability
perspective. In particular, the tool usability could be improved by encapsulating the
model – extensionize – simulate – evaluate approach (see Section 4) entirely into the
notion of the models. In order to do that, models should state their dependencies
explicitly in a model header, to be processed by the model reader component.</p>
      <p>Stochastic nature of the models requires multiple simulation runs to be
executed in order to get statistically-relevant results. Extensive simulation analysis in
a single-threaded Grid Mind v2 could be sped-up by the parallelization of individual
simulation runs. When implemented, not only will Grid Mind be able to determine
the probability characteristics of a particular solution, also extensive state-space
analysis, determining the system behavior under various conditions, could be
conducted on a computation grid in a matter of minutes.</p>
      <p>
        The uprising interest of the Czech energy distribution companies, outlining
several upcoming projects, has recently initiated the development of the third
generation of the tool. The aforementioned points triggered a range of design changes,
improving the tool performance and usability. The design of the conceptual core is
still a subject to further research. Particularly a comparison with existing
Prologbased approaches like
        <xref ref-type="bibr" rid="ref3">(Chaudhri et al. 2013)</xref>
        or
        <xref ref-type="bibr" rid="ref4">(Chisham et al. 2011)</xref>
        could be
interesting.
      </p>
    </sec>
    <sec id="sec-7">
      <title>6 Conclusion</title>
      <p>The paper introduces the Grid Mind modeling and simulation environment,
currently used for the analysis of smart grid information and communication
technologies. The environment core is domain independent, believed to be usable for any
simulation-analytical task. Domain models are structurally represented in a
knowledge base, forming a graph of elements and relationships between them. Various
abstraction levels, connected by the abstraction-specialization relations, represent
a way of creating reusable model patterns, adjustable for specific purposes.
Trinity of solvers handle the model dynamics, including the simulation engine and the
generator of model elements. The models cover individual technical processes and
routines, including reading and error-handling strategies.</p>
      <p>The environment has been successfully used in several real industrial projects.
The presented case study has validated its usefulness and revealed its capabilities,
as well as its limitations. The architecture of the knowledge storage combined with
the power of the three solvers has shown its potential, not only for the simulation
analysis itself but also for forming a structured knowledge base of the local power
grids and their future-development scenarios. The uprising smart-grid simulation
projects demand in the Czech Republic illustrates how the fruitful cooperation
between academia and industry can effectively solve complex problems in real world.</p>
    </sec>
    <sec id="sec-8">
      <title>Appendix A</title>
    </sec>
    <sec id="sec-9">
      <title>Solver Algorithms</title>
      <sec id="sec-9-1">
        <title>Algorithm 2 Production rule solving process</title>
        <p>procedure solve_prod_rules(+Init_rules, +Iter_rules, -Result_set)
Result _set .add (solve(Init _records))
Changed true
while Changed do</p>
        <p>Changed false
for all Record in Result _set do
for all Rule in Iter _rules do</p>
        <p>New _records Rule.apply_on(Record )
Set _just _changed Result _set .add (New _records)</p>
        <p>Changed Changed _ Set _just _changed
end for
end for
end while
end procedure</p>
      </sec>
      <sec id="sec-9-2">
        <title>Algorithm 3 Simulation run process</title>
        <p>procedure run_conseq_generator(+Tmln_in, +Subscrs, -Tmln_out)
Terminate false
Tmln Tmln_in
while (Tmln 6= []) ^ :Terminate do</p>
        <p>Event _in Tmln.pop()
for all Subscr 2 Subscrs do
if Subscr .reacts_on(Event _in) then</p>
        <p>Terminate Terminate _ Subscr .execute(Event _in; Events_out )
Tmln.put _sorted (Events_out )
for all Event _out 2 Events_out do</p>
        <p>record _causality(Event _in; Subscr ; Event _out )
end for
end if
end for
end while</p>
        <p>Tmln_out Tmln
end procedure</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Amin</surname>
            ,
            <given-names>S. M.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Wollenberg</surname>
            ,
            <given-names>B. F.</given-names>
          </string-name>
          <year>2005</year>
          .
          <article-title>Toward a smart grid: power delivery for the 21st century</article-title>
          .
          <source>Power and Energy Magazine, IEEE 3</source>
          ,
          <issue>5</issue>
          ,
          <fpage>34</fpage>
          -
          <lpage>41</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Bergmann</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Glomb</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gotz</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Heuer</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kuntschke</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Winter</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <year>2010</year>
          .
          <article-title>Scalability of smart grid protocols: Protocols and their simulative evaluation for massively distributed DERs</article-title>
          .
          <source>In Smart Grid Communications (SmartGridComm)</source>
          ,
          <source>2010 First IEEE International Conference on. 131-136.</source>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Chaudhri</surname>
            ,
            <given-names>V. K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Heymans</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wessel</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Tran</surname>
            ,
            <given-names>S. C.</given-names>
          </string-name>
          <year>2013</year>
          .
          <article-title>Object-oriented knowledge bases in logic programming</article-title>
          .
          <source>In Technical Communication of International Conference in Logic Programming.</source>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>Chisham</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pontelli</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Son</surname>
            ,
            <given-names>T. C.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Wright</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          <year>2011</year>
          .
          <article-title>CDAOStore: A phylogenetic repository using logic programming and web services</article-title>
          .
          <source>In ICLP (Technical Communications)</source>
          .
          <fpage>209</fpage>
          -
          <lpage>219</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <surname>Duží</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jespersen</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Materna</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <year>2010</year>
          .
          <article-title>Procedural Semantics for Hyperintensional Logic: Foundations and Applications of Transparent Intensional Logic</article-title>
          . Vol.
          <volume>17</volume>
          . Springer Science &amp; Business Media.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Favre</surname>
            ,
            <given-names>J.-M.</given-names>
          </string-name>
          <year>2005</year>
          .
          <article-title>Megamodelling and etymology - a story of words: From MED to MDE via MODEL in five milleniums</article-title>
          .
          <source>In APPEARED IN DROPS 04101</source>
          , IBFI.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <surname>Georg</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wietfeld</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Muller</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Rehtanz</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <year>2012</year>
          .
          <article-title>A HLA based simulator architecture for co-simulating ict based power system control and protection systems</article-title>
          .
          <source>In Smart Grid Communications (SmartGridComm)</source>
          ,
          <source>2012 IEEE Third International Conference on. 264-269.</source>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <surname>Hopkinson</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Giovanini</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Thorp</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Birman</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Coury</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <year>2006</year>
          .
          <article-title>Epochs: a platform for agent-based electric power and communication simulation built from commercial off-the-shelf components</article-title>
          .
          <source>Power Systems, IEEE Transactions on 21</source>
          , 2 (May),
          <fpage>548</fpage>
          -
          <lpage>558</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>IEC.</surname>
          </string-name>
          <year>2006</year>
          . IEC 60870-5-104:
          <article-title>Telecontrol equipment and systems - Transmission protocols</article-title>
          .
          <source>International Electrotechnical Commission</source>
          , Geneva, Switzerland.
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <string-name>
            <surname>IEEE.</surname>
          </string-name>
          <year>2011</year>
          .
          <article-title>Ieee guide for smart grid interoperability of energy technology and information technology operation with the electric power system (EPS), end-use applications, and loads</article-title>
          .
          <source>IEEE Std 2030-2011</source>
          ,
          <fpage>1</fpage>
          -
          <lpage>126</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <string-name>
            <surname>Kosek</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lunsdorf</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Scherfke</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gehrke</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Rohjans</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <year>2014</year>
          .
          <article-title>Evaluation of smart grid control strategies in co-simulation 2014; integration of IPSYS and mosaik</article-title>
          .
          <source>In Power Systems Computation Conference (PSCC)</source>
          ,
          <year>2014</year>
          . 1-
          <fpage>7</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          <string-name>
            <surname>Křenek</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Holub</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Holer</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kouřil</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Procházka</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hejna</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Guričan</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Muller</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          <year>2013</year>
          .
          <article-title>3.5 million smartmeters in the cloud</article-title>
          .
          <source>In Proceedings ISGC</source>
          <year>2013</year>
          , S. Lin, Ed.
          <source>PoS - Proceedings of Science, Trieste</source>
          ,
          <fpage>180</fpage>
          -
          <lpage>189</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          <string-name>
            <surname>Lévesque</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Béchet</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Suignard</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Maier</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Picault</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Joós</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          <year>2014</year>
          .
          <article-title>From co-toward multi-simulation of smart grids based on HLA and FMI standards</article-title>
          .
          <source>arXiv preprint arXiv:1412</source>
          .
          <fpage>5571</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          <string-name>
            <surname>Mets</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ojea</surname>
            ,
            <given-names>J. A.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Develder</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <year>2014</year>
          .
          <article-title>Combining power and communication network simulation for cost-effective smart grid analysis</article-title>
          .
          <source>Communications Surveys Tutorials, IEEE</source>
          <volume>16</volume>
          ,
          <issue>3</issue>
          (Third),
          <fpage>1771</fpage>
          -
          <lpage>1796</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          <string-name>
            <surname>Mets</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Verschueren</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Develder</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vandoorn</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Vandevelde</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          <year>2011</year>
          .
          <article-title>Integrated simulation of power and communication networks for smart grid applications</article-title>
          .
          <source>In Computer Aided Modeling and Design of Communication Links and Networks (CAMAD)</source>
          ,
          <source>2011 IEEE 16th International Workshop on. 61-65.</source>
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          <string-name>
            <surname>Patel</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aparicio</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tas</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Loiacono</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Rosca</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <year>2011</year>
          .
          <article-title>Assessing communications technology options for smart grid applications</article-title>
          .
          <source>In Smart Grid Communications (SmartGridComm)</source>
          ,
          <source>2011 IEEE International Conference on. 126-131.</source>
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          <string-name>
            <surname>Pompe</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <year>2015</year>
          . Masters thesis, Masaryk University, Faculty of Informatics. Available at http://is.muni.cz/th/325292/fi_m/.
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          <string-name>
            <surname>Rosecky</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <year>2015</year>
          .
          <article-title>Grid Mind website</article-title>
          . URL http://www.mycroftmind.cz/en/grid-mind/, [Online; accessed 19-July-2015].
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          <string-name>
            <surname>Schütte</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Scherfke</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Sonnenschein</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <year>2012</year>
          .
          <article-title>mosaik-smart grid simulation API</article-title>
          .
          <source>Proceedings of SMARTGREENS</source>
          ,
          <fpage>14</fpage>
          -
          <lpage>24</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          <string-name>
            <surname>Trefke</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rohjans</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Uslar</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lehnhoff</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nordstrom</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Saleem</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <year>2013</year>
          .
          <article-title>Smart grid architecture model use case management in a large european smart grid project</article-title>
          .
          <source>In Innovative Smart Grid Technologies Europe (ISGT EUROPE)</source>
          ,
          <year>2013</year>
          4th IEEE/PES. 1-
          <fpage>5</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          <string-name>
            <surname>Wille</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <year>1992</year>
          .
          <article-title>Concept lattices and conceptual knowledge systems</article-title>
          .
          <source>Computers &amp; Mathematics with Applications</source>
          <volume>23</volume>
          ,
          <fpage>6</fpage>
          -
          <lpage>9</lpage>
          ,
          <fpage>493</fpage>
          -
          <lpage>515</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>