# osmangokalp/contopt-js architecture

> Architecture diagram of the GitHub repository osmangokalp/contopt-js, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/osmangokalp/contopt-js
- Repository: https://github.com/osmangokalp/contopt-js

## Overview

CONTOPT-JS is a browser-oriented JavaScript library for bound-constrained, single-objective continuous optimization. Its workflow is to configure an optimizer, run a metaheuristic in a worker against either a benchmark objective or the sensor-coverage case study, and report the best solution and evaluation count. The repository contains six algorithm implementations, a shared optimizer base, benchmark functions, and sensor-specific adaptations. The tree and excerpts establish worker messaging and sensor evaluation; page-to-worker wiring is inferred from the documented example pages, whose source was not sampled.

Main entry points: [`public_html/benchmarkExperimentsPage.html`](https://github.com/osmangokalp/contopt-js/blob/master/public_html/benchmarkExperimentsPage.html) (Benchmark examples), [`public_html/sensorDeploymentCaseStudyPage.html`](https://github.com/osmangokalp/contopt-js/blob/master/public_html/sensorDeploymentCaseStudyPage.html) (Sensor case study), [`public_html/EvolutionStrategies.js`](https://github.com/osmangokalp/contopt-js/blob/master/public_html/EvolutionStrategies.js) (Evolution strategies), [`public_html/SimulatedAnnealing.js`](https://github.com/osmangokalp/contopt-js/blob/master/public_html/SimulatedAnnealing.js) (Annealing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_examples["Browser examples"]
  node_benchmark_page["Benchmark examples"]
  node_sensor_page["Sensor case study"]
  node_sensor_panel["Sensor display<br/>[SensorPanel.js]"]
end

subgraph group_algorithms["Metaheuristic algorithms"]
  node_abc["Bee colony"]
  node_de["Differential evolution"]
  node_es["Evolution strategies"]
  node_ga["Genetic algorithm"]
  node_pso["Particle swarm"]
  node_sa["Annealing"]
  node_abc_sensor["Bee sensor adapter"]
  node_de_sensor["DE sensor adapter"]
  node_ga_sensor["GA sensor adapter"]
  node_pso_sensor["PSO sensor adapter"]
end

subgraph group_shared["Optimization foundation"]
  node_optimizer_base["Optimizer base"]
  node_solution["Solution state<br/>[Solution.js]"]
  node_rng["Gaussian RNG<br/>[GaussianRNG.js]"]
end

subgraph group_problems["Objective problems"]
  node_benchmarks["Benchmark objectives"]
  node_sensor_problem["Coverage problem"]
end

node_user(("User"))

node_user -->|"configures run"| node_benchmark_page
node_user -->|"configures case"| node_sensor_page
node_benchmark_page -.->|"starts worker"| node_abc
node_benchmark_page -.->|"starts worker"| node_de
node_benchmark_page -.->|"starts worker"| node_es
node_benchmark_page -.->|"starts worker"| node_ga
node_benchmark_page -.->|"starts worker"| node_pso
node_benchmark_page -.->|"starts worker"| node_sa
node_sensor_page -.->|"starts worker"| node_abc_sensor
node_sensor_page -.->|"starts worker"| node_de_sensor
node_sensor_page -.->|"starts worker"| node_ga_sensor
node_sensor_page -.->|"starts worker"| node_pso_sensor
node_abc -->|"inherits and calls"| node_optimizer_base
node_de -->|"inherits and calls"| node_optimizer_base
node_es -->|"inherits and calls"| node_optimizer_base
node_ga -->|"inherits and calls"| node_optimizer_base
node_pso -->|"inherits and calls"| node_optimizer_base
node_sa -->|"inherits and calls"| node_optimizer_base
node_abc -->|"stores candidates"| node_solution
node_de -->|"stores candidates"| node_solution
node_es -->|"stores candidates"| node_solution
node_ga -->|"stores candidates"| node_solution
node_pso -->|"stores candidates"| node_solution
node_sa -->|"stores candidates"| node_solution
node_abc -.->|"evaluates objective"| node_benchmarks
node_de -.->|"evaluates objective"| node_benchmarks
node_es -.->|"evaluates objective"| node_benchmarks
node_ga -.->|"evaluates objective"| node_benchmarks
node_pso -.->|"evaluates objective"| node_benchmarks
node_sa -.->|"evaluates objective"| node_benchmarks
node_es -->|"samples mutations"| node_rng
node_sa -->|"samples neighbors"| node_rng
node_abc_sensor -->|"extends algorithm"| node_abc
node_de_sensor -->|"extends algorithm"| node_de
node_ga_sensor -->|"extends algorithm"| node_ga
node_pso_sensor -->|"extends algorithm"| node_pso
node_abc_sensor -->|"scores coverage"| node_sensor_problem
node_de_sensor -->|"scores coverage"| node_sensor_problem
node_ga_sensor -->|"scores coverage"| node_sensor_problem
node_pso_sensor -->|"scores coverage"| node_sensor_problem
node_sensor_page -.->|"provides case data"| node_sensor_problem
node_sensor_page -.->|"displays deployment"| node_sensor_panel
node_abc -.->|"posts best result"| node_benchmark_page
node_de -.->|"posts best result"| node_benchmark_page
node_es -.->|"posts best result"| node_benchmark_page
node_ga -.->|"posts best result"| node_benchmark_page
node_pso -.->|"posts best result"| node_benchmark_page
node_sa -.->|"posts best result"| node_benchmark_page

click node_benchmark_page "https://github.com/osmangokalp/contopt-js/blob/master/public_html/benchmarkExperimentsPage.html"
click node_sensor_page "https://github.com/osmangokalp/contopt-js/blob/master/public_html/sensorDeploymentCaseStudyPage.html"
click node_abc "https://github.com/osmangokalp/contopt-js/blob/master/public_html/ArtificialBeeColony.js"
click node_de "https://github.com/osmangokalp/contopt-js/blob/master/public_html/DifferentialEvolution.js"
click node_es "https://github.com/osmangokalp/contopt-js/blob/master/public_html/EvolutionStrategies.js"
click node_ga "https://github.com/osmangokalp/contopt-js/blob/master/public_html/GeneticAlgorithm.js"
click node_pso "https://github.com/osmangokalp/contopt-js/blob/master/public_html/ParticleSwarmOptimization.js"
click node_sa "https://github.com/osmangokalp/contopt-js/blob/master/public_html/SimulatedAnnealing.js"
click node_abc_sensor "https://github.com/osmangokalp/contopt-js/blob/master/public_html/ArtificialBeeColony_Sensor.js"
click node_de_sensor "https://github.com/osmangokalp/contopt-js/blob/master/public_html/DifferentialEvolution_Sensor.js"
click node_ga_sensor "https://github.com/osmangokalp/contopt-js/blob/master/public_html/GeneticAlgorithm_Sensor.js"
click node_pso_sensor "https://github.com/osmangokalp/contopt-js/blob/master/public_html/ParticleSwarmOptimization_Sensor.js"
click node_optimizer_base "https://github.com/osmangokalp/contopt-js/blob/master/public_html/ContinuousOptimizer.js"
click node_solution "https://github.com/osmangokalp/contopt-js/blob/master/public_html/Solution.js"
click node_rng "https://github.com/osmangokalp/contopt-js/blob/master/public_html/GaussianRNG.js"
click node_benchmarks "https://github.com/osmangokalp/contopt-js/blob/master/public_html/BenchmarkFunctions.js"
click node_sensor_problem "https://github.com/osmangokalp/contopt-js/blob/master/public_html/SensorDeploymentProblem.js"
click node_sensor_panel "https://github.com/osmangokalp/contopt-js/blob/master/public_html/SensorPanel.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_benchmark_page,node_sensor_page,node_sensor_panel,node_user toneBlue
class node_abc,node_de,node_es,node_ga,node_pso,node_sa,node_abc_sensor,node_de_sensor,node_ga_sensor,node_pso_sensor toneAmber
class node_optimizer_base,node_solution,node_rng toneMint
class node_benchmarks,node_sensor_problem toneRose
```

## Components

### Browser examples

- [Benchmark examples](https://github.com/osmangokalp/contopt-js/blob/master/public_html/benchmarkExperimentsPage.html): `public_html/benchmarkExperimentsPage.html`
- [Sensor case study](https://github.com/osmangokalp/contopt-js/blob/master/public_html/sensorDeploymentCaseStudyPage.html): `public_html/sensorDeploymentCaseStudyPage.html`
- [Sensor display](https://github.com/osmangokalp/contopt-js/blob/master/public_html/SensorPanel.js): `public_html/SensorPanel.js`

### Metaheuristic algorithms

- [Bee colony](https://github.com/osmangokalp/contopt-js/blob/master/public_html/ArtificialBeeColony.js): `public_html/ArtificialBeeColony.js`
- [Differential evolution](https://github.com/osmangokalp/contopt-js/blob/master/public_html/DifferentialEvolution.js): `public_html/DifferentialEvolution.js`
- [Evolution strategies](https://github.com/osmangokalp/contopt-js/blob/master/public_html/EvolutionStrategies.js): `public_html/EvolutionStrategies.js`
- [Genetic algorithm](https://github.com/osmangokalp/contopt-js/blob/master/public_html/GeneticAlgorithm.js): `public_html/GeneticAlgorithm.js`
- [Particle swarm](https://github.com/osmangokalp/contopt-js/blob/master/public_html/ParticleSwarmOptimization.js): `public_html/ParticleSwarmOptimization.js`
- [Annealing](https://github.com/osmangokalp/contopt-js/blob/master/public_html/SimulatedAnnealing.js): `public_html/SimulatedAnnealing.js`
- [Bee sensor adapter](https://github.com/osmangokalp/contopt-js/blob/master/public_html/ArtificialBeeColony_Sensor.js): `public_html/ArtificialBeeColony_Sensor.js`
- [DE sensor adapter](https://github.com/osmangokalp/contopt-js/blob/master/public_html/DifferentialEvolution_Sensor.js): `public_html/DifferentialEvolution_Sensor.js`
- [GA sensor adapter](https://github.com/osmangokalp/contopt-js/blob/master/public_html/GeneticAlgorithm_Sensor.js): `public_html/GeneticAlgorithm_Sensor.js`
- [PSO sensor adapter](https://github.com/osmangokalp/contopt-js/blob/master/public_html/ParticleSwarmOptimization_Sensor.js): `public_html/ParticleSwarmOptimization_Sensor.js`

### Optimization foundation

- [Optimizer base](https://github.com/osmangokalp/contopt-js/blob/master/public_html/ContinuousOptimizer.js): `public_html/ContinuousOptimizer.js`
- [Solution state](https://github.com/osmangokalp/contopt-js/blob/master/public_html/Solution.js): `public_html/Solution.js`
- [Gaussian RNG](https://github.com/osmangokalp/contopt-js/blob/master/public_html/GaussianRNG.js): `public_html/GaussianRNG.js`

### Objective problems

- [Benchmark objectives](https://github.com/osmangokalp/contopt-js/blob/master/public_html/BenchmarkFunctions.js): `public_html/BenchmarkFunctions.js`
- [Coverage problem](https://github.com/osmangokalp/contopt-js/blob/master/public_html/SensorDeploymentProblem.js): `public_html/SensorDeploymentProblem.js`

### Other components

- **User**

## Connections

- User → Benchmark examples: configures run
- User → Sensor case study: configures case
- Benchmark examples → Bee colony: starts worker
- Benchmark examples → Differential evolution: starts worker
- Benchmark examples → Evolution strategies: starts worker
- Benchmark examples → Genetic algorithm: starts worker
- Benchmark examples → Particle swarm: starts worker
- Benchmark examples → Annealing: starts worker
- Sensor case study → Bee sensor adapter: starts worker
- Sensor case study → DE sensor adapter: starts worker
- Sensor case study → GA sensor adapter: starts worker
- Sensor case study → PSO sensor adapter: starts worker
- Bee colony → Optimizer base: inherits and calls
- Differential evolution → Optimizer base: inherits and calls
- Evolution strategies → Optimizer base: inherits and calls
- Genetic algorithm → Optimizer base: inherits and calls
- Particle swarm → Optimizer base: inherits and calls
- Annealing → Optimizer base: inherits and calls
- Bee colony → Solution state: stores candidates
- Differential evolution → Solution state: stores candidates
- Evolution strategies → Solution state: stores candidates
- Genetic algorithm → Solution state: stores candidates
- Particle swarm → Solution state: stores candidates
- Annealing → Solution state: stores candidates
- Bee colony → Benchmark objectives: evaluates objective
- Differential evolution → Benchmark objectives: evaluates objective
- Evolution strategies → Benchmark objectives: evaluates objective
- Genetic algorithm → Benchmark objectives: evaluates objective
- Particle swarm → Benchmark objectives: evaluates objective
- Annealing → Benchmark objectives: evaluates objective
- Evolution strategies → Gaussian RNG: samples mutations
- Annealing → Gaussian RNG: samples neighbors
- Bee sensor adapter → Bee colony: extends algorithm
- DE sensor adapter → Differential evolution: extends algorithm
- GA sensor adapter → Genetic algorithm: extends algorithm
- PSO sensor adapter → Particle swarm: extends algorithm
- Bee sensor adapter → Coverage problem: scores coverage
- DE sensor adapter → Coverage problem: scores coverage
- GA sensor adapter → Coverage problem: scores coverage
- PSO sensor adapter → Coverage problem: scores coverage
- Sensor case study → Coverage problem: provides case data
- Sensor case study → Sensor display: displays deployment
- Bee colony → Benchmark examples: posts best result
- Differential evolution → Benchmark examples: posts best result
- Evolution strategies → Benchmark examples: posts best result
- Genetic algorithm → Benchmark examples: posts best result
- Particle swarm → Benchmark examples: posts best result
- Annealing → Benchmark examples: posts best result
