use of edu.umn.cs.crisys.safety.analysis.soteria.CompFaultActivation in project AMASE by loonwerks.
the class IvcToSoteriaGenerator method extractFaultIvcElem.
private void extractFaultIvcElem(SoteriaComp comp, AgreeRenaming renaming, SoteriaFormulaSubgroup formulaSubgroup, String faultName, String faultRefName) {
// get the fault name for that fault activation variable in ivcElement
CompFaultActivation faultActivation = new CompFaultActivation(comp.componentName, faultName);
formulaSubgroup.addFormulaElem(faultActivation);
// if ivcElem is not yet in basicEvents
if (!comp.basicEvents.containsKey(faultName)) {
FaultStatementImpl faultStmtImpl = (FaultStatementImpl) renaming.getRefMap().get(faultRefName);
for (FaultSubcomponent faultSub : faultStmtImpl.getFaultDefinitions()) {
if (faultSub instanceof ProbabilityStatementImpl) {
String probStr = ((ProbabilityStatementImpl) faultSub).getProbability();
float failureProb = Float.parseFloat(probStr);
// TODO: need to have component specify failure rate and exposure time in the future
// currently treat exposure time as (float) 1.0
// and treat the failure probability from the fault statement as the failure rate
SoteriaFault basicEvent = new SoteriaFault(updateElemName(faultName), failureProb, (float) 1.0);
comp.addBasicEvent(faultName, basicEvent);
}
}
}
}
Aggregations