Search in sources :

Example 11 with AnalysisResult

use of org.osate.result.AnalysisResult in project osate2 by osate.

the class ResultUtil method createAnalysisResult.

public static AnalysisResult createAnalysisResult(String name, EObject target) {
    AnalysisResult result = ResultFactory.eINSTANCE.createAnalysisResult();
    result.setModelElement(target);
    result.setAnalysis(name);
    return result;
}
Also used : AnalysisResult(org.osate.result.AnalysisResult)

Example 12 with AnalysisResult

use of org.osate.result.AnalysisResult in project osate2 by osate.

the class CreateFTAModel method createFTAAnalysisResult.

public static AnalysisResult createFTAAnalysisResult(EObject root, final String startingPoint, FaultTree ft) {
    AnalysisResult ftaResults = ResultUtil.createAnalysisResult("FTA", root);
    ResultUtil.addParameter(ftaResults, startingPoint);
    ftaResults.setModelElement(root);
    if (ft != null) {
        Result result = ResultFactory.eINSTANCE.createResult();
        ftaResults.getResults().add(result);
        result.setModelElement(root);
        result.setMessage("FTA occurrence probability results for " + ((InstanceObject) root).getName() + ":" + startingPoint);
        Event rootevent = ft.getRoot();
        BigDecimal asP = rootevent.getAssignedProbability();
        BigDecimal coP = rootevent.getComputedProbability();
        if (coP == null) {
            addRealValue(result, 0.0);
        } else {
            addRealValue(result, coP.doubleValue());
        }
        if (asP == null) {
            addRealValue(result, 0.0);
        } else {
            addRealValue(result, asP.doubleValue());
        }
    } else {
        ftaResults.getResults().add(ResultUtil.createErrorResult("Fault tree analysis failed to run", root));
    }
    return ftaResults;
}
Also used : InstanceObject(org.osate.aadl2.instance.InstanceObject) Event(org.osate.aadl2.errormodel.FaultTree.Event) AnalysisResult(org.osate.result.AnalysisResult) BigDecimal(java.math.BigDecimal) Result(org.osate.result.Result) AnalysisResult(org.osate.result.AnalysisResult)

Aggregations

AnalysisResult (org.osate.result.AnalysisResult)12 Result (org.osate.result.Result)8 InstanceObject (org.osate.aadl2.instance.InstanceObject)4 SystemInstance (org.osate.aadl2.instance.SystemInstance)4 SystemOperationMode (org.osate.aadl2.instance.SystemOperationMode)4 Diagnostic (org.osate.result.Diagnostic)2 IOException (java.io.IOException)1 BigDecimal (java.math.BigDecimal)1 Locale (java.util.Locale)1 WorkbookSettings (jxl.WorkbookSettings)1 Label (jxl.write.Label)1 WritableSheet (jxl.write.WritableSheet)1 WritableWorkbook (jxl.write.WritableWorkbook)1 WriteException (jxl.write.WriteException)1 IFile (org.eclipse.core.resources.IFile)1 CoreException (org.eclipse.core.runtime.CoreException)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1 Event (org.osate.aadl2.errormodel.FaultTree.Event)1 SOMIterator (org.osate.aadl2.modelsupport.modeltraversal.SOMIterator)1