Page cover

Swarms Module

The Swarms module in the JuliaOS framework provides a comprehensive interface for creating, managing, and interacting with swarms. This page explains how to use the Swarms module in your applications.

Overview

The Swarms module connects to the Julia backend through the JuliaBridge and provides methods for creating, retrieving, starting, stopping, and running optimizations with swarms. It also includes various swarm algorithms for different optimization and coordination tasks.

Installation

npm install @juliaos/framework

Usage

Initializing the Swarms Module

import { JuliaBridge } from '@juliaos/julia-bridge';
import { Swarms } from '@juliaos/framework';

// Initialize the bridge
const bridge = new JuliaBridge({ host: 'localhost', port: 8052 });
await bridge.initialize();

// Create the Swarms module
const swarms = new Swarms(bridge);

Creating a Swarm

Starting a Swarm

Adding Agents to a Swarm

Running an Optimization

Getting Swarm Status

Stopping a Swarm

Listing Swarms

Removing an Agent from a Swarm

Deleting a Swarm

Swarm Algorithms

The Swarms module supports various swarm intelligence algorithms:

Particle Swarm Optimization (PSO)

Differential Evolution (DE)

Grey Wolf Optimizer (GWO)

Ant Colony Optimization (ACO)

Genetic Algorithm (GA)

Whale Optimization Algorithm (WOA)

Hybrid DEPSO

Listing Available Algorithms

Error Handling

The Swarms module includes robust error handling:

See Also

  • Agents Module - Learn about agents and how to use them with swarms

  • Bridge Module - Learn about the bridge that connects to the Julia backend

  • Algorithms - Learn more about the swarm algorithms