Skip to content

Commit cbc1bb6

Browse files
committed
Update for v5
1 parent 9ba25f7 commit cbc1bb6

File tree

5 files changed

+39
-18
lines changed

5 files changed

+39
-18
lines changed

README.md

+24-4
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,20 @@ distribute the work across all available CPUs.
1010
To distribute the work across multiple machines, you must setup an Ignite config file specifying the topology and
1111
start one or more nodes following the guidance at https://ignite.apache.org/docs/latest/starting-nodes.
1212

13-
## Configuration
13+
## Troubleshooting
1414

15-
Since Apache Ignite accesses Java's proprietary APIs, you might see errors like
15+
### Inaccessible Field
16+
17+
This error occurs because Apache Ignite accesses internal Java APIs, which are not accessible on newer versions of
18+
Java.
1619

1720
```
1821
Exception in thread "main" java.lang.ExceptionInInitializerError
22+
...
1923
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field ... accessible
2024
```
2125

22-
To fix this, you will need to add the following options when starting Java.
26+
To fix this, add the following options when launching the JVM:
2327

2428
```
2529
--add-opens=java.base/jdk.internal.access=ALL-UNNAMED
@@ -50,9 +54,25 @@ To fix this, you will need to add the following options when starting Java.
5054

5155
More details can be found at https://ignite.apache.org/docs/latest/setup#running-ignite-with-java-11-or-later.
5256

57+
### Failed to create page store work directory
58+
59+
This error can occur when the file path is too long for the file system:
60+
61+
```
62+
Exception in thread "main" class org.apache.ignite.IgniteException: Failed to start processor: GridProcessorAdapter []
63+
...
64+
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to create page store work directory: <path>
65+
```
66+
67+
To fix this, we can override the generated id for the node by adding this setting when launching the JVM:
68+
69+
```
70+
-DIGNITE_OVERRIDE_CONSISTENT_ID=node00
71+
```
72+
5373
## License
5474

55-
Copyright 2009-2024 David Hadka and other contributors. All rights reserved.
75+
Copyright 2009-2025 David Hadka and other contributors. All rights reserved.
5676

5777
The MOEA Framework is free software: you can redistribute it and/or modify
5878
it under the terms of the GNU Lesser General Public License as published by

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<dependency>
4040
<groupId>org.moeaframework</groupId>
4141
<artifactId>moeaframework</artifactId>
42-
<version>4.0</version>
42+
<version>5.0</version>
4343
</dependency>
4444
<dependency>
4545
<groupId>org.apache.ignite</groupId>

src/main/java/org/moeaframework/ignite/IgniteIslandModelExample.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2009-2024 David Hadka
1+
/* Copyright 2009-2025 David Hadka
22
*
33
* This file is part of the MOEA Framework.
44
*
@@ -22,8 +22,8 @@
2222
import org.apache.ignite.Ignite;
2323
import org.apache.ignite.Ignition;
2424
import org.moeaframework.algorithm.NSGAII;
25-
import org.moeaframework.core.Problem;
26-
import org.moeaframework.core.Selection;
25+
import org.moeaframework.algorithm.extension.Frequency;
26+
import org.moeaframework.core.selection.Selection;
2727
import org.moeaframework.core.comparator.ChainedComparator;
2828
import org.moeaframework.core.comparator.CrowdingComparator;
2929
import org.moeaframework.core.comparator.ParetoDominanceComparator;
@@ -36,6 +36,7 @@
3636
import org.moeaframework.parallel.island.topology.FullyConnectedTopology;
3737
import org.moeaframework.parallel.island.topology.Topology;
3838
import org.moeaframework.problem.CEC2009.UF1;
39+
import org.moeaframework.problem.Problem;
3940

4041
public class IgniteIslandModelExample {
4142

@@ -50,7 +51,7 @@ public static void main(String[] args) throws IOException {
5051

5152
Migration migration = new SingleNeighborMigration(1, migrationSelection);
5253
Topology topology = new FullyConnectedTopology();
53-
IslandModel model = new IslandModel(1000, migration, topology);
54+
IslandModel model = new IslandModel(Frequency.ofEvaluations(1000), migration, topology);
5455

5556
for (int i = 0; i < 8; i++) {
5657
NSGAII algorithm = new NSGAII(problem);

src/main/java/org/moeaframework/ignite/IgniteMasterSlaveExample.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2009-2024 David Hadka
1+
/* Copyright 2009-2025 David Hadka
22
*
33
* This file is part of the MOEA Framework.
44
*
@@ -22,8 +22,8 @@
2222
import org.apache.ignite.Ignite;
2323
import org.apache.ignite.Ignition;
2424
import org.moeaframework.algorithm.NSGAII;
25-
import org.moeaframework.core.Problem;
26-
import org.moeaframework.util.distributed.DistributedProblem;
25+
import org.moeaframework.parallel.DistributedProblem;
26+
import org.moeaframework.problem.Problem;
2727

2828
public class IgniteMasterSlaveExample {
2929

src/main/java/org/moeaframework/ignite/MyDistributedProblem.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2009-2024 David Hadka
1+
/* Copyright 2009-2025 David Hadka
22
*
33
* This file is part of the MOEA Framework.
44
*
@@ -20,7 +20,7 @@
2020
import java.io.Serializable;
2121

2222
import org.moeaframework.core.Solution;
23-
import org.moeaframework.core.variable.EncodingUtils;
23+
import org.moeaframework.core.variable.RealVariable;
2424
import org.moeaframework.problem.AbstractProblem;
2525

2626
public class MyDistributedProblem extends AbstractProblem implements Serializable {
@@ -31,7 +31,7 @@ public MyDistributedProblem() {
3131

3232
@Override
3333
public void evaluate(Solution solution) {
34-
double x = EncodingUtils.getReal(solution.getVariable(0));
34+
double x = RealVariable.getReal(solution.getVariable(0));
3535

3636
// perform some expensive calculation
3737
double sum = 0.0;
@@ -40,14 +40,14 @@ public void evaluate(Solution solution) {
4040
sum += i;
4141
}
4242

43-
solution.setObjective(0, Math.pow(x, 2.0));
44-
solution.setObjective(1, Math.pow(x - 2.0, 2.0));
43+
solution.setObjectiveValue(0, Math.pow(x, 2.0));
44+
solution.setObjectiveValue(1, Math.pow(x - 2.0, 2.0));
4545
}
4646

4747
@Override
4848
public Solution newSolution() {
4949
Solution solution = new Solution(1, 2);
50-
solution.setVariable(0, EncodingUtils.newReal(-10.0, 10.0));
50+
solution.setVariable(0, new RealVariable(-10.0, 10.0));
5151
return solution;
5252
}
5353

0 commit comments

Comments
 (0)