gpt4 book ai didi

us.ihmc.yoVariables.variable.YoVariableList.getVariable()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 09:23:31 25 4
gpt4 key购买 nike

本文整理了Java中us.ihmc.yoVariables.variable.YoVariableList.getVariable()方法的一些代码示例,展示了YoVariableList.getVariable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YoVariableList.getVariable()方法的具体详情如下:
包路径:us.ihmc.yoVariables.variable.YoVariableList
类名称:YoVariableList
方法名:getVariable

YoVariableList.getVariable介绍

暂无

代码示例

代码示例来源:origin: us.ihmc/ihmc-yovariables

public synchronized boolean hasVariableWithName(String name)
{
 if (getVariable(name) != null)
 {
   return true;
 }
 return false;
}

代码示例来源: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/ihmc-yovariables

YoVariable<?> var = getVariable(name);

代码示例来源: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 addVariables(int nvars, String[] vars, float[] vals)
{
 for (int i = 0; i < nvars; i++)
 {
   // System.out.println("Looking for var " + vars[i]);
   String fullVariableName = vars[i];
   YoVariable<?> v = rootRegistry.getVariable(fullVariableName);
   if (allVariables.getVariable(fullVariableName) != null)
   {
    System.err.println("Robot has repeat variable names! Already registered " + fullVariableName);
    System.err.flush();
    System.exit(-1);
   }
   if (v != null)
   {
    addVariableAndSetInitialValue(vals[i], fullVariableName, v);
   }
   else
   {
    createAndAddVariableAndSetInitialValue(vals[i], fullVariableName);
   }
 }
}

代码示例来源: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

YoVariable<?> originalVariable = originalVarList.getVariable(i);
YoVariable<?> newVariable = newVarList.getVariable(originalVariable.getName());

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com