Class DefaultGroupDecisionFramework

java.lang.Object
com.tnsai.coordination.decision.DefaultGroupDecisionFramework
All Implemented Interfaces:
GroupDecisionFramework

public class DefaultGroupDecisionFramework extends Object implements GroupDecisionFramework
Default implementation of GroupDecisionFramework.

Uses the existing voting infrastructure (ConsensusBuilder, MajorityVoting) for vote collection and tallying. Adds:

  • Decision tracing via DecisionTraceStore
  • Leader fallback when consensus is not reached
  • Belief synchronization by broadcasting results to members
  • Constructor Details

    • DefaultGroupDecisionFramework

      public DefaultGroupDecisionFramework(DecisionTraceStore traceStore)
  • Method Details

    • propose

      public DecisionProposal propose(String topic, List<String> options, VotingMethod method)
      Description copied from interface: GroupDecisionFramework
      Creates a decision proposal.
      Specified by:
      propose in interface GroupDecisionFramework
      Parameters:
      topic - the question to decide
      options - available choices (at least 2)
      method - consensus algorithm
      Returns:
      a new proposal
    • vote

      public List<Vote> vote(com.tnsai.agents.groups.AgentGroup group, DecisionProposal proposal)
      Description copied from interface: GroupDecisionFramework
      Collects votes from all group members on a proposal.
      Specified by:
      vote in interface GroupDecisionFramework
      Parameters:
      group - the agent group whose members will vote
      proposal - the proposal to vote on
      Returns:
      collected votes
    • converge

      public DecisionResult converge(com.tnsai.agents.groups.AgentGroup group, List<Vote> votes, DecisionProposal proposal)
      Description copied from interface: GroupDecisionFramework
      Tallies votes, determines outcome, saves trace, and broadcasts result. If no consensus is reached and a leader exists, falls back to leader decision.
      Specified by:
      converge in interface GroupDecisionFramework
      Parameters:
      group - the agent group (for leader fallback and belief sync)
      votes - collected votes
      proposal - the original proposal
      Returns:
      the decision result