[Aptitude-devel] r2975 - in branches/aptitude-0.3/aptitude: . src/generic/problemresolver
Daniel Burrows
dburrows@costa.debian.org
Sun, 10 Apr 2005 00:05:07 +0000
Author: dburrows
Date: Sun Apr 10 00:05:03 2005
New Revision: 2975
Modified:
branches/aptitude-0.3/aptitude/ChangeLog
branches/aptitude-0.3/aptitude/src/generic/problemresolver/aptitude_resolver.h
Log:
Prototype a more general scoring function.
Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog (original)
+++ branches/aptitude-0.3/aptitude/ChangeLog Sun Apr 10 00:05:03 2005
@@ -1,5 +1,9 @@
2005-04-09 Daniel Burrows <dburrows@debian.org>
+ * src/generic/problemresolver/aptitude_resolver.h:
+
+ Write up a prototype for a super-duper-scoring-function.
+
* src/generic/problemresolver/problemresolver.h:
When dumping the universe, include the syntactic sugar arrows so
Modified: branches/aptitude-0.3/aptitude/src/generic/problemresolver/aptitude_resolver.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/problemresolver/aptitude_resolver.h (original)
+++ branches/aptitude-0.3/aptitude/src/generic/problemresolver/aptitude_resolver.h Sun Apr 10 00:05:03 2005
@@ -964,6 +964,40 @@
}
};
-typedef generic_problem_resolver<aptitude_universe> aptitude_resolver;
+class aptitude_resolver:generic_problem_resolver<aptitude_universe>
+{
+public:
+ aptitude_resolver(int step_penalty, int broken_penalty,
+ const aptitude_universe &universe);
+
+ /** Assign scores to all packages and all package versions according
+ * to its arguments. All scores are assigned with add_score, so
+ * this can be easily combined with other policies.
+ *
+ * \param preserve_score the score to assign to the version that the
+ * user selected.
+ *
+ * \param auto_score the score to assign to automatically assigned
+ * actions. By making this smaller than preserve_score you can bias
+ * the system towards overriding automatic decisions rather than
+ * user actions.
+ *
+ * \param remove_score the score to assign to removing a package
+ * against the user's wishes.
+ *
+ * \param keep_score the score to assign to cancelling actions on a
+ * package against the user's wishes.
+ *
+ * \param install_score the score to assign to removing a package
+ * against the user's wishes.
+ *
+ * \param non_default_score the score to assign to installing a
+ * non-default version of a package (such as a downgrade or an
+ * experimental version).
+ */
+ void add_scores(int preserve_score, int auto_score,
+ int remove_score, int keep_score,
+ int install_score, int non_default_score);
+};
#endif