forked from TerraME/calibration
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TerraME#204. Adding test into a separate directory in order to avoid …
…problems with sessionInfo().graphics.
- Loading branch information
1 parent
0ba1f8b
commit 87ad3bf
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
return{ | ||
multiLevel = function(unitTest) | ||
local cs = CellularSpace{ | ||
file = filePath("costanza.pgm", "calibration")} | ||
local cs2 = CellularSpace{ | ||
file = filePath("costanza2.pgm", "calibration"), | ||
attrname = "costanza"} | ||
|
||
-- Discrete Tests: | ||
local result, data = multiLevel{ | ||
target = {cs, cs2}, | ||
select = "costanza", | ||
discrete = true | ||
} | ||
|
||
unitTest:assertEquals(result, 0.865, 0.01) -- 0.84 is the Total Fitness in Costanza Paper Example. | ||
|
||
local chart = _Gtme.Chart{ | ||
target = data, | ||
select = "fit" | ||
} | ||
|
||
unitTest:assertSnapshot(chart, "costanza-original.png") | ||
|
||
result, data = multiLevel{ | ||
target = {cs, cs2}, | ||
select = "costanza", | ||
log = true, | ||
discrete = true | ||
} | ||
|
||
unitTest:assertEquals(result, 0.85, 0.01) | ||
|
||
chart = _Gtme.Chart{ | ||
target = data, | ||
select = "fit", | ||
xLabel = "Window Size", | ||
yLabel = "Fit" | ||
} | ||
|
||
unitTest:assertSnapshot(chart, "costanza-log.png") | ||
end | ||
} |