Skip to content

Commit 6b680bb

Browse files
committed
Deep JavaDoc polish for algorithm alias drivers. Added mini-formulas and primary references directly in class-level JavaDocs.
1 parent 90d391f commit 6b680bb

514 files changed

Lines changed: 10549 additions & 169 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Documentation portal: [https://edaf.readthedocs.io/](https://edaf.readthedocs.io
3232
- [Docker Usage](#docker-usage)
3333
- [Extending the Framework](#extending-the-framework)
3434
- [Using EDAF as Package](#using-edaf-as-package)
35+
- [API JavaDoc](#api-javadoc)
3536
- [Release and Publishing](#release-and-publishing)
3637
- [Testing and Quality](#testing-and-quality)
3738
- [Complexity and Performance](#complexity-and-performance)
@@ -826,6 +827,26 @@ For a concrete external Maven project example (custom plugin + run + web monitor
826827
- [docs/using-edaf-as-package.md](docs/using-edaf-as-package.md)
827828
- [examples/external-package-sample/README.md](examples/external-package-sample/README.md)
828829

830+
## API JavaDoc
831+
832+
EDAF includes package-level JavaDoc across core, algorithms, models, problems, persistence, CLI and web modules, plus expanded mathematical docs for key probabilistic models and algorithm drivers.
833+
834+
Generate aggregated API docs locally:
835+
836+
```bash
837+
./scripts/docs/build-javadocs.sh
838+
```
839+
840+
Alternative direct Maven command:
841+
842+
```bash
843+
mvn -q -P apidocs -DskipTests verify
844+
```
845+
846+
Generated entrypoint:
847+
848+
- `target/site/apidocs/index.html`
849+
829850
## Release and Publishing
830851

831852
For GitHub release, Maven Central (mvnrepository visibility), and Read the Docs publishing:
@@ -911,6 +932,7 @@ Full EDA/baseline/statistical bibliography:
911932
- [docs/benchmark-comparisons.md](docs/benchmark-comparisons.md) - reproducible side-by-side benchmark outputs
912933
- [docs/complexity-and-performance.md](docs/complexity-and-performance.md) - asymptotic complexity + measured runtime snapshot
913934
- [docs/testing-and-release.md](docs/testing-and-release.md) - release hardening checklist and validation pipeline
935+
- [docs/javadoc-api.md](docs/javadoc-api.md) - aggregated API docs generation and navigation guide
914936
- [docs/bibliography.md](docs/bibliography.md) - exhaustive EDA literature and benchmarking references
915937
- [docs/cli-reference.md](docs/cli-reference.md) - exhaustive command reference
916938
- [docs/docker.md](docs/docker.md) - containerized workflows

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ flowchart TD
5050
- [Benchmark Comparisons](./benchmark-comparisons.md)
5151
- [Complexity and Performance](./complexity-and-performance.md)
5252
- [Testing and Release Hardening](./testing-and-release.md)
53+
- [API JavaDoc](./javadoc-api.md)
5354
- [Bibliography](./bibliography.md)
5455

5556
## Operations

docs/javadoc-api.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<p align="right"><img src="./assets/branding/edaf_logo2.png" alt="EDAF logo" width="180" /></p>
2+
3+
# API JavaDoc
4+
5+
This page describes how EDAF Java API documentation is generated and how to navigate it efficiently.
6+
7+
## Scope
8+
9+
EDAF v3 JavaDoc now includes:
10+
11+
- package-level docs (`package-info.java`) for core, algorithms, models, problems, persistence, CLI, web, reporting, representations and COCO modules
12+
- expanded class-level docs for key algorithm drivers and probabilistic model implementations
13+
- mathematical descriptions for core update equations in discrete/continuous/permutation model families
14+
15+
## Documentation Standard Used
16+
17+
EDAF JavaDoc uses the following conventions across classes and public methods:
18+
19+
- Class JavaDoc:
20+
- complete sentence description ending with a period
21+
- `@author Karlo Knezevic`
22+
- `@version EDAF 3.0.0`
23+
- Method JavaDoc:
24+
- one-sentence (or longer) behavior description ending with a period
25+
- one `@param` entry per parameter
26+
- `@return` phrase for non-`void` methods
27+
- `@param` / `@return` descriptions are concise phrases without trailing punctuation
28+
- avoid type names and variable names inside `@return` description
29+
- avoid dash-based parameter format (for example, no `@param x - ...`)
30+
31+
## Generate Local API Docs
32+
33+
From repository root:
34+
35+
```bash
36+
./scripts/docs/build-javadocs.sh
37+
```
38+
39+
Equivalent Maven command:
40+
41+
```bash
42+
mvn -q -P apidocs -DskipTests verify
43+
```
44+
45+
Output entrypoint:
46+
47+
- `target/site/apidocs/index.html`
48+
49+
## Where JavaDoc Configuration Lives
50+
51+
- Root Maven profile: `apidocs` in `pom.xml`
52+
- Helper script: `scripts/docs/build-javadocs.sh`
53+
54+
`apidocs` profile runs Maven Javadoc aggregate goal over the whole reactor, so cross-module links are preserved.
55+
56+
## Recommended Navigation
57+
58+
1. Start at package summary pages to understand module boundaries and responsibilities.
59+
2. Open model classes under:
60+
- `com.knezevic.edaf.v3.models.discrete`
61+
- `com.knezevic.edaf.v3.models.continuous`
62+
- `com.knezevic.edaf.v3.models.permutation`
63+
3. Review algorithm drivers under `com.knezevic.edaf.v3.algorithms*`.
64+
4. Cross-check runtime orchestration in `com.knezevic.edaf.v3.experiments.runner`.
65+
66+
## CI/Release Usage
67+
68+
For release validation, include API doc generation in your local pre-release checklist:
69+
70+
```bash
71+
mvn -q -P apidocs -DskipTests verify
72+
```
73+
74+
If this succeeds, JavaDoc structure and symbol resolution are healthy across modules.

docs/testing-and-release.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Gate criteria:
2323
2. Spotless check passes.
2424
3. `edaf-web` packages successfully.
2525
4. Docker runner and web images build from clean context.
26-
5. No generated artifacts pollute root directory.
26+
5. Aggregated JavaDoc generation succeeds.
27+
6. No generated artifacts pollute root directory.
2728

2829
## 2) Full test commands
2930

@@ -50,6 +51,12 @@ mvn -q -pl edaf-core,edaf-experiments -am test
5051
./edaf run -c configs/umda-onemax-v3.yml --verbosity quiet
5152
```
5253

54+
## 2.4 API JavaDoc generation
55+
56+
```bash
57+
./scripts/docs/build-javadocs.sh
58+
```
59+
5360
## 3) Parallelism validation
5461

5562
EDAF has two concurrency layers:

edaf-algorithms/src/main/java/com/knezevic/edaf/v3/algorithms/EhmPermutationEdaAlgorithm.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,31 @@
88
import com.knezevic.edaf.v3.repr.types.PermutationVector;
99

1010
/**
11-
* EHM permutation EDA driver.
11+
* Dedicated EHM/EHBSA-style permutation driver based on edge-histogram modeling.
12+
*
13+
* <p>Typical paired model represents adjacency probabilities:
14+
* <pre>
15+
* P(next = j | current = i)
16+
* </pre>
17+
* and samples permutations by traversing unused nodes according to transition rows.
18+
*
19+
* <p>References:
20+
* <ol>
21+
* <li>M. Tsutsui, "Probabilistic model-building genetic algorithms in permutation domains,"
22+
* GECCO Workshop, 2006.</li>
23+
* <li>P. Larranaga and J. A. Lozano (eds.), "Estimation of Distribution Algorithms,"
24+
* Kluwer, 2001.</li>
25+
* </ol>
26+
* @author Karlo Knezevic
27+
* @version EDAF 3.0.0
1228
*/
1329
public final class EhmPermutationEdaAlgorithm extends RatioBasedEdaAlgorithm<PermutationVector> {
1430

31+
/**
32+
* Creates a new EhmPermutationEdaAlgorithm instance.
33+
*
34+
* @param selectionRatio fraction of population used for model fitting
35+
*/
1536
public EhmPermutationEdaAlgorithm(double selectionRatio) {
1637
super("ehm-eda", selectionRatio);
1738
}

edaf-algorithms/src/main/java/com/knezevic/edaf/v3/algorithms/FlowEdaAlgorithm.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,30 @@
88
import com.knezevic.edaf.v3.repr.types.RealVector;
99

1010
/**
11-
* Flow-based continuous EDA driver.
11+
* Dedicated flow-inspired continuous EDA driver using non-linear density transforms.
12+
*
13+
* <p>Typical paired model draws latent Gaussian samples and applies a parameterized map:
14+
* <pre>
15+
* z ~ N(0, I), x = f_θ(z)
16+
* </pre>
17+
* where {@code f_θ} is updated from elite statistics.
18+
*
19+
* <p>References:
20+
* <ol>
21+
* <li>D. J. Rezende and S. Mohamed, "Variational inference with normalizing flows,"
22+
* ICML, 2015.</li>
23+
* <li>D. Wierstra et al., "Natural evolution strategies," JMLR, 2014.</li>
24+
* </ol>
25+
* @author Karlo Knezevic
26+
* @version EDAF 3.0.0
1227
*/
1328
public final class FlowEdaAlgorithm extends RatioBasedEdaAlgorithm<RealVector> {
1429

30+
/**
31+
* Creates a new FlowEdaAlgorithm instance.
32+
*
33+
* @param selectionRatio fraction of population used for model fitting
34+
*/
1535
public FlowEdaAlgorithm(double selectionRatio) {
1636
super("flow-eda", selectionRatio);
1737
}

edaf-algorithms/src/main/java/com/knezevic/edaf/v3/algorithms/FullCovarianceEdaAlgorithm.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,31 @@
88
import com.knezevic.edaf.v3.repr.types.RealVector;
99

1010
/**
11-
* Full-covariance continuous EDA driver.
11+
* Dedicated full-covariance Gaussian EDA driver for correlated real-valued search.
12+
*
13+
* <p>Typical paired model learns correlated Gaussian density:
14+
* <pre>
15+
* p(x) = N(x; μ, Σ)
16+
* </pre>
17+
* and samples via Cholesky factorization {@code x = μ + Lz}, {@code LL^T = Σ}.
18+
*
19+
* <p>References:
20+
* <ol>
21+
* <li>P. Larranaga, "Optimization in continuous domains by learning and simulation
22+
* of Gaussian networks," GECCO Workshop, 2000.</li>
23+
* <li>P. Larranaga and J. A. Lozano (eds.), "Estimation of Distribution Algorithms,"
24+
* Kluwer, 2001.</li>
25+
* </ol>
26+
* @author Karlo Knezevic
27+
* @version EDAF 3.0.0
1228
*/
1329
public final class FullCovarianceEdaAlgorithm extends RatioBasedEdaAlgorithm<RealVector> {
1430

31+
/**
32+
* Creates a new FullCovarianceEdaAlgorithm instance.
33+
*
34+
* @param selectionRatio fraction of population used for model fitting
35+
*/
1536
public FullCovarianceEdaAlgorithm(double selectionRatio) {
1637
super("full-covariance-eda", selectionRatio);
1738
}

edaf-algorithms/src/main/java/com/knezevic/edaf/v3/algorithms/GaussianDiagEdaAlgorithm.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,31 @@
88
import com.knezevic.edaf.v3.repr.types.RealVector;
99

1010
/**
11-
* Gaussian diagonal EDA algorithm driver.
11+
* Dedicated diagonal-Gaussian continuous EDA driver.
12+
*
13+
* <p>Typical paired model assumes independent marginals:
14+
* <pre>
15+
* p(x) = Π_d N(x_d; μ_d, σ_d²)
16+
* </pre>
17+
* with {@code (μ, σ)} re-estimated from elite samples each iteration.
18+
*
19+
* <p>References:
20+
* <ol>
21+
* <li>H. Muehlenbein, J. Bendisch, and H.-M. Voigt, "From recombination of genes to
22+
* the estimation of distributions II. Continuous parameters," PPSN IV, 1996.</li>
23+
* <li>P. Larranaga and J. A. Lozano (eds.), "Estimation of Distribution Algorithms,"
24+
* Kluwer, 2001.</li>
25+
* </ol>
26+
* @author Karlo Knezevic
27+
* @version EDAF 3.0.0
1228
*/
1329
public final class GaussianDiagEdaAlgorithm extends RatioBasedEdaAlgorithm<RealVector> {
1430

31+
/**
32+
* Creates a new GaussianDiagEdaAlgorithm instance.
33+
*
34+
* @param selectionRatio fraction of population used for model fitting
35+
*/
1536
public GaussianDiagEdaAlgorithm(double selectionRatio) {
1637
super("gaussian-eda", selectionRatio);
1738
}

edaf-algorithms/src/main/java/com/knezevic/edaf/v3/algorithms/HBoaAlgorithm.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,30 @@
88
import com.knezevic.edaf.v3.repr.types.BitString;
99

1010
/**
11-
* Hierarchical BOA algorithm driver.
11+
* Dedicated hierarchical BOA (hBOA) driver for binary dependency-heavy search.
12+
*
13+
* <p>Typical paired model is a sparse Bayesian network with conditional factorization:
14+
* <pre>
15+
* p(x) = Π_i p(x_i | Pa_i)
16+
* </pre>
17+
* with hierarchical decomposition of variable interactions.
18+
*
19+
* <p>References:
20+
* <ol>
21+
* <li>M. Pelikan and D. E. Goldberg, "Hierarchical Bayesian optimization algorithm,"
22+
* GECCO, 2001.</li>
23+
* <li>M. Pelikan, D. E. Goldberg, and E. Cantú-Paz, "BOA," GECCO, 1999.</li>
24+
* </ol>
25+
* @author Karlo Knezevic
26+
* @version EDAF 3.0.0
1227
*/
1328
public final class HBoaAlgorithm extends RatioBasedEdaAlgorithm<BitString> {
1429

30+
/**
31+
* Creates a new HBoaAlgorithm instance.
32+
*
33+
* @param selectionRatio fraction of population used for model fitting
34+
*/
1535
public HBoaAlgorithm(double selectionRatio) {
1636
super("hboa", selectionRatio);
1737
}

edaf-algorithms/src/main/java/com/knezevic/edaf/v3/algorithms/RatioBasedEdaAlgorithm.java

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,63 @@
1010
import com.knezevic.edaf.v3.core.api.Population;
1111

1212
/**
13-
* Generic model-based EDA driver using ratio-based truncation for model fit selection size.
13+
* Generic ratio-based EDA driver.
14+
*
15+
* <p>This base class implements the canonical EDA cycle from
16+
* {@link AbstractEdaAlgorithm}: initialize population, evaluate, select elites,
17+
* fit model, sample offspring, and apply replacement. The only strategy detail
18+
* overridden here is elite size:
19+
* <pre>
20+
* eliteCount = round(selectionRatio * populationSize)
21+
* </pre>
22+
* clipped to at least one individual.</p>
23+
*
24+
* <p>Dedicated algorithm aliases (UMDA, BOA, PBIL, etc.) inherit this behavior
25+
* and express algorithm identity through plugin/model selection in configuration.</p>
26+
*
27+
* <p>References:
28+
* <ul>
29+
* <li>Larrañaga and Lozano (2001) - Estimation of Distribution Algorithms</li>
30+
* <li>Mühlenbein and Paass (1996) - UMDA</li>
31+
* </ul></p>
32+
*
33+
* @param <G> genotype type
34+
* @author Karlo Knezevic
35+
* @version EDAF 3.0.0
1436
*/
1537
public class RatioBasedEdaAlgorithm<G> extends AbstractEdaAlgorithm<G> {
1638

1739
private final String id;
1840
private final double selectionRatio;
1941

42+
/**
43+
* Creates a ratio-based algorithm driver with bounded elite selection ratio.
44+
*
45+
* @param id stable algorithm identifier used in events, persistence and CLI
46+
* @param selectionRatio fraction of population used for model fitting
47+
*/
2048
public RatioBasedEdaAlgorithm(String id, double selectionRatio) {
2149
this.id = id;
2250
this.selectionRatio = Math.max(0.01, Math.min(1.0, selectionRatio));
2351
}
2452

53+
/**
54+
* Returns algorithm identifier.
55+
*
56+
* @return algorithm identifier
57+
*/
2558
@Override
2659
public String id() {
2760
return id;
2861
}
2962

63+
/**
64+
* Returns number of selected individuals used for model fitting.
65+
*
66+
* @param context algorithm runtime context
67+
* @param population current population
68+
* @return elite count used for model fitting
69+
*/
3070
@Override
3171
protected int selectionSize(AlgorithmContext<G> context, Population<G> population) {
3272
return Math.max(1, (int) Math.round(population.size() * selectionRatio));

0 commit comments

Comments
 (0)