Esempio n. 1
0
import sys
owfn_path = "../../"
sys.path.append(owfn_path)

from model_repair.logger import LOG
from model_repair.petri_net import PetriNet

model = PetriNet()

""" Proccess 'a' """
model.add_place("a_1")
model.add_place("a_2")

model.add_transition("t_1")
model.change_input_flow("a_1", "t_1", 1)
model.change_output_flow("a_2", "t_1", 1)

model.add_transition("t_2")
model.change_input_flow("a_2", "t_2", 1)
model.change_output_flow("a_1", "t_2", 1)

""" Proccess 'b' """
model.add_place("b_1")
model.add_place("b_2")

model.add_transition("t_3")
model.change_input_flow("b_1", "t_3", 1)
model.change_output_flow("b_2", "t_3", 1)

model.add_transition("t_4")
model.change_input_flow("b_2", "t_4", 1)
Esempio n. 2
0
import sys
owfn_path = "../../"
sys.path.append(owfn_path)

from model_repair.logger import LOG
from model_repair.petri_net import PetriNet

model = PetriNet()

""" Loading file"""
model.load_file("example_pn_old.json")

""" Adding an existing place """
model.add_place("a")

""" Adding new place and transition"""
model.add_place("c")
model.add_transition("t_2")

""" Adding new flow """
model.change_input_flow("a", "t_2", 1)
model.change_output_flow("c", "t_2", 1)

""" Saving file"""
model.save_file("example_pn_new.json")
Esempio n. 3
0
import sys
owfn_path = "../../"
sys.path.append(owfn_path)

from model_repair.logger import LOG
from model_repair.petri_net import PetriNet

model = PetriNet()

""" Adding places and transitions """
model.add_place("a")
model.add_place("b")
model.add_transition("t_1")
model.add_transition("t_2")

""" Adding flow"""
model.change_input_flow("a", "t_1", 1)
model.change_output_flow("b", "t_1", 1)

model.change_input_flow("b", "t_2", 1)
model.change_output_flow("a", "t_2", 1)

""" Generates a LoLA file """
print model.export_lola({"a": 1})
Esempio n. 4
0
import sys
owfn_path = "../../"
sys.path.append(owfn_path)

from model_repair.logger import LOG
from model_repair.petri_net import PetriNet
import model_repair.ctl

model = PetriNet()

""" Adding places, transitions and flow for 'P'"""
model.add_place("p_iddle")
model.add_place("p_active")
model.add_transition("t_1")
model.add_transition("t_2")
model.change_input_flow("p_iddle", "t_1", 1)
model.change_output_flow("p_active", "t_1", 1)
model.change_input_flow("p_active", "t_2", 1)
model.change_output_flow("p_iddle", "t_2", 1)

""" Adding places, transitions and flow for 'P'"""
model.add_place("q_iddle")
model.add_place("q_active")
model.add_transition("t_3")
model.add_transition("t_4")
model.change_input_flow("q_iddle", "t_3", 1)
model.change_output_flow("q_active", "t_3", 1)
model.change_input_flow("q_active", "t_4", 1)
model.change_output_flow("q_iddle", "t_4", 1)

""" Initial Marking """