# Class VotingStrategyFactory

Factory for creating voting strategies.

- Defined in packages/nexus-agents/src/consensus/strategies.ts:277

##### Index

### Constructors

constructor

### Methods

getStrategy
registerStrategy
getAvailableAlgorithms

## Constructors

### constructor

- new VotingStrategyFactory(): VotingStrategyFactory

  #### Returns VotingStrategyFactory

  - Defined in packages/nexus-agents/src/consensus/strategies.ts:280

## Methods

### getStrategy

- getStrategy(
  algorithm:
  | "simple_majority"
  | "supermajority"
  | "unanimous"
  | "proof_of_learning"
  | "opinion_wise"
  | "higher_order",
  ): IVotingStrategy

  Get a voting strategy by algorithm type.

  #### Parameters

  - algorithm:
    | "simple_majority"
    | "supermajority"
    | "unanimous"
    | "proof_of_learning"
    | "opinion_wise"
    | "higher_order"

  #### Returns IVotingStrategy

  - Defined in packages/nexus-agents/src/consensus/strategies.ts:294

### registerStrategy

- registerStrategy(strategy: IVotingStrategy): void

  Register a custom voting strategy.

  #### Parameters

  - strategy: IVotingStrategy

  #### Returns void

  - Defined in packages/nexus-agents/src/consensus/strategies.ts:305

### getAvailableAlgorithms

- getAvailableAlgorithms(): (
  | "simple_majority"
  | "supermajority"
  | "unanimous"
  | "proof_of_learning"
  | "opinion_wise"
  | "higher_order"
  )[]

  Get all available algorithm types.

  #### Returns (
  | "simple_majority"
  | "supermajority"
  | "unanimous"
  | "proof_of_learning"
  | "opinion_wise"
  | "higher_order"
  )[]

  - Defined in packages/nexus-agents/src/consensus/strategies.ts:312