The penalty for root IUs (explicitely installed IUs) or IUs to install is 1, the other penalties is a power of K (K for the most recent IU, K**2 for the second most recent IU, etc) where K is the number of installed IUs on the current system + 1.
The relevant par of the code in p2 is here (line 73): http://git.eclipse.org/c/equinox/rt.equinox.p2.git/tree/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OptimizationFunction.java Daniel Le 5 sept. 2013 à 13:31, Thomas Hallgren <[email protected]> a écrit : > Hi Daniel, > > Thanks for an elaborate explanation. It all makes sense. Next question is of > course, how is the magnitude of the two penalties (higher number of IU's > versus older versions) determined? > > - thomas > > On 2013-09-05 10:48, Daniel Le Berre wrote: >> Hi Thomas, >> >> The resolver tries to install as few IUs as possible, because each installed >> IU is associated with a penalty. >> >> Furthermore, there is also another rule which will prefer most recent >> versions to older ones. >> It means that the penalty is smaller for most recent versions than for older >> versions. >> >> So it means that when you use the most recent IUs, solutions with fewer >> installed IUs will be preferred to solutions with a higher number of IUs. >> >> But since at the end we aggregate all penalties, there might be some >> compensation effects: >> a solution installing many new recent IUs may be preferred to a solution >> installing a few older IUs. >> >> Daniel >> >> Le 4 sept. 2013 à 19:23, Thomas Hallgren <[email protected]> a écrit : >> >>> Confronted with two OK solutions, what would the p2 resolver do if one >>> solution was resolved by brining in a higher number of IUs? If it prefers >>> the one with a lower IU count, what does it do if that one satisfies some >>> requirements with lower versions? >>> >>> - thomas >>> _______________________________________________ >>> p2-dev mailing list >>> [email protected] >>> https://dev.eclipse.org/mailman/listinfo/p2-dev >> -- >> Daniel Le Berre mailto:[email protected] >> MCF-HDR, CRIL-CNRS UMR 8188 Universite d'Artois >> http://www.cril.univ-artois.fr/~leberre >> >> _______________________________________________ >> p2-dev mailing list >> [email protected] >> https://dev.eclipse.org/mailman/listinfo/p2-dev > > _______________________________________________ > p2-dev mailing list > [email protected] > https://dev.eclipse.org/mailman/listinfo/p2-dev -- Daniel Le Berre mailto:[email protected] PR, CRIL-CNRS UMR 8188 Universite d'Artois http://www.cril.univ-artois.fr/~leberre _______________________________________________ p2-dev mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/p2-dev
