@staticmethod
def callback(model, where):
    """ A callback function for Gurobi that is able to terminate the MIP solver if a solution
        which is better than the sent codeword has been found.
        """
    from gurobimh import GRB
    if where == GRB.Callback.MIPNODE:
        if model.cbGet(GRB.Callback.MIPNODE_OBJBST
            ) < model._realObjective - 1e-06:
            model._incObj = model.cbGet(GRB.Callback.MIPNODE_OBJBST)
            model.terminate()
