Environment

class amplpy.Environment(binary_directory=None, binary_name=None)

This class provides access to the environment variables and provides facilities to specify where to load the underlying AMPL interpreter.

__init__(binary_directory=None, binary_name=None)

Constructor with ability to select the location of the AMPL binary. Note that if binaryDirectory is set, the automatic lookup for an AMPL executable will not be executed.

Args:

binary_directory: The directory in which look for the AMPL executable. binary_name: The name of the AMPL executable.

__iter__()
__setitem__(name, value)

Add an environment variable to the environment, or change its value if already defined.

Args:

name: Name of the environment variable.

value: Value to be assigned.

__getitem__(name)

Searches the current object for an environment variable called name and returns an iterator to it if found, otherwise it returns None.

set_bin_dir(binary_directory)

Set the location where AMPL API will search for the AMPL executable.

Args:

binary_directory: The directory in which look for the AMPL executable.

get_bin_dir()

Get the location where AMPL API will search for the AMPL executable.

set_bin_name(binary_name)

Set the name of the AMPL executable.

Args:

binary_name: The name of the AMPL executable.

get_bin_name()

Get the name of the AMPL executable.

__annotations__ = {}