Exemplo n.º 1
0
from famapy.metamodels.fm_metamodel.transformations.xml_transformation import XMLTransformation

from famapy.metamodels.pysat_metamodel.models.pysat_model import PySATModel
from famapy.metamodels.pysat_metamodel.operations.glucose3_products import Glucose3Products
from famapy.metamodels.pysat_metamodel.operations.glucose3_valid import Glucose3Valid
from famapy.metamodels.pysat_metamodel.transformations.fm_to_pysat import FmToPysat

# Parse a file
xmlreader = XMLTransformation("example.fama")
fm = xmlreader.transform()

# print the model
print(fm)

# Create a detination metamodel (Pysat for the record)
sat = PySATModel()

# Transform the first onto the second
transform = FmToPysat(fm, sat)
transform.transform()

# Create the operation
valid = Glucose3Valid()

# Execute the operation . TODO Investigate how t avoid that sat parameter
valid.execute(sat)

# Print the result
print("Is the model valid: " + str(valid.isValid()))

# Create the operation
Exemplo n.º 2
0
 def __init__(self, path: str):
     self._path = path
     self.counter = 1
     self.destination_model = PySATModel()
     self.cnf = self.destination_model.cnf
Exemplo n.º 3
0
 def __init__(self, source_model: VariabilityModel):
     self.source_model = source_model
     self.counter = 1
     self.destination_model = PySATModel()
     self.r_cnf = self.destination_model.r_cnf
     self.ctc_cnf = self.destination_model.ctc_cnf