001 /* 002 * Created on Sep 21, 2004 003 * 004 */ 005 package aima.test.search.csp; 006 007 import junit.framework.TestCase; 008 import aima.search.csp.Assignment; 009 import aima.search.csp.CSP; 010 import aima.search.csp.MapCSP; 011 012 /** 013 * @author Ravi Mohan 014 * 015 */ 016 public class MapCSPTest extends TestCase { 017 private CSP csp; 018 019 @Override 020 public void setUp() { 021 csp = MapCSP.getMap(); 022 } 023 024 public void testBackTrackingSearch() { 025 Assignment results = csp.backTrackingSearch(); 026 assertNotNull(results); 027 assertEquals(MapCSP.RED, results.getAssignment(MapCSP.V)); 028 assertEquals(MapCSP.GREEN, results.getAssignment(MapCSP.SA)); 029 assertEquals(MapCSP.RED, results.getAssignment(MapCSP.T)); 030 assertEquals(MapCSP.BLUE, results.getAssignment(MapCSP.NT)); 031 assertEquals(MapCSP.RED, results.getAssignment(MapCSP.Q)); 032 assertEquals(MapCSP.BLUE, results.getAssignment(MapCSP.NSW)); 033 assertEquals(MapCSP.RED, results.getAssignment(MapCSP.WA)); 034 // System.out.println(results); 035 } 036 037 public void testMCSearch() { 038 Assignment results = csp.mcSearch(100); 039 040 } 041 }