19package denoptim.integration.python;
20import java.net.BindException;
22import denoptim.exception.DENOPTIMException;
23import denoptim.io.DenoptimIO;
24import py4j.GatewayServer;
25import py4j.Py4JNetworkException;
50 private Object
data =
null;
63 GatewayServer gatewayServer =
new GatewayServer(launcher);
66 gatewayServer.start();
67 }
catch (Py4JNetworkException e)
69 if (e.getCause() instanceof BindException
70 && e.getCause().getMessage().contains(
"already in use"))
A tool that start a Py4J gateway server that can listens to calls from Python and translate JAVA obje...
void setServer(GatewayServer server)
Sets the reference to the launched server.
String getSourcePathName()
Object loadData(String pathname)
Reads any DENOPTIM-kind of data from the given pathname.
String pathname
Pathname from which data was loaded, or null if no data has been loaded.
void shutdown()
Stops the server.
Object data
Any DENOPTIM-related data loaded from file, if any.
static void launch()
Starts a gateway server using this class as entry point, which then becomes the interpreter of any da...
GatewayServer server
The actual server we launch, or null if not launched yet.
Utility methods for input/output.
static Object readDENOPTIMData(String pathname)
Reads any content of a given pathname and tries to read DENOPTIM data from it.