Environment#

class amplpy.Environment#

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

__getitem__(self, name)#

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

__iter__()#

Implement iter(self).

__setitem__(self, 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.

get_bin_dir(self)#

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

get_bin_name(self)#

Get the name of the AMPL executable.

set_bin_dir(self, 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.

set_bin_name(self, binary_name)#

Set the name of the AMPL executable.

Args:

binary_name: The name of the AMPL executable.

toString()#

Environment.to_string(self)

to_string(self)#