You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
484 B
17 lines
484 B
"""
|
|
ElectionSwarm Step Interface Example
|
|
"""
|
|
|
|
import sys
|
|
import os
|
|
|
|
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
|
|
|
|
from swarms.structs.election_swarm import ElectionSwarm, ElectionAlgorithm
|
|
|
|
# Create election
|
|
election = ElectionSwarm(verbose=True)
|
|
|
|
# Run single step
|
|
task = "Vote on the best candidate for mayor based on their policies and experience"
|
|
step_result = election.step(task=task, election_type=ElectionAlgorithm.LEADER_ELECTION) |