本文整理了Java中us.ihmc.yoVariables.variable.YoVariableList.size()
方法的一些代码示例,展示了YoVariableList.size()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YoVariableList.size()
方法的具体详情如下:
包路径:us.ihmc.yoVariables.variable.YoVariableList
类名称:YoVariableList
方法名:size
暂无
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
private void putVariablesInIndexMap()
{
for (int i = 0; i < allVariables.size(); i++)
{
YoVariable<?> v = allVariables.getVariable(i);
allVariablesIndexMap.put(v, i);
System.out.println(i + " " + v.getFullNameWithNameSpace());
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
private void updateSendVars()
{
sendVariables.clear();
int numberToIterate = allVariables.size();
for (int i=0; i<numberToIterate; i++)
{
YoVariable<?> var = allVariables.getVariable(i);
YoVariableRegistry registry = var.getYoVariableRegistry();
if (registry.isSent())
{
sendVariables.add(var);
}
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
private void updateLogVarsCount()
{
logVarsCount = 0;
int numberToIterate = allVariables.size();
for (int i=0; i<numberToIterate; i++)
{
YoVariable<?> var = allVariables.getVariable(i);
if (var.getYoVariableRegistry().isLogged())
logVarsCount++;
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-test
@Test// timeout = 30000
public void testWritingAndReadingALongStateFile() throws IOException
{
File fileOne = new File("fileOne.state");
if (fileOne.exists())
fileOne.delete();
long seed = 1776L;
int numberOfVariables = 2000; // 12000 for when testing long files for efficiency;
Random random = new Random(seed);
ArrayList<YoVariable<?>> variables = createALargeNumberOfVariables(random, numberOfVariables);
YoVariableList originalVarList = new YoVariableList("originalVarList");
originalVarList.addVariables(variables);
writeALongStateFile(fileOne, variables);
DataFileReader dataFileReader = new DataFileReader(fileOne);
YoVariableList newVarList = new YoVariableList("newVarList");
boolean createMissingVariables = true;
boolean printErrorForMissingVariables = false;
YoVariableRegistry registry = new YoVariableRegistry("root");
dataFileReader.readState(newVarList, createMissingVariables, printErrorForMissingVariables, registry);
assertEquals(originalVarList.size(), newVarList.size());
for (int i = 0; i < originalVarList.size(); i++)
{
YoVariable<?> originalVariable = originalVarList.getVariable(i);
YoVariable<?> newVariable = newVarList.getVariable(originalVariable.getName());
assertFalse(originalVariable == newVariable);
assertEquals(originalVariable.getValueAsDouble(), newVariable.getValueAsDouble(), 1e-7);
}
fileOne.delete();
}
代码示例来源:origin: us.ihmc/simulation-construction-set-test
dataFileReader.readData(newVarList, registry, newDataBuffer);
assertEquals(originalVarList.size(), newVarList.size());
for (int i = 0; i < originalVarList.size(); i++)
内容来源于网络,如有侵权,请联系作者删除!