Skip to content

Commit

Permalink
Swap the BNF with the RNC in report layer
Browse files Browse the repository at this point in the history
- Sum of products
- Statistical measure
- Curves
  • Loading branch information
rakhimov committed Feb 16, 2017
1 parent 72b9dad commit a592be8
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 72 deletions.
86 changes: 14 additions & 72 deletions mef/report_layer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,33 +99,13 @@ However, it is often convenient to attach some information to each product,
which is not possible with the formulae of the Model Exchange Format.
An alternative XML representation for sums of products
(sets of minimal cut sets are a specific type of sums of products)
is given in :numref:`bnf_sum_of_products`.
is given in :numref:`schema_sum_of_products`.
More attributes can be added to tags "sum-of-products" and "product"
to carry the relevant information.

.. code-block:: bnf
:name: bnf_sum_of_products
:caption: Backus-Naur form for the XML representation of sums-of-products
sum-of-products ::=
<sum-of-products
[ name="identifier" ]
[ description="text" ]
[ basic-events="integer" ]
[ products="integer" ]
>
product*
</sum-of-products>
product ::=
<product [ order="integer" ] >
literal*
</product>
literal ::=
<basic-event name="identifier" />
| <not> <basic-event name="identifier" /> </not>
.. literalinclude:: schema/sum_of_products.rnc
:name: schema_sum_of_products
:caption: The RNC schema for the XML representation of sums-of-products

Statistical measures
--------------------
Expand All @@ -134,37 +114,11 @@ Statistical measures are typically produced by sensitivity analyses.
They are the result, in general, of Monte-Carlo simulations on the values of some parameter.
Such a measure can come with
moments (mean, standard deviation), confidence ranges, error factors, quantiles, etc.
The XML representation for statistical measure is given in :numref:`bnf_statistical_measure`.

.. code-block:: bnf
:name: bnf_statistical_measure
:caption: Backus-Naur form for the XML representation of statistical measures
measure ::=
<measure
[ name="identifier" ]
[ description="text" ]
>
[ <mean value="float" /> ]
[ <standard-deviation value="float" /> ]
[ <confidence-range
percentage="float"
lower-bound="float"
upper-bound="float" /> ]
[ <error-factor percentage="float" value="float" /> ]
[ quantiles ]
</measure>
quantiles ::=
<quantiles number="integer" >
quantile+
</quantiles>
quantile ::=
<quantile number="integer"
[ mean="float" ]
[ lower-bound="float" ]
[ upper-bound="float" ] />
The XML representation for statistical measure is given in :numref:`schema_statistical_measure`.

.. literalinclude:: schema/statistical_measure.rnc
:name: schema_statistical_measure
:caption: The RNC schema for the XML representation of statistical measures

Curves
------
Expand All @@ -173,20 +127,8 @@ Two or three dimensional curves are often produced in PSA studies.
A typical example is indeed
to study the evolution of the system unavailability through the time.
The XML representation of curves suggested by the Model Exchange Format
is given in :numref:`bnf_curves`.

.. code-block:: bnf
:name: bnf_curves
:caption: Backus-Naur for the XML representation of curves
curve ::=
<curve
[ name="identifier" ]
[ description="text" ]
[ X-title="string" Y-title="string" [ Z-title="string" ] ]
[ X-unit="unit" Y-unit="unit" [ Z-unit="unit" ] ]
>
<point X="float" Y="float" [ Z="float" ] />*
</curve>
unit ::= seconds | hours | ...
is given in :numref:`schema_curves`.

.. literalinclude:: schema/curves.rnc
:name: schema_curves
:caption: The RNC schema the XML representation of curves
18 changes: 18 additions & 0 deletions mef/schema/curves.rnc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
curve =
element curve {
attribute name { xsd:NCName }?,
attribute description { text }?,
(attribute X-title { xsd:string },
attribute Y-title { xsd:string },
attribute Z-title { xsd:string }?)?,
(attribute X-unit { unit },
attribute Y-unit { unit },
attribute Z-unit { unit }?)?,
element point {
attribute X { xsd:double },
attribute Y { xsd:double },
attribute Z { xsd:double }?
}*
}

unit = "seconds" | "hours"
41 changes: 41 additions & 0 deletions mef/schema/statistical_measure.rnc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
statistical-measure =
element measure {
name?,
attribute description { text }?,
element mean {
attribute value { xsd:double }
}?,
element standard-deviation {
attribute value { xsd:double }
}?,
element confidence-range {
attribute percentage {
xsd:double { minExclusive = "0" maxExclusive = "100" }
},
attribute lower-bound { xsd:double },
attribute upper-bound { xsd:double }
}?,
element error-factor {
attribute percentage {
xsd:double { minExclusive = "0" maxExclusive = "100" }
},
attribute value {
xsd:double { minExclusive = "0" }
}
}?,
quantiles?,
}

quantiles =
element quantiles {
attribute number { xsd:nonNegativeInteger },
quantile+
}

quantile = element quantile { bin-data }

bin-data =
attribute number { xsd:nonNegativeInteger },
attribute mean { xsd:double }?,
attribute lower-bound { xsd:double }?,
attribute upper-bound { xsd:double }?
18 changes: 18 additions & 0 deletions mef/schema/sum_of_products.rnc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
sum-of-products =
element sum-of-products {
name?,
attribute description { text }?,
attribute basic-events { xsd:nonNegativeInteger }?,
attribute products { xsd:nonNegativeInteger }?,
product*
}

product =
element product {
attribute order { xsd:nonNegativeInteger }?,
literal*
}

literal =
element basic-event { name }
| element not { element basic-event { name } }

0 comments on commit a592be8

Please sign in to comment.