Initializing help system before first use

# problem.addBeforeObjectiveCallback

Purpose
Declares a callback which will be called before each objective in a multi-objective problem is solved.
Topic areas
Callback, Multiobjective
Synopsis
`problem.addBeforeObjectiveCallback(beforeobjective, data=None, priority=0)`
`beforeobjective(cbprob, cbdata)`
Arguments

beforeobjective | The callback function itself, which takes arguments cbprob and cbdata. This function is called before every solve.
data | A user-defined data to be passed to the callback function, beforeobjective.
priority | An integer that determines the order in which multiple before-objective callbacks will be invoked. The callback added with a higher priority will be called before a callback with a lower priority. Set to 0 if not required.
cbprob | The problem passed to the callback function, beforeobjective.
cbdata | The user-defined data passed as data when setting up the callback.

Further information
1. If the solve does not stop early, this callback will be invoked OBJSTOSOLVE times. Note that this can be less than than OBJECTIVES times, since all objectives with the same priority are combined into a single objective and solved at once.
2. During this callback, the main objective (as queried with problem.getObj) will reflect the current objective being solved, which may be a weighted combination of several objectives with the same priority level. But changes made to the problem to fix earlier objectives at their optimal value will not be visible in the problem during this callback.
3. Controls set during this callback will retain their values when solving all subsequent objectives, except for controls which set resource limits: TIMELIMIT, SOLTIMELIMIT, MAXTIME, MAXNODE, LPITERLIMIT, NLPMAXTIME and SLPITERLIMIT. These are recomputed before each call to beforeobjective, based on their original values before the solve and the resources consumed when solving all previous objectives. Changes to resource limit controls will therefore only be retained while solving the current objective.
Related topics
problem.removeBeforeObjectiveCallback, problem.addAfterObjectiveCallback.
Parent Topic Methods of the class problem

© 2001-2026 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.