11Class {
2- #name : # PMAnotherChromosomeManagerTest ,
3- #superclass : # TestCase ,
2+ #name : ' PMAnotherChromosomeManagerTest' ,
3+ #superclass : ' TestCase' ,
44 #instVars : [
55 ' chromosomeManager'
66 ],
7- #category : #' Math-Tests-FunctionFit'
7+ #category : ' Math-Tests-FunctionFit' ,
8+ #package : ' Math-Tests-FunctionFit'
89}
910
10- { #category : # running }
11+ { #category : ' running' }
1112PMAnotherChromosomeManagerTest >> setHammersleyTest: aBoolean [
1213 chromosomeManager useHammersley: aBoolean.
1314 chromosomeManager randomizePopulation.
@@ -23,22 +24,22 @@ PMAnotherChromosomeManagerTest >> setHammersleyTest: aBoolean [
2324 self assert: (i second between: 1 and : 4 ) ]
2425]
2526
26- { #category : # running }
27+ { #category : ' running' }
2728PMAnotherChromosomeManagerTest >> setUp [
2829
2930 super setUp.
3031 chromosomeManager := PMAnotherChromosomeManager origin: #( 0 1 ) range: #( 2 3 ) .
3132 chromosomeManager randomGenerator: (Random seed: 42 )
3233]
3334
34- { #category : # tests }
35+ { #category : ' tests' }
3536PMAnotherChromosomeManagerTest >> testAccessing [
3637 self assert: chromosomeManager range equals: #(2 3) .
3738 self assert: chromosomeManager populationSize equals: 100 .
3839 self deny: chromosomeManager isFullyPopulated
3940]
4041
41- { #category : # tests }
42+ { #category : ' tests' }
4243PMAnotherChromosomeManagerTest >> testCrossOver [
4344
4445 | a |
@@ -56,7 +57,7 @@ PMAnotherChromosomeManagerTest >> testCrossOver [
5657 self assert: (a occurrencesOf: #( 1 2 3 ) ) < 20
5758]
5859
59- { #category : # tests }
60+ { #category : ' tests' }
6061PMAnotherChromosomeManagerTest >> testEirCrossOver [
6162|a |
6263a := (1 to: 200 )collect: [:i | a: = chromosomeManager eirCrossover: #(1.0 3.0) and : #(5.0 1.0) .
@@ -82,7 +83,7 @@ self shouldnt: [a:=chromosomeManager eirCrossover: #(1 -3) and: #(1 -3)] raise:
8283 ].
8384]
8485
85- { #category : # tests }
86+ { #category : ' tests' }
8687PMAnotherChromosomeManagerTest >> testIntegerDigits [
8788 self
8889 assert: (PMAnotherChromosomeManager integerDigitsFor: 0 base: 2 )
@@ -101,7 +102,7 @@ PMAnotherChromosomeManagerTest >> testIntegerDigits [
101102 equals: #(1 4 4)
102103]
103104
104- { #category : # tests }
105+ { #category : ' tests' }
105106PMAnotherChromosomeManagerTest >> testLineCrossOver [
106107 | a |
107108 1 to: 10 do: [ :i |
@@ -110,7 +111,7 @@ PMAnotherChromosomeManagerTest >> testLineCrossOver [
110111 self assert: ((a at: 2 ) at: 2 ) equals: ((a at: 2 ) at: 1 ) negated ]
111112]
112113
113- { #category : # tests }
114+ { #category : ' tests' }
114115PMAnotherChromosomeManagerTest >> testMutateProbabilistic [
115116
116117 | a f s |
@@ -134,7 +135,7 @@ PMAnotherChromosomeManagerTest >> testMutateProbabilistic [
134135 self assert: (s size between: 3 and : 20 )
135136]
136137
137- { #category : # tests }
138+ { #category : ' tests' }
138139PMAnotherChromosomeManagerTest >> testNumberOfHamersleyPoints [
139140
140141 | rand |
@@ -197,17 +198,7 @@ PMAnotherChromosomeManagerTest >> testNumberOfHamersleyPoints [
197198 rand do: [ :i | i do: [ :j | j < (1 / 3 ) ] ]
198199]
199200
200- { #category : #tests }
201- PMAnotherChromosomeManagerTest >> testPrint [
202- |aStream s |
203- aStream := ReadWriteStream with: ' ' .
204- chromosomeManager printOn: aStream .
205- s := aStream contents .
206- self assert: (s includesSubstring: ' #(0 1)' ).
207- self assert: (s includesSubstring: ' #(2 3)' )
208- ]
209-
210- { #category : #tests }
201+ { #category : ' tests' }
211202PMAnotherChromosomeManagerTest >> testProcessand [
212203 chromosomeManager reset.
213204 1 to: 60 do: [ :i | chromosomeManager process: #(0 0) and : #(1 1) ].
@@ -218,7 +209,7 @@ PMAnotherChromosomeManagerTest >> testProcessand [
218209 self assert: chromosomeManager population size equals: 120
219210]
220211
221- { #category : # tests }
212+ { #category : ' tests' }
222213PMAnotherChromosomeManagerTest >> testRandomizePopulation [
223214
224215 | g |
@@ -231,7 +222,7 @@ PMAnotherChromosomeManagerTest >> testRandomizePopulation [
231222 self deny: chromosomeManager population first equals: g
232223]
233224
234- { #category : # tests }
225+ { #category : ' tests' }
235226PMAnotherChromosomeManagerTest >> testRateSetting [
236227self should: [chromosomeManager rateOfLC: 1.3 ] raise: DomainError .
237228self should: [chromosomeManager rateOfEir: - 0.3 ] raise: DomainError .
0 commit comments