Environment¶
-
public class
Environment¶ This class provides access to the environment variables and provides facilities to specify where to load the underlying AMPL interpreter.
Fields¶
-
public static final String
PATH¶ Get the platform dependent name of the
pathenvironment variable. To append a directory to current list of system paths, follow the snippet below:Environment e = new Environment(); String paths = e.getMap().get(Environment.PATH); e.getMap().put(Environment.PATH, paths + java.io.File.pathSeparatorChar + "/mynewpath");
Note that changing the paths in this way has effect only until the underlying AMPL process is started (in the
AMPLclass constructor)
Constructors¶
-
public
Environment()¶ Default constructor, just copies the values of the current system environment variables. Expects the AMPL binary in a directory included in the system paths list or in the default position (which is APIJARLOCATION/ampl)
Methods¶
-
public void
addToPath(String directory)¶ Add the specified directory to the system path (for AMPL interpreter subprocess environment) Note that it has no effect after the AMPL interpreter is constructed.
Parameters: - directory – Directory to be appended
-
public String
getBinDir()¶ Returns the directory containing the overriding AMPL executable directory.