# Environment¶

class Environment

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

Environment()

Default constructor.

Environment(binaryDirectory)

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

Parameters: binaryDirectory (character) – The directory in which look for the AMPL Binary.
Environment.get(name)

Searches the current object for an environment variable called name and returns its value if found.

Parameters: name (character) – Name of the environment variable. The value of the variable or NA. character
Environment.put(name, value)

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

Parameters: name (character) – Name of the environment variable. value (character) – Value to be assigned.
Environment.setBinDir(binaryDirectory)

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

Parameters: binaryDirectory (character) – The directory in which look for the AMPL Binary.
Environment.getBinDir()

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

Returns: The location where AMPLAPI will search for the AMPL executable. character
Environment.toString()

Returns all variables in the object as a string.

Returns: All variables in the map. character
Environment.list()

Returns all variables in the object as a list.

Returns: All variables in the map. list