ConstraintSolver 0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/ConstraintSolver +24 -0
- data/doc/classes/Array.html +209 -0
- data/doc/classes/ConstraintSolver.html +242 -0
- data/doc/classes/ConstraintSolver/AbstractConstraint.html +317 -0
- data/doc/classes/ConstraintSolver/AllDifferentConstraint.html +451 -0
- data/doc/classes/ConstraintSolver/AllDifferentConstraintTest.html +397 -0
- data/doc/classes/ConstraintSolver/BinaryConstraint.html +483 -0
- data/doc/classes/ConstraintSolver/BinaryConstraintTest.html +367 -0
- data/doc/classes/ConstraintSolver/BinaryRelation.html +276 -0
- data/doc/classes/ConstraintSolver/BinaryRelationTest.html +194 -0
- data/doc/classes/ConstraintSolver/ConstraintList.html +208 -0
- data/doc/classes/ConstraintSolver/ConstraintListTest.html +252 -0
- data/doc/classes/ConstraintSolver/ConstraintSolver.html +353 -0
- data/doc/classes/ConstraintSolver/ConstraintSolverTest.html +403 -0
- data/doc/classes/ConstraintSolver/Domain.html +522 -0
- data/doc/classes/ConstraintSolver/DomainTest.html +356 -0
- data/doc/classes/ConstraintSolver/DomainWipeoutException.html +158 -0
- data/doc/classes/ConstraintSolver/Problem.html +239 -0
- data/doc/classes/ConstraintSolver/ProblemTest.html +227 -0
- data/doc/classes/ConstraintSolver/Solution.html +342 -0
- data/doc/classes/ConstraintSolver/SolutionTest.html +250 -0
- data/doc/classes/ConstraintSolver/UndoStackEmptyException.html +158 -0
- data/doc/classes/ConstraintSolver/Variable.html +418 -0
- data/doc/classes/ConstraintSolver/VariableTest.html +284 -0
- data/doc/classes/ExtensionsTest.html +233 -0
- data/doc/classes/Fixnum.html +153 -0
- data/doc/created.rid +1 -0
- data/doc/dot/f_0.dot +38 -0
- data/doc/dot/f_0.png +0 -0
- data/doc/dot/f_1.dot +392 -0
- data/doc/dot/f_1.png +0 -0
- data/doc/dot/f_10.dot +392 -0
- data/doc/dot/f_10.png +0 -0
- data/doc/dot/f_11.dot +38 -0
- data/doc/dot/f_11.png +0 -0
- data/doc/dot/f_12.dot +392 -0
- data/doc/dot/f_12.png +0 -0
- data/doc/dot/f_13.dot +392 -0
- data/doc/dot/f_13.png +0 -0
- data/doc/dot/f_14.dot +392 -0
- data/doc/dot/f_14.png +0 -0
- data/doc/dot/f_15.dot +392 -0
- data/doc/dot/f_15.png +0 -0
- data/doc/dot/f_16.dot +392 -0
- data/doc/dot/f_16.png +0 -0
- data/doc/dot/f_17.dot +392 -0
- data/doc/dot/f_17.png +0 -0
- data/doc/dot/f_18.dot +392 -0
- data/doc/dot/f_18.png +0 -0
- data/doc/dot/f_19.dot +392 -0
- data/doc/dot/f_19.png +0 -0
- data/doc/dot/f_2.dot +392 -0
- data/doc/dot/f_2.png +0 -0
- data/doc/dot/f_3.dot +392 -0
- data/doc/dot/f_3.png +0 -0
- data/doc/dot/f_4.dot +392 -0
- data/doc/dot/f_4.png +0 -0
- data/doc/dot/f_5.dot +392 -0
- data/doc/dot/f_5.png +0 -0
- data/doc/dot/f_6.dot +14 -0
- data/doc/dot/f_6.png +0 -0
- data/doc/dot/f_7.dot +392 -0
- data/doc/dot/f_7.png +0 -0
- data/doc/dot/f_8.dot +392 -0
- data/doc/dot/f_8.png +0 -0
- data/doc/dot/f_9.dot +392 -0
- data/doc/dot/f_9.png +0 -0
- data/doc/dot/m_10_0.dot +392 -0
- data/doc/dot/m_10_0.png +0 -0
- data/doc/dot/m_12_0.dot +392 -0
- data/doc/dot/m_12_0.png +0 -0
- data/doc/dot/m_13_0.dot +392 -0
- data/doc/dot/m_13_0.png +0 -0
- data/doc/dot/m_14_0.dot +392 -0
- data/doc/dot/m_14_0.png +0 -0
- data/doc/dot/m_15_0.dot +392 -0
- data/doc/dot/m_15_0.png +0 -0
- data/doc/dot/m_16_0.dot +392 -0
- data/doc/dot/m_16_0.png +0 -0
- data/doc/dot/m_17_0.dot +392 -0
- data/doc/dot/m_17_0.png +0 -0
- data/doc/dot/m_18_0.dot +392 -0
- data/doc/dot/m_18_0.png +0 -0
- data/doc/dot/m_19_0.dot +392 -0
- data/doc/dot/m_19_0.png +0 -0
- data/doc/dot/m_1_0.dot +392 -0
- data/doc/dot/m_1_0.png +0 -0
- data/doc/dot/m_2_0.dot +392 -0
- data/doc/dot/m_2_0.png +0 -0
- data/doc/dot/m_3_0.dot +392 -0
- data/doc/dot/m_3_0.png +0 -0
- data/doc/dot/m_4_0.dot +392 -0
- data/doc/dot/m_4_0.png +0 -0
- data/doc/dot/m_5_0.dot +392 -0
- data/doc/dot/m_5_0.png +0 -0
- data/doc/dot/m_7_0.dot +392 -0
- data/doc/dot/m_7_0.png +0 -0
- data/doc/dot/m_8_0.dot +392 -0
- data/doc/dot/m_8_0.png +0 -0
- data/doc/dot/m_9_0.dot +392 -0
- data/doc/dot/m_9_0.png +0 -0
- data/doc/files/lib/AbstractConstraint_rb.html +148 -0
- data/doc/files/lib/AllDifferentConstraint_rb.html +156 -0
- data/doc/files/lib/BinaryConstraint_rb.html +155 -0
- data/doc/files/lib/ConstraintList_rb.html +148 -0
- data/doc/files/lib/ConstraintSolver_rb.html +162 -0
- data/doc/files/lib/Domain_rb.html +155 -0
- data/doc/files/lib/Problem_rb.html +148 -0
- data/doc/files/lib/Solution_rb.html +148 -0
- data/doc/files/lib/Variable_rb.html +148 -0
- data/doc/files/lib/extensions_rb.html +108 -0
- data/doc/files/test/AllDifferentConstraintTest_rb.html +158 -0
- data/doc/files/test/BinaryConstraintTest_rb.html +158 -0
- data/doc/files/test/ConstraintListTest_rb.html +160 -0
- data/doc/files/test/ConstraintSolverTest_rb.html +164 -0
- data/doc/files/test/DomainTest_rb.html +156 -0
- data/doc/files/test/ProblemTest_rb.html +160 -0
- data/doc/files/test/SolutionTest_rb.html +159 -0
- data/doc/files/test/TestSuite_rb.html +113 -0
- data/doc/files/test/VariableTest_rb.html +157 -0
- data/doc/files/test/extensionsTest_rb.html +118 -0
- data/doc/fr_class_index.html +51 -0
- data/doc/fr_file_index.html +46 -0
- data/doc/fr_method_index.html +133 -0
- data/doc/index.html +24 -0
- data/examples/example.rb +7 -0
- data/examples/queens.rb +13 -0
- data/examples/soft.rb +14 -0
- data/lib/AbstractConstraint.rb +45 -0
- data/lib/AllDifferentConstraint.rb +160 -0
- data/lib/BinaryConstraint.rb +187 -0
- data/lib/ConstraintList.rb +31 -0
- data/lib/ConstraintSolver.rb +213 -0
- data/lib/Domain.rb +100 -0
- data/lib/GraphUtils.rb +293 -0
- data/lib/OneOfEqualsConstraint.rb +81 -0
- data/lib/Problem.rb +30 -0
- data/lib/Solution.rb +56 -0
- data/lib/TupleConstraint.rb +111 -0
- data/lib/Variable.rb +74 -0
- data/lib/extensions.rb +55 -0
- data/test/AllDifferentConstraintTest.rb +140 -0
- data/test/BinaryConstraintTest.rb +108 -0
- data/test/ConstraintListTest.rb +41 -0
- data/test/ConstraintSolverTest.rb +274 -0
- data/test/DomainTest.rb +83 -0
- data/test/GraphUtilsTest.rb +83 -0
- data/test/OneOfEqualsConstraintTest.rb +82 -0
- data/test/ProblemTest.rb +35 -0
- data/test/SolutionTest.rb +35 -0
- data/test/TestSuite.rb +10 -0
- data/test/TupleConstraintTest.rb +151 -0
- data/test/VariableTest.rb +47 -0
- data/test/extensionsTest.rb +57 -0
- metadata +212 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<title>Class: ConstraintSolver::BinaryRelationTest</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
// <![CDATA[
|
|
14
|
+
|
|
15
|
+
function popupCode( url ) {
|
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleCode( id ) {
|
|
20
|
+
if ( document.getElementById )
|
|
21
|
+
elem = document.getElementById( id );
|
|
22
|
+
else if ( document.all )
|
|
23
|
+
elem = eval( "document.all." + id );
|
|
24
|
+
else
|
|
25
|
+
return false;
|
|
26
|
+
|
|
27
|
+
elemStyle = elem.style;
|
|
28
|
+
|
|
29
|
+
if ( elemStyle.display != "block" ) {
|
|
30
|
+
elemStyle.display = "block"
|
|
31
|
+
} else {
|
|
32
|
+
elemStyle.display = "none"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Make codeblocks hidden by default
|
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
+
|
|
41
|
+
// ]]>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div id="classHeader">
|
|
50
|
+
<table class="header-table">
|
|
51
|
+
<tr class="top-aligned-row">
|
|
52
|
+
<td><strong>Class</strong></td>
|
|
53
|
+
<td class="class-name-in-header">ConstraintSolver::BinaryRelationTest</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../files/test/BinaryConstraintTest_rb.html">
|
|
59
|
+
test/BinaryConstraintTest.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
64
|
+
|
|
65
|
+
<tr class="top-aligned-row">
|
|
66
|
+
<td><strong>Parent:</strong></td>
|
|
67
|
+
<td>
|
|
68
|
+
Test::Unit::TestCase
|
|
69
|
+
</td>
|
|
70
|
+
</tr>
|
|
71
|
+
</table>
|
|
72
|
+
</div>
|
|
73
|
+
<!-- banner header -->
|
|
74
|
+
|
|
75
|
+
<div id="bodyContent">
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<div id="contextContent">
|
|
80
|
+
<div id="diagram">
|
|
81
|
+
<map id="map" name="map">
|
|
82
|
+
<area shape="rect" coords="1537,5,1665,53" href="../Test/Unit/TestCase.html" alt="Test::Unit::TestCase" />
|
|
83
|
+
<area shape="rect" coords="937,133,1089,181" href="AllDifferentConstraintTest.html" alt="AllDifferentConstraintTest" />
|
|
84
|
+
<area shape="rect" coords="2305,133,2396,181" href="SolutionTest.html" alt="SolutionTest" />
|
|
85
|
+
<area shape="rect" coords="204,133,335,181" href="ConstraintSolverTest.html" alt="ConstraintSolverTest" />
|
|
86
|
+
<area shape="rect" coords="1923,133,2040,181" href="ConstraintListTest.html" alt="ConstraintListTest" />
|
|
87
|
+
<area shape="rect" coords="1123,133,1213,181" href="VariableTest.html" alt="VariableTest" />
|
|
88
|
+
<area shape="rect" coords="2429,133,2517,181" href="DomainTest.html" alt="DomainTest" />
|
|
89
|
+
<area shape="rect" coords="1387,133,1517,181" href="BinaryConstraintTest.html" alt="BinaryConstraintTest" />
|
|
90
|
+
<area shape="rect" coords="1797,133,1888,181" href="ProblemTest.html" alt="ProblemTest" />
|
|
91
|
+
<area shape="rect" coords="1541,133,1661,181" href="BinaryRelationTest.html" alt="BinaryRelationTest" />
|
|
92
|
+
<area shape="rect" coords="589,5,667,53" href="../Exception.html" alt="Exception" />
|
|
93
|
+
<area shape="rect" coords="463,133,615,181" href="DomainWipeoutException.html" alt="DomainWipeoutException" />
|
|
94
|
+
<area shape="rect" coords="639,133,799,181" href="UndoStackEmptyException.html" alt="UndoStackEmptyException" />
|
|
95
|
+
<area shape="rect" coords="53,133,171,181" href="AbstractConstraint.html" alt="AbstractConstraint" />
|
|
96
|
+
<area shape="rect" coords="160,237,269,285" href="BinaryConstraint.html" alt="BinaryConstraint" />
|
|
97
|
+
<area shape="rect" coords="301,237,432,285" href="AllDifferentConstraint.html" alt="AllDifferentConstraint" />
|
|
98
|
+
<area shape="rect" coords="2085,5,2157,53" href="../Array.html" alt="Array" />
|
|
99
|
+
<area shape="rect" coords="2073,133,2169,181" href="ConstraintList.html" alt="ConstraintList" />
|
|
100
|
+
<area shape="rect" coords="37,237,136,285" href="BinaryRelation.html" alt="BinaryRelation" />
|
|
101
|
+
<area shape="rect" coords="2201,133,2273,181" href="Variable.html" alt="Variable" />
|
|
102
|
+
<area shape="rect" coords="1693,133,1765,181" href="Solution.html" alt="Solution" />
|
|
103
|
+
<area shape="rect" coords="1245,133,1355,181" href="ConstraintSolver.html" alt="ConstraintSolver" />
|
|
104
|
+
<area shape="rect" coords="831,133,903,181" href="Problem.html" alt="Problem" />
|
|
105
|
+
<area shape="rect" coords="367,133,439,181" href="Domain.html" alt="Domain" />
|
|
106
|
+
<area shape="rect" coords="2419,99,2531,192" href="../ConstraintSolver.html" alt="test/DomainTest.rb" />
|
|
107
|
+
<area shape="rect" coords="2295,99,2408,192" href="../ConstraintSolver.html" alt="test/SolutionTest.rb" />
|
|
108
|
+
<area shape="rect" coords="27,203,280,296" href="../ConstraintSolver.html" alt="lib/BinaryConstraint.rb" />
|
|
109
|
+
<area shape="rect" coords="2191,99,2284,192" href="../ConstraintSolver.html" alt="lib/Variable.rb" />
|
|
110
|
+
<area shape="rect" coords="1912,99,2052,192" href="../ConstraintSolver.html" alt="test/ConstraintListTest.rb" />
|
|
111
|
+
<area shape="rect" coords="2063,99,2180,192" href="../ConstraintSolver.html" alt="lib/ConstraintList.rb" />
|
|
112
|
+
<area shape="rect" coords="1787,99,1901,192" href="../ConstraintSolver.html" alt="test/ProblemTest.rb" />
|
|
113
|
+
<area shape="rect" coords="1683,99,1776,192" href="../ConstraintSolver.html" alt="lib/Solution.rb" />
|
|
114
|
+
<area shape="rect" coords="1376,99,1672,192" href="../ConstraintSolver.html" alt="test/BinaryConstraintTest.rb" />
|
|
115
|
+
<area shape="rect" coords="1235,99,1365,192" href="../ConstraintSolver.html" alt="lib/ConstraintSolver.rb" />
|
|
116
|
+
<area shape="rect" coords="1111,99,1224,192" href="../ConstraintSolver.html" alt="test/VariableTest.rb" />
|
|
117
|
+
<area shape="rect" coords="924,99,1100,192" href="../ConstraintSolver.html" alt="test/AllDifferentConstraintTest.rb" />
|
|
118
|
+
<area shape="rect" coords="291,203,443,296" href="../ConstraintSolver.html" alt="lib/AllDifferentConstraint.rb" />
|
|
119
|
+
<area shape="rect" coords="820,99,913,192" href="../ConstraintSolver.html" alt="lib/Problem.rb" />
|
|
120
|
+
<area shape="rect" coords="192,99,345,192" href="../ConstraintSolver.html" alt="test/ConstraintSolverTest.rb" />
|
|
121
|
+
<area shape="rect" coords="356,99,809,192" href="../ConstraintSolver.html" alt="lib/Domain.rb" />
|
|
122
|
+
<area shape="rect" coords="43,99,181,192" href="../ConstraintSolver.html" alt="lib/AbstractConstraint.rb" />
|
|
123
|
+
<area shape="rect" coords="16,64,2541,307" href="../ConstraintSolver.html" alt="ConstraintSolver" />
|
|
124
|
+
</map>
|
|
125
|
+
<img src="../../dot/m_19_0.png" usemap="#map" border="0" alt="dot/m_19_0.png">
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
<div id="method-list">
|
|
133
|
+
<h3 class="section-bar">Methods</h3>
|
|
134
|
+
|
|
135
|
+
<div class="name-list">
|
|
136
|
+
<a href="#M000096">testConstructor</a>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
<!-- if includes -->
|
|
144
|
+
|
|
145
|
+
<div id="section">
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
<!-- if method_list -->
|
|
155
|
+
<div id="methods">
|
|
156
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
157
|
+
|
|
158
|
+
<div id="method-M000096" class="method-detail">
|
|
159
|
+
<a name="M000096"></a>
|
|
160
|
+
|
|
161
|
+
<div class="method-heading">
|
|
162
|
+
<a href="#M000096" class="method-signature">
|
|
163
|
+
<span class="method-name">testConstructor</span><span class="method-args">()</span>
|
|
164
|
+
</a>
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
<div class="method-description">
|
|
168
|
+
<p><a class="source-toggle" href="#"
|
|
169
|
+
onclick="toggleCode('M000096-source');return false;">[Source]</a></p>
|
|
170
|
+
<div class="method-source-code" id="M000096-source">
|
|
171
|
+
<pre>
|
|
172
|
+
<span class="ruby-comment cmt"># File test/BinaryConstraintTest.rb, line 72</span>
|
|
173
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">testConstructor</span>
|
|
174
|
+
<span class="ruby-identifier">assert_raise</span>(<span class="ruby-constant">ArgumentError</span>) { <span class="ruby-constant">BinaryRelation</span>.<span class="ruby-identifier">new</span> }
|
|
175
|
+
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-constant">BinaryRelation</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"<"</span>) }
|
|
176
|
+
<span class="ruby-keyword kw">end</span>
|
|
177
|
+
</pre>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
</div>
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
<div id="validator-badges">
|
|
190
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
191
|
+
</div>
|
|
192
|
+
|
|
193
|
+
</body>
|
|
194
|
+
</html>
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<title>Class: ConstraintSolver::ConstraintList</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
// <![CDATA[
|
|
14
|
+
|
|
15
|
+
function popupCode( url ) {
|
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleCode( id ) {
|
|
20
|
+
if ( document.getElementById )
|
|
21
|
+
elem = document.getElementById( id );
|
|
22
|
+
else if ( document.all )
|
|
23
|
+
elem = eval( "document.all." + id );
|
|
24
|
+
else
|
|
25
|
+
return false;
|
|
26
|
+
|
|
27
|
+
elemStyle = elem.style;
|
|
28
|
+
|
|
29
|
+
if ( elemStyle.display != "block" ) {
|
|
30
|
+
elemStyle.display = "block"
|
|
31
|
+
} else {
|
|
32
|
+
elemStyle.display = "none"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Make codeblocks hidden by default
|
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
+
|
|
41
|
+
// ]]>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div id="classHeader">
|
|
50
|
+
<table class="header-table">
|
|
51
|
+
<tr class="top-aligned-row">
|
|
52
|
+
<td><strong>Class</strong></td>
|
|
53
|
+
<td class="class-name-in-header">ConstraintSolver::ConstraintList</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../files/lib/ConstraintList_rb.html">
|
|
59
|
+
lib/ConstraintList.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
64
|
+
|
|
65
|
+
<tr class="top-aligned-row">
|
|
66
|
+
<td><strong>Parent:</strong></td>
|
|
67
|
+
<td>
|
|
68
|
+
<a href="../Array.html">
|
|
69
|
+
Array
|
|
70
|
+
</a>
|
|
71
|
+
</td>
|
|
72
|
+
</tr>
|
|
73
|
+
</table>
|
|
74
|
+
</div>
|
|
75
|
+
<!-- banner header -->
|
|
76
|
+
|
|
77
|
+
<div id="bodyContent">
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
<div id="contextContent">
|
|
82
|
+
<div id="diagram">
|
|
83
|
+
<map id="map" name="map">
|
|
84
|
+
<area shape="rect" coords="1537,5,1665,53" href="../Test/Unit/TestCase.html" alt="Test::Unit::TestCase" />
|
|
85
|
+
<area shape="rect" coords="937,133,1089,181" href="AllDifferentConstraintTest.html" alt="AllDifferentConstraintTest" />
|
|
86
|
+
<area shape="rect" coords="2305,133,2396,181" href="SolutionTest.html" alt="SolutionTest" />
|
|
87
|
+
<area shape="rect" coords="204,133,335,181" href="ConstraintSolverTest.html" alt="ConstraintSolverTest" />
|
|
88
|
+
<area shape="rect" coords="1923,133,2040,181" href="ConstraintListTest.html" alt="ConstraintListTest" />
|
|
89
|
+
<area shape="rect" coords="1123,133,1213,181" href="VariableTest.html" alt="VariableTest" />
|
|
90
|
+
<area shape="rect" coords="2429,133,2517,181" href="DomainTest.html" alt="DomainTest" />
|
|
91
|
+
<area shape="rect" coords="1387,133,1517,181" href="BinaryConstraintTest.html" alt="BinaryConstraintTest" />
|
|
92
|
+
<area shape="rect" coords="1797,133,1888,181" href="ProblemTest.html" alt="ProblemTest" />
|
|
93
|
+
<area shape="rect" coords="1541,133,1661,181" href="BinaryRelationTest.html" alt="BinaryRelationTest" />
|
|
94
|
+
<area shape="rect" coords="589,5,667,53" href="../Exception.html" alt="Exception" />
|
|
95
|
+
<area shape="rect" coords="463,133,615,181" href="DomainWipeoutException.html" alt="DomainWipeoutException" />
|
|
96
|
+
<area shape="rect" coords="639,133,799,181" href="UndoStackEmptyException.html" alt="UndoStackEmptyException" />
|
|
97
|
+
<area shape="rect" coords="53,133,171,181" href="AbstractConstraint.html" alt="AbstractConstraint" />
|
|
98
|
+
<area shape="rect" coords="160,237,269,285" href="BinaryConstraint.html" alt="BinaryConstraint" />
|
|
99
|
+
<area shape="rect" coords="301,237,432,285" href="AllDifferentConstraint.html" alt="AllDifferentConstraint" />
|
|
100
|
+
<area shape="rect" coords="2085,5,2157,53" href="../Array.html" alt="Array" />
|
|
101
|
+
<area shape="rect" coords="2073,133,2169,181" href="ConstraintList.html" alt="ConstraintList" />
|
|
102
|
+
<area shape="rect" coords="37,237,136,285" href="BinaryRelation.html" alt="BinaryRelation" />
|
|
103
|
+
<area shape="rect" coords="2201,133,2273,181" href="Variable.html" alt="Variable" />
|
|
104
|
+
<area shape="rect" coords="1693,133,1765,181" href="Solution.html" alt="Solution" />
|
|
105
|
+
<area shape="rect" coords="1245,133,1355,181" href="ConstraintSolver.html" alt="ConstraintSolver" />
|
|
106
|
+
<area shape="rect" coords="831,133,903,181" href="Problem.html" alt="Problem" />
|
|
107
|
+
<area shape="rect" coords="367,133,439,181" href="Domain.html" alt="Domain" />
|
|
108
|
+
<area shape="rect" coords="2419,99,2531,192" href="../ConstraintSolver.html" alt="test/DomainTest.rb" />
|
|
109
|
+
<area shape="rect" coords="2295,99,2408,192" href="../ConstraintSolver.html" alt="test/SolutionTest.rb" />
|
|
110
|
+
<area shape="rect" coords="27,203,280,296" href="../ConstraintSolver.html" alt="lib/BinaryConstraint.rb" />
|
|
111
|
+
<area shape="rect" coords="2191,99,2284,192" href="../ConstraintSolver.html" alt="lib/Variable.rb" />
|
|
112
|
+
<area shape="rect" coords="1912,99,2052,192" href="../ConstraintSolver.html" alt="test/ConstraintListTest.rb" />
|
|
113
|
+
<area shape="rect" coords="2063,99,2180,192" href="../ConstraintSolver.html" alt="lib/ConstraintList.rb" />
|
|
114
|
+
<area shape="rect" coords="1787,99,1901,192" href="../ConstraintSolver.html" alt="test/ProblemTest.rb" />
|
|
115
|
+
<area shape="rect" coords="1683,99,1776,192" href="../ConstraintSolver.html" alt="lib/Solution.rb" />
|
|
116
|
+
<area shape="rect" coords="1376,99,1672,192" href="../ConstraintSolver.html" alt="test/BinaryConstraintTest.rb" />
|
|
117
|
+
<area shape="rect" coords="1235,99,1365,192" href="../ConstraintSolver.html" alt="lib/ConstraintSolver.rb" />
|
|
118
|
+
<area shape="rect" coords="1111,99,1224,192" href="../ConstraintSolver.html" alt="test/VariableTest.rb" />
|
|
119
|
+
<area shape="rect" coords="924,99,1100,192" href="../ConstraintSolver.html" alt="test/AllDifferentConstraintTest.rb" />
|
|
120
|
+
<area shape="rect" coords="291,203,443,296" href="../ConstraintSolver.html" alt="lib/AllDifferentConstraint.rb" />
|
|
121
|
+
<area shape="rect" coords="820,99,913,192" href="../ConstraintSolver.html" alt="lib/Problem.rb" />
|
|
122
|
+
<area shape="rect" coords="192,99,345,192" href="../ConstraintSolver.html" alt="test/ConstraintSolverTest.rb" />
|
|
123
|
+
<area shape="rect" coords="356,99,809,192" href="../ConstraintSolver.html" alt="lib/Domain.rb" />
|
|
124
|
+
<area shape="rect" coords="43,99,181,192" href="../ConstraintSolver.html" alt="lib/AbstractConstraint.rb" />
|
|
125
|
+
<area shape="rect" coords="16,64,2541,307" href="../ConstraintSolver.html" alt="ConstraintSolver" />
|
|
126
|
+
</map>
|
|
127
|
+
<img src="../../dot/m_19_0.png" usemap="#map" border="0" alt="dot/m_19_0.png">
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<div id="description">
|
|
131
|
+
<p>
|
|
132
|
+
This class represents a list of constraints.
|
|
133
|
+
</p>
|
|
134
|
+
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<div id="method-list">
|
|
141
|
+
<h3 class="section-bar">Methods</h3>
|
|
142
|
+
|
|
143
|
+
<div class="name-list">
|
|
144
|
+
<a href="#M000097">notAllAssignedWithVariable</a>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
<!-- if includes -->
|
|
152
|
+
|
|
153
|
+
<div id="section">
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
<!-- if method_list -->
|
|
163
|
+
<div id="methods">
|
|
164
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
165
|
+
|
|
166
|
+
<div id="method-M000097" class="method-detail">
|
|
167
|
+
<a name="M000097"></a>
|
|
168
|
+
|
|
169
|
+
<div class="method-heading">
|
|
170
|
+
<a href="#M000097" class="method-signature">
|
|
171
|
+
<span class="method-name">notAllAssignedWithVariable</span><span class="method-args">(variable)</span>
|
|
172
|
+
</a>
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
<div class="method-description">
|
|
176
|
+
<p>
|
|
177
|
+
Returns the <a href="ConstraintList.html">ConstraintList</a> that contains
|
|
178
|
+
all constraints that involve variable and have values assigned to not all
|
|
179
|
+
variables involved.
|
|
180
|
+
</p>
|
|
181
|
+
<p><a class="source-toggle" href="#"
|
|
182
|
+
onclick="toggleCode('M000097-source');return false;">[Source]</a></p>
|
|
183
|
+
<div class="method-source-code" id="M000097-source">
|
|
184
|
+
<pre>
|
|
185
|
+
<span class="ruby-comment cmt"># File lib/ConstraintList.rb, line 8</span>
|
|
186
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">notAllAssignedWithVariable</span>(<span class="ruby-identifier">variable</span>)
|
|
187
|
+
<span class="ruby-constant">ConstraintList</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">select</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">constraint</span><span class="ruby-operator">|</span>
|
|
188
|
+
<span class="ruby-identifier">constraint</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">variable</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">constraint</span>.<span class="ruby-identifier">allAssigned?</span>
|
|
189
|
+
})
|
|
190
|
+
<span class="ruby-keyword kw">end</span>
|
|
191
|
+
</pre>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
</div>
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
<div id="validator-badges">
|
|
204
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
205
|
+
</div>
|
|
206
|
+
|
|
207
|
+
</body>
|
|
208
|
+
</html>
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<title>Class: ConstraintSolver::ConstraintListTest</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
// <![CDATA[
|
|
14
|
+
|
|
15
|
+
function popupCode( url ) {
|
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleCode( id ) {
|
|
20
|
+
if ( document.getElementById )
|
|
21
|
+
elem = document.getElementById( id );
|
|
22
|
+
else if ( document.all )
|
|
23
|
+
elem = eval( "document.all." + id );
|
|
24
|
+
else
|
|
25
|
+
return false;
|
|
26
|
+
|
|
27
|
+
elemStyle = elem.style;
|
|
28
|
+
|
|
29
|
+
if ( elemStyle.display != "block" ) {
|
|
30
|
+
elemStyle.display = "block"
|
|
31
|
+
} else {
|
|
32
|
+
elemStyle.display = "none"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Make codeblocks hidden by default
|
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
+
|
|
41
|
+
// ]]>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div id="classHeader">
|
|
50
|
+
<table class="header-table">
|
|
51
|
+
<tr class="top-aligned-row">
|
|
52
|
+
<td><strong>Class</strong></td>
|
|
53
|
+
<td class="class-name-in-header">ConstraintSolver::ConstraintListTest</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../files/test/ConstraintListTest_rb.html">
|
|
59
|
+
test/ConstraintListTest.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
64
|
+
|
|
65
|
+
<tr class="top-aligned-row">
|
|
66
|
+
<td><strong>Parent:</strong></td>
|
|
67
|
+
<td>
|
|
68
|
+
Test::Unit::TestCase
|
|
69
|
+
</td>
|
|
70
|
+
</tr>
|
|
71
|
+
</table>
|
|
72
|
+
</div>
|
|
73
|
+
<!-- banner header -->
|
|
74
|
+
|
|
75
|
+
<div id="bodyContent">
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<div id="contextContent">
|
|
80
|
+
<div id="diagram">
|
|
81
|
+
<map id="map" name="map">
|
|
82
|
+
<area shape="rect" coords="1537,5,1665,53" href="../Test/Unit/TestCase.html" alt="Test::Unit::TestCase" />
|
|
83
|
+
<area shape="rect" coords="937,133,1089,181" href="AllDifferentConstraintTest.html" alt="AllDifferentConstraintTest" />
|
|
84
|
+
<area shape="rect" coords="2305,133,2396,181" href="SolutionTest.html" alt="SolutionTest" />
|
|
85
|
+
<area shape="rect" coords="204,133,335,181" href="ConstraintSolverTest.html" alt="ConstraintSolverTest" />
|
|
86
|
+
<area shape="rect" coords="1923,133,2040,181" href="ConstraintListTest.html" alt="ConstraintListTest" />
|
|
87
|
+
<area shape="rect" coords="1123,133,1213,181" href="VariableTest.html" alt="VariableTest" />
|
|
88
|
+
<area shape="rect" coords="2429,133,2517,181" href="DomainTest.html" alt="DomainTest" />
|
|
89
|
+
<area shape="rect" coords="1387,133,1517,181" href="BinaryConstraintTest.html" alt="BinaryConstraintTest" />
|
|
90
|
+
<area shape="rect" coords="1797,133,1888,181" href="ProblemTest.html" alt="ProblemTest" />
|
|
91
|
+
<area shape="rect" coords="1541,133,1661,181" href="BinaryRelationTest.html" alt="BinaryRelationTest" />
|
|
92
|
+
<area shape="rect" coords="589,5,667,53" href="../Exception.html" alt="Exception" />
|
|
93
|
+
<area shape="rect" coords="463,133,615,181" href="DomainWipeoutException.html" alt="DomainWipeoutException" />
|
|
94
|
+
<area shape="rect" coords="639,133,799,181" href="UndoStackEmptyException.html" alt="UndoStackEmptyException" />
|
|
95
|
+
<area shape="rect" coords="53,133,171,181" href="AbstractConstraint.html" alt="AbstractConstraint" />
|
|
96
|
+
<area shape="rect" coords="160,237,269,285" href="BinaryConstraint.html" alt="BinaryConstraint" />
|
|
97
|
+
<area shape="rect" coords="301,237,432,285" href="AllDifferentConstraint.html" alt="AllDifferentConstraint" />
|
|
98
|
+
<area shape="rect" coords="2085,5,2157,53" href="../Array.html" alt="Array" />
|
|
99
|
+
<area shape="rect" coords="2073,133,2169,181" href="ConstraintList.html" alt="ConstraintList" />
|
|
100
|
+
<area shape="rect" coords="37,237,136,285" href="BinaryRelation.html" alt="BinaryRelation" />
|
|
101
|
+
<area shape="rect" coords="2201,133,2273,181" href="Variable.html" alt="Variable" />
|
|
102
|
+
<area shape="rect" coords="1693,133,1765,181" href="Solution.html" alt="Solution" />
|
|
103
|
+
<area shape="rect" coords="1245,133,1355,181" href="ConstraintSolver.html" alt="ConstraintSolver" />
|
|
104
|
+
<area shape="rect" coords="831,133,903,181" href="Problem.html" alt="Problem" />
|
|
105
|
+
<area shape="rect" coords="367,133,439,181" href="Domain.html" alt="Domain" />
|
|
106
|
+
<area shape="rect" coords="2419,99,2531,192" href="../ConstraintSolver.html" alt="test/DomainTest.rb" />
|
|
107
|
+
<area shape="rect" coords="2295,99,2408,192" href="../ConstraintSolver.html" alt="test/SolutionTest.rb" />
|
|
108
|
+
<area shape="rect" coords="27,203,280,296" href="../ConstraintSolver.html" alt="lib/BinaryConstraint.rb" />
|
|
109
|
+
<area shape="rect" coords="2191,99,2284,192" href="../ConstraintSolver.html" alt="lib/Variable.rb" />
|
|
110
|
+
<area shape="rect" coords="1912,99,2052,192" href="../ConstraintSolver.html" alt="test/ConstraintListTest.rb" />
|
|
111
|
+
<area shape="rect" coords="2063,99,2180,192" href="../ConstraintSolver.html" alt="lib/ConstraintList.rb" />
|
|
112
|
+
<area shape="rect" coords="1787,99,1901,192" href="../ConstraintSolver.html" alt="test/ProblemTest.rb" />
|
|
113
|
+
<area shape="rect" coords="1683,99,1776,192" href="../ConstraintSolver.html" alt="lib/Solution.rb" />
|
|
114
|
+
<area shape="rect" coords="1376,99,1672,192" href="../ConstraintSolver.html" alt="test/BinaryConstraintTest.rb" />
|
|
115
|
+
<area shape="rect" coords="1235,99,1365,192" href="../ConstraintSolver.html" alt="lib/ConstraintSolver.rb" />
|
|
116
|
+
<area shape="rect" coords="1111,99,1224,192" href="../ConstraintSolver.html" alt="test/VariableTest.rb" />
|
|
117
|
+
<area shape="rect" coords="924,99,1100,192" href="../ConstraintSolver.html" alt="test/AllDifferentConstraintTest.rb" />
|
|
118
|
+
<area shape="rect" coords="291,203,443,296" href="../ConstraintSolver.html" alt="lib/AllDifferentConstraint.rb" />
|
|
119
|
+
<area shape="rect" coords="820,99,913,192" href="../ConstraintSolver.html" alt="lib/Problem.rb" />
|
|
120
|
+
<area shape="rect" coords="192,99,345,192" href="../ConstraintSolver.html" alt="test/ConstraintSolverTest.rb" />
|
|
121
|
+
<area shape="rect" coords="356,99,809,192" href="../ConstraintSolver.html" alt="lib/Domain.rb" />
|
|
122
|
+
<area shape="rect" coords="43,99,181,192" href="../ConstraintSolver.html" alt="lib/AbstractConstraint.rb" />
|
|
123
|
+
<area shape="rect" coords="16,64,2541,307" href="../ConstraintSolver.html" alt="ConstraintSolver" />
|
|
124
|
+
</map>
|
|
125
|
+
<img src="../../dot/m_19_0.png" usemap="#map" border="0" alt="dot/m_19_0.png">
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
<div id="method-list">
|
|
133
|
+
<h3 class="section-bar">Methods</h3>
|
|
134
|
+
|
|
135
|
+
<div class="name-list">
|
|
136
|
+
<a href="#M000036">setup</a>
|
|
137
|
+
<a href="#M000038">testAllDifferentConstraintList</a>
|
|
138
|
+
<a href="#M000037">testNotAllAssignedWithVariable</a>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
<!-- if includes -->
|
|
146
|
+
|
|
147
|
+
<div id="section">
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
<!-- if method_list -->
|
|
157
|
+
<div id="methods">
|
|
158
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
159
|
+
|
|
160
|
+
<div id="method-M000036" class="method-detail">
|
|
161
|
+
<a name="M000036"></a>
|
|
162
|
+
|
|
163
|
+
<div class="method-heading">
|
|
164
|
+
<a href="#M000036" class="method-signature">
|
|
165
|
+
<span class="method-name">setup</span><span class="method-args">()</span>
|
|
166
|
+
</a>
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
<div class="method-description">
|
|
170
|
+
<p><a class="source-toggle" href="#"
|
|
171
|
+
onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
|
|
172
|
+
<div class="method-source-code" id="M000036-source">
|
|
173
|
+
<pre>
|
|
174
|
+
<span class="ruby-comment cmt"># File test/ConstraintListTest.rb, line 14</span>
|
|
175
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
|
|
176
|
+
<span class="ruby-ivar">@var1</span> = <span class="ruby-constant">Variable</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"test1"</span>, <span class="ruby-constant">Domain</span>.<span class="ruby-identifier">new</span>([ <span class="ruby-value">1</span> ].<span class="ruby-identifier">to_set</span>), <span class="ruby-value">1</span>)
|
|
177
|
+
<span class="ruby-ivar">@var2</span> = <span class="ruby-constant">Variable</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"test2"</span>, <span class="ruby-constant">Domain</span>.<span class="ruby-identifier">new</span>([ <span class="ruby-value">1</span> ].<span class="ruby-identifier">to_set</span>), <span class="ruby-value">1</span>)
|
|
178
|
+
<span class="ruby-ivar">@var3</span> = <span class="ruby-constant">Variable</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"test3"</span>, <span class="ruby-constant">Domain</span>.<span class="ruby-identifier">new</span>([ <span class="ruby-value">1</span> ].<span class="ruby-identifier">to_set</span>))
|
|
179
|
+
|
|
180
|
+
<span class="ruby-ivar">@proc</span> = <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">b</span> }
|
|
181
|
+
|
|
182
|
+
<span class="ruby-ivar">@con1</span> = <span class="ruby-constant">BinaryConstraint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@var1</span>, <span class="ruby-ivar">@var2</span>, <span class="ruby-ivar">@proc</span>)
|
|
183
|
+
<span class="ruby-ivar">@con2</span> = <span class="ruby-constant">BinaryConstraint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@var1</span>, <span class="ruby-ivar">@var3</span>, <span class="ruby-ivar">@proc</span>)
|
|
184
|
+
|
|
185
|
+
<span class="ruby-ivar">@cl</span> = <span class="ruby-constant">ConstraintList</span>.<span class="ruby-identifier">new</span>([ <span class="ruby-ivar">@con1</span>, <span class="ruby-ivar">@con2</span> ])
|
|
186
|
+
<span class="ruby-keyword kw">end</span>
|
|
187
|
+
</pre>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
|
|
192
|
+
<div id="method-M000038" class="method-detail">
|
|
193
|
+
<a name="M000038"></a>
|
|
194
|
+
|
|
195
|
+
<div class="method-heading">
|
|
196
|
+
<a href="#M000038" class="method-signature">
|
|
197
|
+
<span class="method-name">testAllDifferentConstraintList</span><span class="method-args">()</span>
|
|
198
|
+
</a>
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
<div class="method-description">
|
|
202
|
+
<p><a class="source-toggle" href="#"
|
|
203
|
+
onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
|
|
204
|
+
<div class="method-source-code" id="M000038-source">
|
|
205
|
+
<pre>
|
|
206
|
+
<span class="ruby-comment cmt"># File test/ConstraintListTest.rb, line 31</span>
|
|
207
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">testAllDifferentConstraintList</span>
|
|
208
|
+
<span class="ruby-identifier">allDiff</span> = <span class="ruby-constant">AllDifferentConstraint</span>.<span class="ruby-identifier">new</span>([ <span class="ruby-ivar">@var1</span>, <span class="ruby-ivar">@var2</span>, <span class="ruby-ivar">@var3</span> ])
|
|
209
|
+
<span class="ruby-identifier">list</span> = <span class="ruby-constant">ConstraintList</span>.<span class="ruby-identifier">new</span>([ <span class="ruby-identifier">allDiff</span> ])
|
|
210
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">list</span>, <span class="ruby-identifier">list</span>.<span class="ruby-identifier">notAllAssignedWithVariable</span>(<span class="ruby-ivar">@var1</span>))
|
|
211
|
+
<span class="ruby-keyword kw">end</span>
|
|
212
|
+
</pre>
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
<div id="method-M000037" class="method-detail">
|
|
218
|
+
<a name="M000037"></a>
|
|
219
|
+
|
|
220
|
+
<div class="method-heading">
|
|
221
|
+
<a href="#M000037" class="method-signature">
|
|
222
|
+
<span class="method-name">testNotAllAssignedWithVariable</span><span class="method-args">()</span>
|
|
223
|
+
</a>
|
|
224
|
+
</div>
|
|
225
|
+
|
|
226
|
+
<div class="method-description">
|
|
227
|
+
<p><a class="source-toggle" href="#"
|
|
228
|
+
onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
|
|
229
|
+
<div class="method-source-code" id="M000037-source">
|
|
230
|
+
<pre>
|
|
231
|
+
<span class="ruby-comment cmt"># File test/ConstraintListTest.rb, line 27</span>
|
|
232
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">testNotAllAssignedWithVariable</span>
|
|
233
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-constant">ConstraintList</span>.<span class="ruby-identifier">new</span>([ <span class="ruby-ivar">@con2</span> ]), <span class="ruby-ivar">@cl</span>.<span class="ruby-identifier">notAllAssignedWithVariable</span>(<span class="ruby-ivar">@var1</span>))
|
|
234
|
+
<span class="ruby-keyword kw">end</span>
|
|
235
|
+
</pre>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
</div>
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
</div>
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
<div id="validator-badges">
|
|
248
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
249
|
+
</div>
|
|
250
|
+
|
|
251
|
+
</body>
|
|
252
|
+
</html>
|