Enum Class VotingPattern
- All Implemented Interfaces:
Serializable, Comparable<VotingPattern>, Constable
Standard voting patterns for redundant sensors or conditions.
This enum defines common voting patterns used across all logic contexts (not just SIS). It's compatible with the SIS-specific VotingLogic enum but more generic.
- Version:
- 1.0
- Author:
- ESOL
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription1 out of 1 - Single input must be true.1 out of 2 - At least 1 of 2 inputs must be true.3 out of 4 - At least 3 of 4 inputs must be true.2 out of 4 - At least 2 of 4 inputs must be true.2 out of 3 - At least 2 of 3 inputs must be true (standard for high reliability).2 out of 2 - Both inputs must be true. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanevaluate(int trueCount) Evaluates if voting condition is met.Gets the standard notation.intGets the required number of true inputs.intGets the total number of inputs expected.toString()static VotingPatternReturns the enum constant of this class with the specified name.static VotingPattern[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ONE_OUT_OF_ONE
1 out of 1 - Single input must be true. -
ONE_OUT_OF_TWO
1 out of 2 - At least 1 of 2 inputs must be true. -
TWO_OUT_OF_TWO
2 out of 2 - Both inputs must be true. -
TWO_OUT_OF_THREE
2 out of 3 - At least 2 of 3 inputs must be true (standard for high reliability). -
TWO_OUT_OF_FOUR
2 out of 4 - At least 2 of 4 inputs must be true. -
THREE_OUT_OF_FOUR
3 out of 4 - At least 3 of 4 inputs must be true.
-
-
Field Details
-
notation
-
required
private final int required -
total
private final int total
-
-
Constructor Details
-
VotingPattern
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getNotation
-
getRequiredTrue
public int getRequiredTrue()Gets the required number of true inputs.- Returns:
- required count
-
getTotalSensors
public int getTotalSensors()Gets the total number of inputs expected.- Returns:
- total sensor count
-
evaluate
public boolean evaluate(int trueCount) Evaluates if voting condition is met.- Parameters:
trueCount- number of inputs that are true- Returns:
- true if voting satisfied
-
toString
- Overrides:
toStringin classEnum<VotingPattern>
-