本文已参与「新人创作礼」活动,一起开启创作之路。

介绍

整理了EMV2进行错误树分析的基本语法,用最简单直观的样例介绍EMV2和错误树分析

@TOC

test1.aadl

package test1
public
		annex EMV2 {**
		error types
			error_type_1: type;
		end types;
	**};
end test1;

事件A和事件B同时发生的概率

【OSATE&AADL建模入门学习教程】错误树分析样例

package test3
public
	device device_1
		features
			out_feature_1: out feature;
		annex emv2 {**
			use types  test1;
			error propagations
				out_feature_1: out propagation {error_type_1};
			end propagations;
			component error behavior
				events
					events_1: error event;
					events_2: error event;
				propagations
					all -[events_1 and events_2]-> out_feature_1 {error_type_1};
			end component;
			properties
				EMV2::OccurrenceDistribution => [
					ProbabilityValue => 0.05;] applies to events_1;
				EMV2::OccurrenceDistribution => [
					ProbabilityValue => 0.02;] applies to events_2;
		**};
	end device_1;
	system system_1
		features
			system_1_out_feature_1: out feature;
		annex emv2 {**
			use types test1;
			error propagations
				system_1_out_feature_1: out propagation {error_type_1};
			end propagations;
		**};
	end system_1;
	system implementation system_1.implementation_1
		subcomponents
			subcomponents_1: device device_1;
		annex emv2 {**
			use types test1;
			component error behavior
				propagations
					propagations_1: all -[subcomponents_1.out_feature_1]-> system_1_out_feature_1 {error_type_1};
			end component;
		**};
	end system_1.implementation_1;
end test3;

事件A或事件B最少一个发生的概率

【OSATE&AADL建模入门学习教程】错误树分析样例

package test4
public
	device device_1
		features
			out_feature_1: out feature;
		annex emv2 {**
			use types  test1;
			error propagations
				out_feature_1: out propagation {error_type_1};
			end propagations;
			component error behavior
				events
					events_1: error event;
					events_2: error event;
				propagations
					all -[events_1 or events_2]-> out_feature_1 {error_type_1};
			end component;
			properties
				EMV2::OccurrenceDistribution => [
					ProbabilityValue => 0.05;] applies to events_1;
				EMV2::OccurrenceDistribution => [
					ProbabilityValue => 0.02;] applies to events_2;
		**};
	end device_1;
	system system_1
		features
			system_1_out_feature_1: out feature;
		annex emv2 {**
			use types test1;
			error propagations
				system_1_out_feature_1: out propagation {error_type_1};
			end propagations;
		**};
	end system_1;
	system implementation system_1.implementation_1
		subcomponents
			subcomponents_1: device device_1;
		annex emv2 {**
			use types test1;
			component error behavior
				propagations
					propagations_1: all -[subcomponents_1.out_feature_1]-> system_1_out_feature_1 {error_type_1};
			end component;
		**};
	end system_1.implementation_1;
end test4;

流A或流B最少一个发生的概率

【OSATE&AADL建模入门学习教程】错误树分析样例

package test5
public
	device device_1
		features
			features_out_data_port: out data port;
		annex emv2 {**
			use types ErrorLibrary, test1;
			error propagations
				features_out_data_port: out propagation {error_type_1,BadValue};
				flows
					flows_1: error source features_out_data_port {error_type_1,BadValue};
			end propagations;
			properties
				EMV2::OccurrenceDistribution => [
					ProbabilityValue => 2.0E-2;] applies to flows_1.BadValue;
				EMV2::OccurrenceDistribution => [
					ProbabilityValue => 5.0E-2;] applies to flows_1.error_type_1;
		**};
	end device_1;
	system system_1
		features
			system_1_out_feature_1: out feature;
		annex emv2 {**
			use types test1;
			error propagations
				system_1_out_feature_1: out propagation {error_type_1};
			end propagations;
		**};
	end system_1;
	system implementation system_1.implementation_1
		subcomponents
			subcomponents_1: device device_1;
		annex emv2 {**
			use types test1;
			component error behavior
				propagations
					propagations_1: all -[subcomponents_1.features_out_data_port]-> system_1_out_feature_1 {error_type_1};
			end component;
		**};
	end system_1.implementation_1;
end test5;

事件A和B只有一个发生的概率

【OSATE&AADL建模入门学习教程】错误树分析样例

package test4
public
	device device_1
		features
			out_feature_1: out feature;
		annex emv2 {**
			use types  test1;
			error propagations
				out_feature_1: out propagation {error_type_1};
			end propagations;
			component error behavior
				events
					events_1: error event;
					events_2: error event;
				propagations
					all -[1 ormore (events_1 , events_2)]-> out_feature_1 {error_type_1};
			end component;
			properties
				EMV2::OccurrenceDistribution => [
					ProbabilityValue => 0.05;] applies to events_1;
				EMV2::OccurrenceDistribution => [
					ProbabilityValue => 0.02;] applies to events_2;
		**};
	end device_1;
	system system_1
		features
			system_1_out_feature_1: out feature;
		annex emv2 {**
			use types test1;
			error propagations
				system_1_out_feature_1: out propagation {error_type_1};
			end propagations;
		**};
	end system_1;
	system implementation system_1.implementation_1
		subcomponents
			subcomponents_1: device device_1;
		annex emv2 {**
			use types test1;
			component error behavior
				propagations
					propagations_1: all -[subcomponents_1.out_feature_1]-> system_1_out_feature_1 {error_type_1};
			end component;
		**};
	end system_1.implementation_1;
end test4;

设备1的事件AB至少发生一个,设备2的事件CD至少发生一个,两种设备的至少有一个事件发生的概率

【OSATE&AADL建模入门学习教程】错误树分析样例

package test6
public
	device device_1
		features
			out_feature_1: out feature;
		annex emv2 {**
			use types  test1;
			error propagations
				out_feature_1: out propagation {error_type_1};
			end propagations;
			component error behavior
				events
					events_1: error event;
					events_2: error event;
				propagations
					all -[events_1 or events_2]-> out_feature_1 {error_type_1};
			end component;
			properties
				EMV2::OccurrenceDistribution => [
					ProbabilityValue => 0.05;] applies to events_1;
				EMV2::OccurrenceDistribution => [
					ProbabilityValue => 0.02;] applies to events_2;
		**};
	end device_1;
	device device_2
		features
			out_feature_1: out feature;
		annex emv2 {**
			use types  test1;
			error propagations
				out_feature_1: out propagation {error_type_1};
			end propagations;
			component error behavior
				events
					events_1: error event;
					events_2: error event;
				propagations
					all -[events_1 or events_2]-> out_feature_1 {error_type_1};
			end component;
			properties
				EMV2::OccurrenceDistribution => [
					ProbabilityValue => 0.07;] applies to events_1;
				EMV2::OccurrenceDistribution => [
					ProbabilityValue => 0.09;] applies to events_2;
		**};
	end device_2;
	system system_1
		features
			system_1_out_feature_1: out feature;
		annex emv2 {**
			use types test1;
			error propagations
				system_1_out_feature_1: out propagation {error_type_1};
			end propagations;
		**};
	end system_1;
	system implementation system_1.implementation_1
		subcomponents
			subcomponents_1: device device_1;
			subcomponents_2: device device_2;
		annex emv2 {**
			use types test1;
			component error behavior
				propagations
					propagations_1: all -[subcomponents_1.out_feature_1 and subcomponents_2.out_feature_1 ]-> system_1_out_feature_1 {error_type_1};
			end component;
		**};
	end system_1.implementation_1;
end test6;

关于FTA的门/事件的类型

【OSATE&AADL建模入门学习教程】错误树分析样例

样例

【OSATE&AADL建模入门学习教程】错误树分析样例