Ejemplo n.º 1
0
 public Clausule(bool modifier1, WeightedVariable variable1, bool modifier2, WeightedVariable variable2, bool modifier3, WeightedVariable variable3)
 {
     _modifier1 = modifier1;
     _variable1 = variable1;
     _modifier2 = modifier2;
     _variable2 = variable2;
     _modifier3 = modifier3;
     _variable3 = variable3;
 }
Ejemplo n.º 2
0
        public Clausule(string dimacsValue)
        {
            string[] values  = dimacsValue.Split(' ');
            int      weight1 = int.Parse(values[0]);
            int      id1     = int.Parse(values[1]);
            int      weight2 = int.Parse(values[2]);
            int      id2     = int.Parse(values[3]);
            int      weight3 = int.Parse(values[4]);
            int      id3     = int.Parse(values[5]);

            _variable1 = new WeightedVariable(Math.Abs(id1), weight1);
            _variable2 = new WeightedVariable(Math.Abs(id2), weight2);
            _variable3 = new WeightedVariable(Math.Abs(id3), weight3);

            _modifier1 = !values[1].Contains("-");
            _modifier1 = !values[3].Contains("-");
            _modifier1 = !values[5].Contains("-");
        }