Skip to main content

This package contains swarm algorithms

Project description

lokky

Swarm algorithms module

Installation

Base install

pip install git+https://github.com/OnisOris/lokky
pip install lokky

Install with visualisation

pip install "lokky[plotting]"

Examples

import numpy as np
from lokky.pionmath import SSolver

params = {
    "kp": np.eye(2, 6),
    "ki": np.zeros((2, 6)),
    "kd": np.eye(2, 6) * 0.1,
    "attraction_weight": 0.1,
    "cohesion_weight": 0.1,
    "alignment_weight": 0.1,
    "repulsion_weight": 5.0,
    "unstable_weight": 0.5,
    "noise_weight": 0.1,
    "safety_radius": 1.5,
    "max_acceleration": 0.3,
    "max_speed": 0.5,
}
solver = SSolver(params)
drone1 = np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0])
drone2 = np.array([1.0, 0.0, 0.0, 0.0, 0.0, 0.0])
target_matrix = np.array([4.0, 0.0, 0.0, 0.0, 0.0, 0.0])
state_matrix = np.array([drone1, drone2])
new_velocities = solver.solve_for_all(state_matrix, target_matrix, 0.1)

Testing script

After installation (lokky[plotting]) run scripts:

lokky-analyze --n 10

lokky-analyze plot

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lokky-0.0.7.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lokky-0.0.7-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file lokky-0.0.7.tar.gz.

File metadata

  • Download URL: lokky-0.0.7.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for lokky-0.0.7.tar.gz
Algorithm Hash digest
SHA256 c0b0259da0e57e278c89372b4d4ea60d4ec3b993df9ba753e6035ed34240e1cd
MD5 206aea3d674c6a681f9e5c9d402459b0
BLAKE2b-256 673cd0a26e2c9ef29679753194e6b69a3e96688fa55fd03b18726cf5f22a4b7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for lokky-0.0.7.tar.gz:

Publisher: wheels.yml on OnisOris/lokky

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lokky-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: lokky-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for lokky-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 97f898ed4c69d91e41e7dc508541a071853062f98c8670c0919d94f3d5c12d72
MD5 c5ebcd41e16dbac33336104f767d8c3e
BLAKE2b-256 6ac36db63e3a0f78c8b970c91ba482c44a9033dd497ba33ae1257528ad49cdf0

See more details on using hashes here.

Provenance

The following attestation bundles were made for lokky-0.0.7-py3-none-any.whl:

Publisher: wheels.yml on OnisOris/lokky

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page