cardinal_opt.cpp 818 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * Project SUBool
 * Petr Kucera, 2021
 */
/**@file cardinal_opt.cpp
 * Program options related to cardinality constraints.
 */

#include "cardinal_opt.h"

SUBool::CardinalOptionsGroup::CardinalOptionsGroup()
    : OptionsGroup("Cardinality constraints"),
      mAmoEncodingOption(AmoEncoder::kKindAnnotation, "amo",
          "Which encoding to use for the at-most-one constraint.",
          kDefaultAmoEncoding),
      mExOneEncodingOption(ExOneEncoder::kKindAnnotation, "exactly-one",
          "Which encoding to use for the exactly-one constraint.",
          kDefaultExOneEncoding)
{
   Add(mAmoEncodingOption);
   Add(mExOneEncodingOption);
}

bool
SUBool::CardinalOptionsGroup::GetValues()
{
   return mAmoEncodingOption.GetValue(mAmoEncoding)
          && mExOneEncodingOption.GetValue(mExOneEncoding);
}