Model.hm_getsolver#

Model.hm_getsolver(value='name')#

Returns the name or ID of the solver as provided by the template. If no name is provided, or no template is loaded, "none" is returned.

Parameters:

value (hwString) –

An optional argument that specifies the type of value to return. Valid values:

id - Return the template ID

name - Return the template name (default)

Returns:

  • hwReturnStatus - Status object

  • HmQueryResult - Result object containing the output values:

    • Keys valid for value="id"

      • solver (int) - The ID of the solver as provided by the template.

    • Keys valid for value="name"

      • solver (str) - The name of the solver as provided by the template.

Examples#

Get the ID of the current solver template#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_getsolver(value="id")

print("Solver Template ID:", result.solver)
Get the name of the current solver template#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_getsolver()

print("Solver Template Name:", result.solver)