Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhorcas committed Nov 2, 2024
2 parents 79152c1 + 2531f0f commit 76ae72d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions flamapy/metamodels/bdd_metamodel/models/bdd_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ def bdd_file(self, dddmp_file: str) -> None:
self._temporal_bdd_file = False

def __del__(self) -> None:
if self._bdd_file is not None and self._temporal_bdd_file:
Path(self._bdd_file).unlink()
pass
#if self._bdd_file is not None and self._temporal_bdd_file:
# Path(self._bdd_file).unlink()

def _set_global_constants(self) -> None:
"""Private auxiliary function that configures the following global constants.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ def feature_inclusion_probability(bdd_model: BDDModel,
probabilities = {}
for line in line_iterator:
parsed_line = re.compile(r'\s+').split(line.strip())
print(f'Feature: {parsed_line[0]}')
original_feature_name = bdd_model.features_names.get(parsed_line[0])
probabilities[original_feature_name] = round(float(parsed_line[1]), precision)
return probabilities
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def transform(self) -> BDDModel:
) as file:
SPLOTWriter(path=file.name, source_model=self.source_model).transform()
bdd_model = SPLOTReader(file.name).transform()
print(f'here is my BDD: {bdd_model}')
bdd_model.variables = [f.name for f in self.source_model.get_features()]
bdd_model.features_names = {f.name.replace(' ', ''): f.name
for f in self.source_model.get_features()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ def build_bdd(model_file: str, bdd_model: BDDModel) -> None:
raise FlamaException(message) from exc

# Run binary logic2bdd's execution
#print("Synthesizing the BDD (this may take a while)...")
print("Synthesizing the BDD (this may take a while)...")
bdd_model.run(BDDModel.LOGIC2BDD, file_name)
print("Synthesizing of the BDD finished.")
# Check that logic2bdd's execution was successful
try:
bdd_model.check_file_existence(file_name, "dddmp")
Expand Down

0 comments on commit 76ae72d

Please sign in to comment.