本文整理匯總了Java中edacc.parameterspace.ParameterConfiguration.unsetParameter方法的典型用法代碼示例。如果您正苦於以下問題:Java ParameterConfiguration.unsetParameter方法的具體用法?Java ParameterConfiguration.unsetParameter怎麽用?Java ParameterConfiguration.unsetParameter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類edacc.parameterspace.ParameterConfiguration
的用法示例。
在下文中一共展示了ParameterConfiguration.unsetParameter方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testEqualsObject
import edacc.parameterspace.ParameterConfiguration; //導入方法依賴的package包/類
@Test
public void testEqualsObject() throws Exception {
APIImpl api = new APIImpl();
ParameterGraph pspace = api.loadParameterGraphFromFile("src/edacc/parameterspace/test/complex.xml");
ParameterConfiguration config = new ParameterConfiguration(pspace.getParameterSet());
config.setParameterValue("c1", 5);
config.setParameterValue("ps", 0.1);
config.setParameterValue("flag", FlagDomain.FLAGS.OFF);
assertTrue("c1: 5 flag: OFF ps: 0.1 ".equals(config.toString()));
ParameterConfiguration config2 = new ParameterConfiguration(pspace.getParameterSet());
config2.setParameterValue("c1", 5);
config2.setParameterValue("ps", 0.1);
config2.unsetParameter("flag"); // set flag to null, should be equal to a configuration with flag = FlagDomain.FLAGS.OFF
assertTrue(config.equals(config2));
}
示例2: testGetFullNeighbourhood
import edacc.parameterspace.ParameterConfiguration; //導入方法依賴的package包/類
@Test
public void testGetFullNeighbourhood() throws Exception {
API api = new APIImpl();
ParameterGraph pspace = api.loadParameterGraphFromFile("src/edacc/parameterspace/test/complex.xml");
ParameterConfiguration config = new ParameterConfiguration(pspace.getParameterSet());
config.setParameterValue("c1", 5);
config.setParameterValue("ps", 0.1);
config.setParameterValue("flag", FlagDomain.FLAGS.ON);
config.setParameterValue("method", "hybrid");
config.setParameterValue("cat", "1");
assertTrue("c1: 5 cat: 1 method: hybrid flag: ON ps: 0.1 ".equals(config.toString()));
List<ParameterConfiguration> nbh = pspace.getNeighbourhood(config);
ParameterConfiguration nb1 = new ParameterConfiguration(config);
nb1.setParameterValue("method", "atom");
assertTrue(nbh.contains(nb1));
ParameterConfiguration nb2 = new ParameterConfiguration(config);
nb2.setParameterValue("flag", FlagDomain.FLAGS.OFF);
assertFalse(nbh.contains(nb2)); // flag -> off should lead to method and cat being removed
nb2.unsetParameter("cat");
nb2.unsetParameter("method");
assertTrue(nbh.contains(nb2));
ParameterConfiguration nb3 = new ParameterConfiguration(config);
nb3.setParameterValue("c1", 6);
assertTrue(nbh.contains(nb3));
nb3.setParameterValue("c1", 5); // same config
assertFalse(nbh.contains(nb3));
}
示例3: testValidateParameterConfiguration
import edacc.parameterspace.ParameterConfiguration; //導入方法依賴的package包/類
@Test
public void testValidateParameterConfiguration() throws Exception {
API api = new APIImpl();
ParameterGraph pspace = api.loadParameterGraphFromFile("src/edacc/parameterspace/test/complex.xml");
ParameterConfiguration config = new ParameterConfiguration(pspace.getParameterSet());
config.setParameterValue("c1", 5);
config.setParameterValue("ps", 0.1);
config.setParameterValue("flag", FlagDomain.FLAGS.ON);
config.setParameterValue("method", "hybrid");
config.setParameterValue("cat", "1");
assertTrue(pspace.validateParameterConfiguration(config));
List<ParameterConfiguration> nbh = pspace.getNeighbourhood(config);
ParameterConfiguration nb1 = new ParameterConfiguration(config);
nb1.setParameterValue("method", "atom");
assertTrue(nbh.contains(nb1));
assertTrue(pspace.validateParameterConfiguration(nb1));
ParameterConfiguration nb2 = new ParameterConfiguration(config);
nb2.setParameterValue("flag", FlagDomain.FLAGS.OFF);
assertFalse(nbh.contains(nb2)); // flag -> off should lead to method and cat being removed
assertFalse(pspace.validateParameterConfiguration(nb2));
nb2.unsetParameter("cat");
nb2.unsetParameter("method");
assertTrue(nbh.contains(nb2));
assertTrue(pspace.validateParameterConfiguration(nb2));
ParameterConfiguration nb3 = new ParameterConfiguration(config);
nb3.setParameterValue("c1", 6);
assertTrue(nbh.contains(nb3));
nb3.setParameterValue("c1", 5); // same config
assertFalse(nbh.contains(nb3));
assertTrue(pspace.validateParameterConfiguration(nb3));
}