aboutsummaryrefslogtreecommitdiffstats
path: root/src/apk_solver_data.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-01-28 15:31:34 +0200
committerTimo Teräs <timo.teras@iki.fi>2013-01-28 15:31:34 +0200
commitcb98b55b7e25f45ed847bc32f3267d0c8fb033e5 (patch)
tree901f6d5c6d4f7587ed3ee633ca4153e6b6af3484 /src/apk_solver_data.h
parent528156a9fa51b52474199b93a9aa720e22c42cab (diff)
downloadaports-cb98b55b7e25f45ed847bc32f3267d0c8fb033e5.tar.bz2
aports-cb98b55b7e25f45ed847bc32f3267d0c8fb033e5.tar.xz
solver: reintroduce minimum penalty logic
Basic per-name per-package specific scoring added.
Diffstat (limited to 'src/apk_solver_data.h')
-rw-r--r--src/apk_solver_data.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/apk_solver_data.h b/src/apk_solver_data.h
index 0327492056..5921e418b6 100644
--- a/src/apk_solver_data.h
+++ b/src/apk_solver_data.h
@@ -12,12 +12,35 @@
#ifndef APK_SOLVER_DATA_H
#define APK_SOLVER_DATA_H
+#include <stdint.h>
#include "apk_defines.h"
#include "apk_provider_data.h"
+struct apk_score {
+ union {
+ struct {
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ unsigned short preference;
+ unsigned short non_preferred_pinnings;
+ unsigned short non_preferred_actions;
+ unsigned short unsatisfied;
+#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ unsigned short unsatisfied;
+ unsigned short non_preferred_actions;
+ unsigned short non_preferred_pinnings;
+ unsigned short preference;
+#else
+#error Unknown endianess.
+#endif
+ };
+ uint64_t score;
+ };
+};
+
struct apk_solver_name_state {
/* dynamic */
struct list_head unsolved_list;
+ struct apk_score minimum_penalty;
struct apk_provider chosen;
unsigned int last_touched_decision;