HxVersion Class

class hexaly.optimizer.HxVersion

Version, license and copyright info.

Summary

Attributes

major_version_number

Major version number.

minor_version_number

Minor version number.

build_date

Build date.

platform

Platform of the Hexaly Optimizer binary.

version

Version as string.

version_code

Version code.

copyright

Hexaly Optimizer copyright.

info

Version and copyright info.

license_path

License path.

license_content

License content.

Methods

get_major_version_number

Returns Hexaly Optimizer major version number.

get_minor_version_number

Returns Hexaly Optimizer minor version number.

get_build_date

Returns Hexaly Optimizer build date.

get_platform

Returns the platform of the Hexaly Optimizer binary as a string.

get_version

Returns Hexaly Optimizer version as a string.

get_version_code

Returns Hexaly Optimizer version code as an integer in the range [0, 29999].

get_copyright

Returns Hexaly Optimizer copyright as a string.

get_info

Returns version and copyright info as a string.

get_license_path

Returns the license path of Hexaly Optimizer.

set_license_path

Change the license path used by Hexaly Optimizer.

get_license_content

Returns the license content previously set with set_license_content() or the HX_LICENSE_CONTENT environment variable.

set_license_content

Change the license content.

Instance methods

HxVersion.get_major_version_number()

Returns Hexaly Optimizer major version number. This number is an integer in the range [0, 2999].

You can also use the shortcut member major_version_number

Returns:

Major version number.

Return type:

int

HxVersion.get_minor_version_number()

Returns Hexaly Optimizer minor version number. This number is an integer in the range [0, 9].

You can also use the shortcut member minor_version_number

Returns:

Minor version number.

Return type:

int

HxVersion.get_build_date()

Returns Hexaly Optimizer build date. This number is an integer YYYYMMDD with YYYY the year, MM the month, DD the day.

You can also use the shortcut member build_date

Returns:

Build date

Return type:

int

HxVersion.get_platform()

Returns the platform of the Hexaly Optimizer binary as a string. The format of the string is PPPPXX where PPPP is the platform (Win, Linux or MacOS) and XX is the architecture (32 or 64 bits).

You can also use the shortcut member platform

Returns:

Platform as string.

Return type:

str

Since:

3.0

HxVersion.get_version()

Returns Hexaly Optimizer version as a string. The format of the string is: MA.MI.YYYYMMDD-PPPPXX with MA the major number version, MI the minor number version, YYYY the year, MM the month, DD the day, PPPP the platform (Win, Linux or MacOS) and XX the architecture.

You can also use the shortcut member version

Returns:

Version as string MA.MI.YYYYMMDD-PPPPXX.

Return type:

str

HxVersion.get_version_code()

Returns Hexaly Optimizer version code as an integer in the range [0, 29999]. The version code is computed as follows: MA * 10 + MI with MA the major number version, MI the minor number version. Note that the version code can be encoded as a 16-bit integer.

You can also use the shortcut member version_code

Returns:

Version code.

Return type:

int

Returns Hexaly Optimizer copyright as a string.

You can also use the shortcut member copyright

Returns:

Copyright notice.

Return type:

str

HxVersion.get_info()

Returns version and copyright info as a string.

You can also use the shortcut member info

Returns:

Version and copyright info.

Return type:

str

HxVersion.get_license_path()

Returns the license path of Hexaly Optimizer. By default, Hexaly Optimizer looks for a license file in the following locations, in that order:

  1. A file specified by a call to set_license_path().

  2. The HX_LICENSE_PATH environment variable.

  3. The deprecated LS_LICENSE_PATH environment variable.

  4. A license.dat file in the current directory.

  5. In the default global location (c:\\hexaly\\license.dat on

    Windows, /opt/hexaly/license.dat on Linux and macOS.

  6. In the deprecated LocalSolver global location

    (c:\localsolver\license.dat on Windows, /opt/localsolver/license.dat on Linux and macOS).

For windows users: If you used the installer to setup Hexaly, the HX_LICENSE_PATH environment variable is already defined and points to the license file present in the installation folder.

Note: The license content can also be set directly with set_license_content() or with the HX_LICENSE_CONTENT environment variable and this definition will have priority over the license file. The old environment variable LS_LICENSE_CONTENT can also be used, but its usage is deprecated.

Returns:

Path to the license

See:

set_license_path()

See:

get_license_content()

See:

set_license_content()

Since:

3.0

HxVersion.set_license_path(path)

Change the license path used by Hexaly Optimizer.

You can also use the shortcut member license_path

Parameters:

path (str) – New path for the license

Since:

3.0

HxVersion.get_license_content()

Returns the license content previously set with set_license_content() or the HX_LICENSE_CONTENT environment variable.

You can also use the shortcut member license_content

Returns:

The content of the license or an empty string if the content was not set.

Return type:

str

Since:

5.0

HxVersion.set_license_content(content)

Change the license content. By default, Hexaly Optimizer tries to get the license content from the HX_LICENSE_CONTENT environment variable or the file specified in set_license_path or in a default location. Use this function to set the license content directly, without using a file.

You can also use the shortcut member license_content

Parameters:

content (str) – Content of the license to use.

Since:

5.0

Instance attributes

All get/set methods have their attribute counterpart. You can use them as shortcuts to improve the readability or your models and codes.

HxVersion.major_version_number

Major version number. This attribute is read-only. It is a shortcut for get_major_version_number().

HxVersion.minor_version_number

Minor version number. This attribute is read-only. It is a shortcut for get_minor_version_number().

HxVersion.build_date

Build date. This attribute is read-only. It is a shortcut for get_build_date().

HxVersion.platform

Platform of the Hexaly Optimizer binary. This attribute is read-only. It is a shortcut for get_platform().

HxVersion.version

Version as string. This attribute is read-only. It is a shortcut for get_version().

HxVersion.version_code

Version code. This attribute is read-only. It is a shortcut for get_version_code().

HxVersion.copyright

Hexaly Optimizer copyright. This attribute is read-only. It is a shortcut for get_copyright().

HxVersion.info

Version and copyright info. This attribute is read-only. It is a shortcut for get_info().

HxVersion.license_path

License path. It is a shortcut for get_license_path() and set_license_path().

HxVersion.license_content

License content. It is a shortcut for get_license_content() and set_license_content().