pumpkin_core/propagators/nogoods/learning_options.rs
1/// Options related to nogood management, i.e., how and when to remove learned nogoods from the
2/// database.
3#[derive(Debug, Copy, Clone)]
4pub struct LearningOptions {
5 /// Determines when to rescale the activites of the learned nogoods in the database.
6 pub max_activity: f32,
7 /// Determines the factor by which the activities are divided when a conflict is found.
8 pub activity_decay_factor: f32,
9 /// The solver partitions the nogoods into three tiers.
10 ///
11 /// This limit specifies how many nogoods can be stored in the "high" LBD tier.
12 pub max_num_high_lbd_nogoods: usize,
13 /// The solver partitions the nogoods into three tiers.
14 ///
15 /// This limit specifies how many nogoods can be stored in the "mid" LBD tier.
16 pub max_num_mid_lbd_nogoods: usize,
17 /// The solver partitions the nogoods into three tiers.
18 ///
19 /// This limit specifies how many nogoods can be stored in the "low" LBD tier.
20 pub max_num_low_lbd_nogoods: usize,
21 /// Used to determine which tier a nogood belongs in.
22 ///
23 /// If the LBD of a nogood is higher than or equal to this threshold then it is considered to
24 /// be a "high" LBD nogood.
25 ///
26 /// If the LBD of a nogood is between [`LearningOptions::lbd_threshold_high`] and
27 /// [`LearningOptions::lbd_threshold_low`] then it is considered a "mid" LBD nogood.
28 pub lbd_threshold_high: u32,
29 /// Used to determine which tier a nogood belongs in.
30 ///
31 /// If the LBD of a nogood is lower than or equal to this value then it is considered to be a
32 /// "low" LBD nogood.
33 ///
34 /// If the LBD of a nogood is between [`LearningOptions::lbd_threshold_high`] and
35 /// [`LearningOptions::lbd_threshold_low`] then it is considered a "mid" LBD nogood.
36 pub lbd_threshold_low: u32,
37 /// Specifies by how much the activity is increased when a nogood is bumped.
38 pub activity_bump_increment: f32,
39}
40impl Default for LearningOptions {
41 fn default() -> Self {
42 Self {
43 max_activity: 1e20,
44 activity_decay_factor: 0.99,
45 max_num_high_lbd_nogoods: 20000,
46 max_num_mid_lbd_nogoods: 7000,
47 max_num_low_lbd_nogoods: 100000,
48 lbd_threshold_high: 7,
49 lbd_threshold_low: 3,
50 activity_bump_increment: 1.0,
51 }
52 }
53}