Search in sources :

Example 1 with CompFaultActivation

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);
            }
        }
    }
}
Also used : FaultSubcomponent(edu.umn.cs.crisys.safety.safety.FaultSubcomponent) FaultStatementImpl(edu.umn.cs.crisys.safety.safety.impl.FaultStatementImpl) SoteriaFault(edu.umn.cs.crisys.safety.analysis.soteria.SoteriaFault) CompFaultActivation(edu.umn.cs.crisys.safety.analysis.soteria.CompFaultActivation) ProbabilityStatementImpl(edu.umn.cs.crisys.safety.safety.impl.ProbabilityStatementImpl)

Aggregations

CompFaultActivation (edu.umn.cs.crisys.safety.analysis.soteria.CompFaultActivation)1 SoteriaFault (edu.umn.cs.crisys.safety.analysis.soteria.SoteriaFault)1 FaultSubcomponent (edu.umn.cs.crisys.safety.safety.FaultSubcomponent)1 FaultStatementImpl (edu.umn.cs.crisys.safety.safety.impl.FaultStatementImpl)1 ProbabilityStatementImpl (edu.umn.cs.crisys.safety.safety.impl.ProbabilityStatementImpl)1