Skip to content

Erroneous sum of branch probabilities error #1643

@philip-alldredge

Description

@philip-alldredge

Summary

Due to the use of floating point math, in certain circumstances, the EMV2 validator can produce erroneous errors or fail to produce errors. I admit this is a bit of a contrived scenario. It may not be much of a concern but it is something that could theoretically happen.

Expected and Current Behavior

When the sum of probabilities is 1.0 then an error should not occur.

Steps to Reproduce

  1. Use the model below. Due to floating point math, the sum will not be 1.0
package emv_test2
public
	annex EMV2 {**	
		error behavior state_machine
		events
			sensor_failure: error event;
		states
			normal: initial state;
			recovering: state;
			failed: state;
			failed2: state;
			failed3: state;
		transitions
			new_transition: normal -[sensor_failure]-> (recovering with 0.9, failed with 0.00000000000000005, failed2 with 0.00000000000000005, failed3 with 0.0999999999999999);
		end behavior;
	**};
end emv_test2;

Environment

  • OSATE Version:
  • Operating System:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions