Enum Class VotingLogic
- All Implemented Interfaces:
Serializable, Comparable<VotingLogic>, Constable
Represents a voting logic pattern for Safety Instrumented Systems (SIS).
Voting logic determines how multiple redundant sensors or detectors are combined to make a safety decision. Common patterns include:
- 1oo1 (1 out of 1): Single sensor must trip
- 1oo2 (1 out of 2): At least 1 of 2 sensors must trip
- 2oo2 (2 out of 2): Both sensors must trip
- 2oo3 (2 out of 3): At least 2 of 3 sensors must trip (common for high reliability)
- 2oo4 (2 out of 4): At least 2 of 4 sensors must trip
Voting patterns balance:
- Spurious trip rate (false alarms)
- Probability of failure on demand (missed real events)
- System availability vs. safety integrity
- 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 sensor/detector.1 out of 2 - At least one of two must trip.3 out of 4 - Higher safety integrity than 2oo4.2 out of 4 - High redundancy, very high availability.2 out of 3 - Standard for high reliability applications.2 out of 2 - Both sensors must trip. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateVotingLogic(String notation, int requiredTrips, int totalSensors) Creates a voting logic pattern. -
Method Summary
Modifier and TypeMethodDescriptionbooleanevaluate(int trippedCount) Evaluates if the voting condition is met given the number of tripped sensors.Gets the standard notation for this voting pattern.intGets the number of sensors required to trip for activation.intGets the total number of sensors in the voting group.toString()static VotingLogicReturns the enum constant of this class with the specified name.static VotingLogic[]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 sensor/detector. High spurious trip rate, lowest cost. -
ONE_OUT_OF_TWO
1 out of 2 - At least one of two must trip. Lower spurious trips, higher safety. -
TWO_OUT_OF_TWO
2 out of 2 - Both sensors must trip. Very low spurious trips, but lower safety integrity. -
TWO_OUT_OF_THREE
2 out of 3 - Standard for high reliability applications. Good balance of safety and availability. -
TWO_OUT_OF_FOUR
2 out of 4 - High redundancy, very high availability. -
THREE_OUT_OF_FOUR
3 out of 4 - Higher safety integrity than 2oo4.
-
-
Field Details
-
notation
-
requiredTrips
private final int requiredTrips -
totalSensors
private final int totalSensors
-
-
Constructor Details
-
VotingLogic
Creates a voting logic pattern.- Parameters:
notation- standard notation (e.g., "2oo3")requiredTrips- number of sensors that must triptotalSensors- total number of sensors
-
-
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
Gets the standard notation for this voting pattern.- Returns:
- notation string (e.g., "2oo3")
-
getRequiredTrips
public int getRequiredTrips()Gets the number of sensors required to trip for activation.- Returns:
- required trip count
-
getTotalSensors
public int getTotalSensors()Gets the total number of sensors in the voting group.- Returns:
- total sensor count
-
evaluate
public boolean evaluate(int trippedCount) Evaluates if the voting condition is met given the number of tripped sensors.- Parameters:
trippedCount- number of sensors currently tripped- Returns:
- true if voting condition is satisfied
-
toString
- Overrides:
toStringin classEnum<VotingLogic>
-