|
@ -5,7 +5,6 @@ import stormpy |
|
|
from configurations import gspn |
|
|
from configurations import gspn |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@gspn |
|
|
@gspn |
|
|
class TestGSPNBuilder: |
|
|
class TestGSPNBuilder: |
|
|
def test_layout_info(self): |
|
|
def test_layout_info(self): |
|
@ -56,12 +55,11 @@ class TestGSPNBuilder: |
|
|
ti_name = " ti" |
|
|
ti_name = " ti" |
|
|
ti.set_name(ti_name) |
|
|
ti.set_name(ti_name) |
|
|
assert ti_name == ti.get_name() |
|
|
assert ti_name == ti.get_name() |
|
|
assert ti.no_weight_attached() == True |
|
|
|
|
|
|
|
|
assert ti.no_weight_attached() |
|
|
ti_weight = 0.2 |
|
|
ti_weight = 0.2 |
|
|
ti.set_weight(ti_weight) |
|
|
ti.set_weight(ti_weight) |
|
|
assert ti_weight == ti.get_weight() |
|
|
assert ti_weight == ti.get_weight() |
|
|
assert ti.no_weight_attached() == False |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert not ti.no_weight_attached() |
|
|
|
|
|
|
|
|
def test_build_gspn(self): |
|
|
def test_build_gspn(self): |
|
|
gspn_name = "gspn_test" |
|
|
gspn_name = "gspn_test" |
|
@ -121,7 +119,7 @@ class TestGSPNBuilder: |
|
|
assert p_3.get_name() == "place_3" |
|
|
assert p_3.get_name() == "place_3" |
|
|
assert p_3.get_capacity() == 2 |
|
|
assert p_3.get_capacity() == 2 |
|
|
assert p_3.get_number_of_initial_tokens() == 3 |
|
|
assert p_3.get_number_of_initial_tokens() == 3 |
|
|
assert p_3.has_restricted_capacity() == True |
|
|
|
|
|
|
|
|
assert p_3.has_restricted_capacity() |
|
|
|
|
|
|
|
|
# test transitions |
|
|
# test transitions |
|
|
ti_0 = gspn.get_immediate_transition("ti_0") |
|
|
ti_0 = gspn.get_immediate_transition("ti_0") |
|
@ -184,8 +182,6 @@ class TestGSPNBuilder: |
|
|
tt_0 = gspn_import.get_timed_transition("tt_0") |
|
|
tt_0 = gspn_import.get_timed_transition("tt_0") |
|
|
assert tt_0.get_id() == id_tt_0 |
|
|
assert tt_0.get_id() == id_tt_0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_export_to_pnml(self, tmpdir): |
|
|
def test_export_to_pnml(self, tmpdir): |
|
|
builder = stormpy.gspn.GSPNBuilder() |
|
|
builder = stormpy.gspn.GSPNBuilder() |
|
|
builder.set_name("gspn_test") |
|
|
builder.set_name("gspn_test") |
|
@ -219,11 +215,9 @@ class TestGSPNBuilder: |
|
|
assert p_1.get_name() == "place_1" |
|
|
assert p_1.get_name() == "place_1" |
|
|
assert p_1.get_capacity() == 2 |
|
|
assert p_1.get_capacity() == 2 |
|
|
assert p_1.get_number_of_initial_tokens() == 3 |
|
|
assert p_1.get_number_of_initial_tokens() == 3 |
|
|
assert p_1.has_restricted_capacity() == True |
|
|
|
|
|
|
|
|
assert p_1.has_restricted_capacity() |
|
|
|
|
|
|
|
|
ti_0 = gspn_import.get_immediate_transition("ti_0") |
|
|
ti_0 = gspn_import.get_immediate_transition("ti_0") |
|
|
assert ti_0.get_id() == id_ti_0 |
|
|
assert ti_0.get_id() == id_ti_0 |
|
|
tt_0 = gspn_import.get_timed_transition("tt_0") |
|
|
tt_0 = gspn_import.get_timed_transition("tt_0") |
|
|
assert tt_0.get_id() == id_tt_0 |
|
|
assert tt_0.get_id() == id_tt_0 |
|
|
|
|
|
|
|
|
|
|
|
|