Skip to content

Commit

Permalink
Merge pull request #64 from kbss-cvut/feature/fta-fmea-ui-174-min-cut…
Browse files Browse the repository at this point in the history
…set-evaluation-of-fault-tree

Feature/fta fmea UI 174 min cutset evaluation of fault tree
  • Loading branch information
kostobog authored Feb 26, 2024
2 parents 93f0b83 + d3a7dd4 commit 8814489
Show file tree
Hide file tree
Showing 7 changed files with 629 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public List<FaultTree> summaries() {
public FaultTree find(@PathVariable(name = "faultTreeFragment") String faultTreeFragment) {
log.info("> find - {}", faultTreeFragment);
URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_FaultTree, faultTreeFragment);
return repositoryService.findWithPropagation(faultTreeUri);
return repositoryService.findRequired(faultTreeUri);
}

@ResponseStatus(HttpStatus.CREATED)
Expand Down Expand Up @@ -126,4 +126,13 @@ public void performCutSetAnalysis(@PathVariable(name = "faultTreeFragment") Stri
log.info("> performCutSetAnalysis - {}", faultTreeFragment);
repositoryService.performCutSetAnalysis(faultTreeUri);
}

@ResponseStatus(HttpStatus.NO_CONTENT)
@PutMapping(value = "/{faultTreeFragment}/evaluate")
public void evaluate(@PathVariable(name = "faultTreeFragment") String faultTreeFragment){
URI faultTreeUri = identifierService.composeIdentifier(Vocabulary.s_c_FaultTree, faultTreeFragment);
log.info("> performCutSetAnalysis - {}", faultTreeFragment);
repositoryService.evaluate(faultTreeUri);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public List<FaultEventScenario> extract(FaultEvent faultEvent){
return processAndGateScenarios(partScenarios);
}

public List<FaultEventScenario> extractMinimalScenarios(FaultEvent faultEvent){
List<FaultEventScenario> minScenarios = extract(faultEvent);
return extractMinimalScenarios(minScenarios);
}

protected List<FaultEventScenario> processAndGateScenarios(List<List<FaultEventScenario>> partScenarios){
List<Integer> inds = new ArrayList<>(partScenarios.size());
partScenarios.forEach(l -> inds.add(0));
Expand Down
Loading

0 comments on commit 8814489

Please sign in to comment.