Browse Source
Merge branch 'master' of https://srv-i2.informatik.rwth-aachen.de/scm/git/stormpy
refactoring
Merge branch 'master' of https://srv-i2.informatik.rwth-aachen.de/scm/git/stormpy
refactoring
Matthias Volk
8 years ago
5 changed files with 44 additions and 110 deletions
-
13doc/source/installation.rst
-
108src/common.h
-
1src/mod_storage.cpp
-
11src/storage/model.cpp
-
21tests/storage/test_model_instantiator.py
@ -1,7 +1,18 @@ |
|||||
Installation |
Installation |
||||
*********************** |
*********************** |
||||
|
|
||||
Before installing stormpy, make sure `storm <https://moves-rwth.github.io/storm/>`_ is installed. |
|
||||
|
Requirements |
||||
|
|
||||
|
Before installing stormpy, make sure |
||||
|
|
||||
|
`pycarl <https://moves-rwth.github.io/pycarl>`_ |
||||
|
`storm <https://moves-rwth.github.io/storm/>`_ |
||||
|
|
||||
|
are both available on your system. To avoid issues, we suggest that both use the same version of `carl <https://smtrat.github.io/carl>`_. |
||||
|
The simplest way of ensuring this is to first install carl as explained in the `storm installation guide <https://moves-rwth.github.io/storm/documentation/installation.md#carl>_'. |
||||
|
You can then install storm and pycarl independently. |
||||
|
|
||||
|
|
||||
|
|
||||
Clone stormpy into any suitable location:: |
Clone stormpy into any suitable location:: |
||||
|
|
@ -0,0 +1,21 @@ |
|||||
|
import pycarl |
||||
|
import stormpy |
||||
|
import stormpy.logic |
||||
|
from helpers.helper import get_example_path |
||||
|
|
||||
|
class TestModel: |
||||
|
def test_instantiate_dtmc(self): |
||||
|
program = stormpy.parse_prism_program(get_example_path("pdtmc", "brp16_2.pm")) |
||||
|
formulas = stormpy.parse_formulas_for_prism_program("P=? [ F s=5 ]", program) |
||||
|
model = stormpy.build_parametric_model(program, formulas[0]) |
||||
|
parameters = model.collect_probability_parameters() |
||||
|
instantiator = stormpy.storage.PdtmcInstantiator(model) |
||||
|
point = dict() |
||||
|
for p in parameters: |
||||
|
point[p] = 0.4 |
||||
|
instantiated_model = instantiator.instantiate(point) |
||||
|
assert instantiated_model.nr_states == model.nr_states |
||||
|
assert not instantiated_model.has_parameters |
||||
|
for p in parameters: |
||||
|
point[p] = 0.5 |
||||
|
instatiated_model2 = instantiator.instantiate(point) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue