📄 estimatedcriteriontest.java
字号:
/* * YALE - Yet Another Learning Environment * Copyright (C) 2002, 2003 * Simon Fischer, Ralf Klinkenberg, Ingo Mierswa, * Katharina Morik, Oliver Ritthoff * Artificial Intelligence Unit * Computer Science Department * University of Dortmund * 44221 Dortmund, Germany * email: yale@ls8.cs.uni-dortmund.de * web: http://yale.cs.uni-dortmund.de/ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA. */package edu.udo.cs.yale.operator.performance.test;import edu.udo.cs.yale.operator.performance.*;/** Tests {@link EstimatedPerformance}. * * @version $Id: EstimatedCriterionTest.java,v 1.4 2003/05/22 11:51:18 fischer Exp $ */public class EstimatedCriterionTest extends CriterionTestCase { private EstimatedPerformance performance10x08, performance20x04; public void setUp() throws Exception { super.setUp(); performance10x08 = new EstimatedPerformance("test_performance", 0.8, 10, false); performance20x04 = new EstimatedPerformance("test_performance", 0.4, 20, false); } public void tearDown() throws Exception { performance10x08 = performance20x04 = null; super.tearDown(); } /** Tests micro and makro average. Since makro average is implemented in * {@link PerformanceCriterion}, this does not have to be tested for measured * performance criteria. */ public void testAverage() { performance10x08.buildAverage(performance20x04); assertEquals("Wrong weighted average", (10*0.8 + 20*0.4) / (10+20), performance10x08.getValue(), 0.0000001); assertEquals("Wrong makro average", (0.8 + 0.4) / 2, performance10x08.getMakroAverage(), 0.0000001); } public void testClone() { cloneTest("Clone of simple criterion", performance10x08); performance10x08.buildAverage(performance20x04); cloneTest("Clone of averaged criterion", performance10x08); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -