Hello.
I've also started to take a look.
There are issues with the expected functionality of the "examples-ga" module.
Assuming that the following command has been issued
$ JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/ mvn package
and has completed successfully, executable JAR files should have been
created under the "target" directories.
For example, issuing this command (example for the "neuralnet" module):
$ java -jar
commons-math-examples/examples-sofm/tsp/target/examples-sofm-tsp.jar
outputs
---CUT---
Missing required option '-o=outputFile'
Usage: <main class> [-hV] [-j=numJobs] [-m=maxTrials] [-n=neuronsPerCity]
-o=outputFile [-s=numSamples]
Run the application
-h, --help Show this help message and exit.
-j=numJobs Number of concurrent tasks (default: 8).
-m=maxTrials Maximal number of trials (default: 10).
-n=neuronsPerCity Average number of neurons per city (default: 2.2).
-o=outputFile Output file name.
-s=numSamples Number of samples for the training (default: 2000).
-V, --version Print version information and exit.
---CUT---
The above thus shows that the program runs as expected (passing the missing
required argument produces the expected output file).
Doing the equivalent for the new examples, e.g.
$ java -jar
commons-math-examples/examples-ga/examples-ga-tsp/target/examples-ga-mathfunctions.jar
results in
---CUT---
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load
library: /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2630)
at java.base/java.lang.Runtime.load0(Runtime.java:768)
at java.base/java.lang.System.load(System.java:1837)
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
at
java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2648)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
at java.base/java.lang.System.loadLibrary(System.java:1873)
at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1399)
at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1397)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1396)
at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1429)
at java.desktop/java.awt.Component.<clinit>(Component.java:621)
at
org.apache.commons.math4.examples.ga.tsp.TSPOptimizer.main(TSPOptimizer.java:62)
---CUT---
[Please note that the name of the JAR also looks wrong (a copy/paste mistake?).]
Command
$ java -jar
commons-math-examples/examples-ga/examples-ga-math-functions/target/examples-ga-mathfunctions.jar
also fails, with the following error
---CUT---
Error: Could not find or load main class
org.apache.commons.math4.examples.ga.mathfunctions.Dimension2FunctionOptimizer
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.math4.examples.ga.mathfunctions.Dimension2FunctionOptimizer
---CUT---
I noticed that there is an example relating to "Dimension2" and another
to "DimensionN". Isn't the former, in principle, a special case of the latter?
Regards,
Gilles
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]