Create a new algorithm project using NetBeans
-
Create a new project for the Java algorithm by selecting File > New Project from the NetBeans menu.

-
Under Categories, select Java. Then under Projects, select Java Class Library, and then press the Next button.

-
Enter the name of the project and the save location, and then press the Finish button.

-
Right-click on Libraries and select Add JAR/Folder.

-
Locate PHXSolverInfrastructure.jar in the Algorithm Developer Tools directory. Typically:
"C:\Program Files\Phoenix Integration\Algorithm Developer Tools"
-
Right-click on Source Packages and select New > Java Class.

-
Name the algorithm class name and specify its package, then press the Finish button.

-
In the algorithm file, add:
after the class name, e.g.,

-
Right-click on IAlgorithm and select Insert Code, then Implement Method:


-
Click the checkbox next to IAlgorithm and IDisposable, then click the Generate button.

-
It is recommended that each algorithm have its own GuidAttribute to uniquely identify the algorithm. To add a GuidAttribute to the algorithm, place attibute before the class definition.
New GUIDs can be generated using Create a GUID or some other similar tool.
Conclusion
The base class for the Java algorithm has now been implemented. The rest of the guide is based on .NET, but the major differences for Java are that properties use get property name and methods start with lowercase letters. Java algorithms install to the same location as the .NET algorithms, and the build file can be modified to move the algorithm to the correct location using the ant copy task.Add manifest file for algorithm
A manifest file must be added to tell the Optimization Tool which JAR files should be searched for implementations ofIAlgorithm. To add the manifest:
- Right-click on the project in NetBeans and select New > Other from the context menu.
- Select Other under Categories: and Empty File under File Types: and press the Next button.
- Name the file manifest.phx and press Finish.
-
The file should be created in the project’s base directory. Open the manifest file and enter the name of the JAR file output by the algorithm project. A single manifest file can specify multiple files that contain
IAlgorithmimplementations, but only one file name should be specified per line.