Enum Class VotingPattern

java.lang.Object
java.lang.Enum<VotingPattern>
neqsim.process.logic.voting.VotingPattern
All Implemented Interfaces:
Serializable, Comparable<VotingPattern>, Constable

public enum VotingPattern extends Enum<VotingPattern>
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
  • Enum Constant Details

    • ONE_OUT_OF_ONE

      public static final VotingPattern ONE_OUT_OF_ONE
      1 out of 1 - Single input must be true.
    • ONE_OUT_OF_TWO

      public static final VotingPattern ONE_OUT_OF_TWO
      1 out of 2 - At least 1 of 2 inputs must be true.
    • TWO_OUT_OF_TWO

      public static final VotingPattern TWO_OUT_OF_TWO
      2 out of 2 - Both inputs must be true.
    • TWO_OUT_OF_THREE

      public static final VotingPattern 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

      public static final VotingPattern TWO_OUT_OF_FOUR
      2 out of 4 - At least 2 of 4 inputs must be true.
    • THREE_OUT_OF_FOUR

      public static final VotingPattern THREE_OUT_OF_FOUR
      3 out of 4 - At least 3 of 4 inputs must be true.
  • Field Details

    • notation

      private final String notation
    • required

      private final int required
    • total

      private final int total
  • Constructor Details

    • VotingPattern

      private VotingPattern(String notation, int required, int total)
  • Method Details

    • values

      public static VotingPattern[] 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

      public static VotingPattern valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getNotation

      public String getNotation()
      Gets the standard notation.
      Returns:
      notation (e.g., "2oo3")
    • 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

      public String toString()
      Overrides:
      toString in class Enum<VotingPattern>