From ce1b716e128bef53b140344bf1e58960fa32cba6 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Wed, 8 Jun 2011 16:23:18 +0200 Subject: Created first FD-Solver test git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@385 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/ai/fdsolver/Constraint.java | 5 +++++ src/jrummikub/ai/fdsolver/Constraints.java | 13 +++++++++++++ src/jrummikub/ai/fdsolver/LessThan.java | 9 +++++++++ src/jrummikub/ai/fdsolver/Solver.java | 25 +++++++++++++++++++++++++ src/jrummikub/ai/fdsolver/Var.java | 25 +++++++++++++++++++++++++ 5 files changed, 77 insertions(+) create mode 100644 src/jrummikub/ai/fdsolver/Constraint.java create mode 100644 src/jrummikub/ai/fdsolver/Constraints.java create mode 100644 src/jrummikub/ai/fdsolver/LessThan.java create mode 100644 src/jrummikub/ai/fdsolver/Solver.java create mode 100644 src/jrummikub/ai/fdsolver/Var.java (limited to 'src/jrummikub/ai') 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 > void lessThan(Solver solver, Var x, Var y) { + // TODO Auto-generated method stub + } + + public static > void lessThan(Solver solver, Var 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 implements Constraint { + + public LessThan(Var x, Var 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 { + Set range; + + public Var(Solver solver, Collection range) { + this.range = new HashSet(range); + } + + public static Var 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(); + } + +} -- cgit v1.2.3