I want to get the value of the target function which is the sum of constraint function with the solution assgined to them. I found there are two member functions in Solution class. Could I get the sum from getReportedUtil or getUtility? Thx!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The difference between these two methods is the following:
getReportedUtil() returns the utility (or cost) of the solution produced by the algorithm, as computed by the agents themselves;
getUtility() returns the true utility (or cost) of the solution produced by the algorithm.
In some cases and for some algorithms, these two utilities can differ. For instance, most local search algorithms do not provide the agents the visibility of the global utility/cost of the current solution with respect to all constraints in the problem, and therefore the reported utility will be an approximation of the true utility. For complete algorithms, however, both utilities should always be the same.
If you are just interested in the actual utility/cost of the solution, taking all constraints into account, you can just call getUtility().
Best,
Thomas
Last edit: Thomas B. Léauté 2015-08-24
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to get the value of the target function which is the sum of constraint function with the solution assgined to them. I found there are two member functions in Solution class. Could I get the sum from getReportedUtil or getUtility? Thx!
Dear Xie Yi,
The difference between these two methods is the following:
In some cases and for some algorithms, these two utilities can differ. For instance, most local search algorithms do not provide the agents the visibility of the global utility/cost of the current solution with respect to all constraints in the problem, and therefore the reported utility will be an approximation of the true utility. For complete algorithms, however, both utilities should always be the same.
If you are just interested in the actual utility/cost of the solution, taking all constraints into account, you can just call getUtility().
Best,
Thomas
Last edit: Thomas B. Léauté 2015-08-24
thx that helps