Browse Source

renamed INextValueCHooser

master
Robin Thoni 7 years ago
parent
commit
25d9f527f3

uqac-ia-sudoku-csp/Interfaces/INextValueChooser.cs → uqac-ia-sudoku-csp/Interfaces/INextCellChooser.cs View File

@@ -2,7 +2,7 @@
2 2
 
3 3
 namespace uqac_ia_sudoku_csp.Interfaces
4 4
 {
5
-    public interface INextValueChooser
5
+    public interface INextCellChooser
6 6
     {
7 7
         void SelectVariable(Board board, out int x, out int y, IList<IConstraint> constraints);
8 8
     }

+ 4
- 4
uqac-ia-sudoku-csp/Program.cs View File

@@ -52,14 +52,14 @@ namespace uqac_ia_sudoku_csp
52 52
             generator.Generate(board, data);
53 53
             board.Print(Console.Out);
54 54
 
55
-            INextValueChooser nextValueChooser = null;
55
+            INextCellChooser nextCellChooser = null;
56 56
             if (valueChooser == "mrv")
57 57
             {
58
-                nextValueChooser = new MRVNextValueChooser();
58
+                nextCellChooser = new MrvNextCellChooser();
59 59
             }
60 60
             else if (valueChooser == "basic")
61 61
             {
62
-                nextValueChooser = new BasicNextValueChooser();
62
+                nextCellChooser = new BasicNextCellChooser();
63 63
             }
64 64
             else
65 65
             {
@@ -67,7 +67,7 @@ namespace uqac_ia_sudoku_csp
67 67
                 Environment.Exit(64);
68 68
             }
69 69
 
70
-            var solver = new BacktrackSearch(nextValueChooser);
70
+            var solver = new BacktrackSearch(nextCellChooser);
71 71
             var resolved = solver.Resolve(board);
72 72
 
73 73
             if (resolved.Success)

+ 4
- 4
uqac-ia-sudoku-csp/Solver/BacktrackSearch.cs View File

@@ -8,12 +8,12 @@ namespace uqac_ia_sudoku_csp.Solver
8 8
 {
9 9
     public class BacktrackSearch : ISolver
10 10
     {
11
-        private readonly INextValueChooser _nextValueChooser;
11
+        private readonly INextCellChooser _nextCellChooser;
12 12
         protected IList<IConstraint> Constraints;
13 13
 
14
-        public BacktrackSearch(INextValueChooser nextValueChooser)
14
+        public BacktrackSearch(INextCellChooser nextCellChooser)
15 15
         {
16
-            _nextValueChooser = nextValueChooser;
16
+            _nextCellChooser = nextCellChooser;
17 17
             Constraints = new List<IConstraint>
18 18
             {
19 19
                 new LineContraint(),
@@ -40,7 +40,7 @@ namespace uqac_ia_sudoku_csp.Solver
40 40
                 return true;
41 41
             }
42 42
             int x, y;
43
-            _nextValueChooser.SelectVariable(board, out x, out y, Constraints);
43
+            _nextCellChooser.SelectVariable(board, out x, out y, Constraints);
44 44
             if (x != -1 && y != -1)
45 45
             {
46 46
                 foreach (var value in domain)

uqac-ia-sudoku-csp/Solver/NextValueChoosers/BasicNextValueChooser.cs → uqac-ia-sudoku-csp/Solver/NextCellChoosers/BasicNextCellChooser.cs View File

@@ -3,7 +3,7 @@ using uqac_ia_sudoku_csp.Interfaces;
3 3
 
4 4
 namespace uqac_ia_sudoku_csp.Solver.NextValueChoosers
5 5
 {
6
-    public class BasicNextValueChooser : INextValueChooser
6
+    public class BasicNextCellChooser : INextCellChooser
7 7
     {
8 8
         public void SelectVariable(Board board, out int x, out int y, IList<IConstraint> constraints)
9 9
         {

uqac-ia-sudoku-csp/Solver/NextValueChoosers/MRVNextValueChooser.cs → uqac-ia-sudoku-csp/Solver/NextCellChoosers/MrvNextCellChooser.cs View File

@@ -3,7 +3,7 @@ using uqac_ia_sudoku_csp.Interfaces;
3 3
 
4 4
 namespace uqac_ia_sudoku_csp.Solver.NextValueChoosers
5 5
 {
6
-    public class MRVNextValueChooser : INextValueChooser
6
+    public class MrvNextCellChooser : INextCellChooser
7 7
     {
8 8
         public void SelectVariable(Board board, out int x, out int y, IList<IConstraint> constraints)
9 9
         {

Loading…
Cancel
Save