gpt4 book ai didi

us.ihmc.yoVariables.registry.YoVariableRegistry.getNumberOfYoVariables()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 13:20:40 29 4
gpt4 key购买 nike

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

YoVariableRegistry.getNumberOfYoVariables介绍

暂无

代码示例

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

@Override
  public int compare(YoVariableRegistry o1, YoVariableRegistry o2)
  {
   if (o1.getNumberOfYoVariables() == o2.getNumberOfYoVariables())
     return 0;
   return o1.getNumberOfYoVariables() > o2.getNumberOfYoVariables() ? -1 : 1;
  }
});

代码示例来源:origin: us.ihmc/simulation-construction-set-test

private String[] getAllVariableNamesFromRegistry(YoVariableRegistry registry)
{
 int numberOfVariables = registry.getNumberOfYoVariables();
 String[] names = new String[numberOfVariables];
 for (int i = 0; i < numberOfVariables; i++)
 {
   names[i] = registry.getYoVariable(i).getName();
 }
 return names;
}

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

private static int collectRegistries(int minVariablesToPrint, int minChildrenToPrint, YoVariableRegistry registry,
   ArrayList<YoVariableRegistry> registriesOfInterest)
{
 int variables = registry.getNumberOfYoVariables();
 int children = registry.getChildren().size();
 if (variables >= minVariablesToPrint || children >= minChildrenToPrint)
   registriesOfInterest.add(registry);
 int totalNumberOfVariables = variables;
 for (int childIdx = 0; childIdx < children; childIdx++)
 {
   YoVariableRegistry childRegistry = registry.getChildren().get(childIdx);
   totalNumberOfVariables += YoVariableRegistry.collectRegistries(minVariablesToPrint, minChildrenToPrint, childRegistry,
      registriesOfInterest);
 }
 return totalNumberOfVariables;
}

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

private static void printInfo(YoVariableRegistry registry)
{
 int variables = registry.getNumberOfYoVariables();
 int children = registry.getChildren().size();
 int maxPropertyLength = 17;
 String variableString = trimStringToLength("Variables: " + variables, maxPropertyLength, "...");
 String childrenString = trimStringToLength("Children: " + children, maxPropertyLength, "...");
 int maxNameLength = 70;
 String name = registry.getClass().getSimpleName() + " " + registry.getNameSpace().getName();
 name = trimStringToLength(name, maxNameLength, "...");
 System.out.println(name + "\t" + variableString + "\t" + childrenString);
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

private void verifyRegistriesAndVariableListsAreConsistent(String[] registryNames, String[][] variableNames)
{
 for (int i=0; i<registryNames.length; i++)
 {
   String registryName = registryNames[i];
   NameSpace fullNameSpace = new NameSpace(registryName);
   YoVariableRegistry registry = rootRegistry.getOrCreateAndAddRegistry(fullNameSpace);
   if (registry.getNumberOfYoVariables() != variableNames[i].length)
   {
    String error = "registry.getNumberOfYoVariables() = " + registry.getNumberOfYoVariables() + "!= variableNames[i].length = " + variableNames[i].length;
    error = error + "\nregistry.getName() = " + registry.getName();
    error = error + "\n\n registry variables:\n";
    ArrayList<YoVariable<?>> registryVariables = registry.getAllVariablesInThisListOnly();
    for (int j=0; j<registryVariables.size(); j++)
    {
      error = error + registryVariables.get(j).getFullNameWithNameSpace() + "\n";
    }
    error = error + "\n\n variableNames:\n";
    for (int j=0; j<variableNames[i].length; j++)
    {
      error = error + variableNames[i][j] + "\n";
    }
    throw new RuntimeException(error);
   }
 }
}

代码示例来源:origin: us.ihmc/ihmc-robot-data-logger

YoVariable<?> newVariable = parent.getYoVariable(parent.getNumberOfYoVariables() - 1);

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