summaryrefslogtreecommitdiffstats
path: root/src/jrummikub
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub')
-rw-r--r--src/jrummikub/ai/fdsolver/Constraint.java5
-rw-r--r--src/jrummikub/ai/fdsolver/Constraints.java13
-rw-r--r--src/jrummikub/ai/fdsolver/LessThan.java9
-rw-r--r--src/jrummikub/ai/fdsolver/Solver.java25
-rw-r--r--src/jrummikub/ai/fdsolver/Var.java25
5 files changed, 77 insertions, 0 deletions
diff --git a/src/jrummikub/ai/fdsolver/Constraint.java b/src/jrummikub/ai/fdsolver/Constraint.java
new file mode 100644
index 0000000..0d4071d
--- /dev/null
+++ b/src/jrummikub/ai/fdsolver/Constraint.java
@@ -0,0 +1,5 @@
+package jrummikub.ai.fdsolver;
+
+public interface Constraint {
+
+}
diff --git a/src/jrummikub/ai/fdsolver/Constraints.java b/src/jrummikub/ai/fdsolver/Constraints.java
new file mode 100644
index 0000000..589ecb5
--- /dev/null
+++ b/src/jrummikub/ai/fdsolver/Constraints.java
@@ -0,0 +1,13 @@
+package jrummikub.ai.fdsolver;
+
+public class Constraints {
+
+ public static <T extends Comparable<T>> void lessThan(Solver solver, Var<T> x, Var<T> y) {
+ // TODO Auto-generated method stub
+ }
+
+ public static <T extends Comparable<T>> void lessThan(Solver solver, Var<T> x, T y) {
+ // TODO Auto-generated method stub
+ }
+
+}
diff --git a/src/jrummikub/ai/fdsolver/LessThan.java b/src/jrummikub/ai/fdsolver/LessThan.java
new file mode 100644
index 0000000..25acd9b
--- /dev/null
+++ b/src/jrummikub/ai/fdsolver/LessThan.java
@@ -0,0 +1,9 @@
+package jrummikub.ai.fdsolver;
+
+public class LessThan<T> implements Constraint {
+
+ public LessThan(Var<T> x, Var<T> y) {
+ // TODO Auto-generated constructor stub
+ }
+
+}
diff --git a/src/jrummikub/ai/fdsolver/Solver.java b/src/jrummikub/ai/fdsolver/Solver.java
new file mode 100644
index 0000000..1164c36
--- /dev/null
+++ b/src/jrummikub/ai/fdsolver/Solver.java
@@ -0,0 +1,25 @@
+package jrummikub.ai.fdsolver;
+
+public class Solver {
+
+ public void add(Constraint constraint) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public boolean solve() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void push() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void pop() {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/src/jrummikub/ai/fdsolver/Var.java b/src/jrummikub/ai/fdsolver/Var.java
new file mode 100644
index 0000000..a2b5cd7
--- /dev/null
+++ b/src/jrummikub/ai/fdsolver/Var.java
@@ -0,0 +1,25 @@
+package jrummikub.ai.fdsolver;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+public class Var<T> {
+ Set<T> range;
+
+ public Var(Solver solver, Collection<T> range) {
+ this.range = new HashSet<T>(range);
+ }
+
+ public static <T> Var<T> range(Solver solver, T low, T high) {
+ // TODO todo todo todo
+ return null;
+ }
+
+ public T getValue() {
+ if (range.size() != 1)
+ return null;
+ return range.iterator().next();
+ }
+
+}