Interface SwarmIntelligence
public interface SwarmIntelligence
Swarm intelligence algorithm for collective problem solving.
SwarmIntelligence defines how individual agents combine their partial solutions into a collective solution.
Algorithms
- Ant Colony Optimization (ACO) - Pheromone-guided path finding
- Particle Swarm Optimization (PSO) - Velocity-based exploration
- Bee Algorithm - Scout and recruit pattern
- Consensus - Iterative averaging
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic SwarmIntelligenceantColony(double pheromoneWeight, double explorationRate) Ant Colony Optimization style.static SwarmIntelligenceBest-of-N selection.static SwarmIntelligenceWeighted averaging of agent outputs.Gets the current best solution.getName()Gets algorithm name.Gets algorithm parameters.doubleGets the current solution quality.voidinitialize(String problem, List<com.tnsai.agents.Agent> agents, SwarmEnvironment environment) Initializes the algorithm for a new problem.booleaniterate(List<com.tnsai.agents.Agent> agents, SwarmEnvironment environment) Executes one iteration of the algorithm.static SwarmIntelligenceIterative refinement where each agent improves on previous.static SwarmIntelligencevoting()Simple voting-based collective decision.
-
Method Details
-
initialize
Initializes the algorithm for a new problem.- Parameters:
problem- problem descriptionagents- participating agentsenvironment- shared environment
-
iterate
Executes one iteration of the algorithm.- Parameters:
agents- participating agentsenvironment- shared environment- Returns:
- true if should continue, false if converged
-
getBestSolution
String getBestSolution()Gets the current best solution.- Returns:
- best solution found so far
-
getSolutionQuality
double getSolutionQuality()Gets the current solution quality.- Returns:
- quality score (higher is better)
-
getParameters
Gets algorithm parameters.- Returns:
- parameter map
-
getName
String getName()Gets algorithm name.- Returns:
- name
-
voting
Simple voting-based collective decision.Each agent proposes a solution, best one wins.
- Returns:
- voting intelligence
-
consensus
Weighted averaging of agent outputs.- Returns:
- consensus intelligence
-
bestSelection
Best-of-N selection.- Returns:
- best selection intelligence
-
antColony
Ant Colony Optimization style.- Parameters:
pheromoneWeight- weight for pheromone influenceexplorationRate- rate of random exploration- Returns:
- ACO intelligence
-
iterativeRefinement
Iterative refinement where each agent improves on previous.- Returns:
- refinement intelligence
-