gpt4 book ai didi

us.ihmc.yoVariables.parameters.YoParameter类的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 05:55:31 26 4
gpt4 key购买 nike

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

YoParameter介绍

[英]Base class for parameters. Parameters cannot be changed from code and are only changed by the user/operator. Available implementations - BooleanParameter - DoubleParameter - EnumParameter - IntegerParameter - LongParameter
[中]参数的基类。参数不能从代码中更改,只能由用户/操作员更改。可用实现-booleanparmeter-DoubleParameter-enumparmeter-IntegerParameter-longparmeter

代码示例

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

YoParameter(String name, String description)
{
 checkForIllegalCharacters(name);
 this.name = name;
 this.description = description;
}

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

public void setParameterFromThis(YoParameter<?> parameter)
  {
   parameter.load(value);
   parameter.setSuggestedRange(min, max);
  }
}

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

public void writeParametersInRegistry(YoVariableRegistry registry)
{
 List<YoParameter<?>> parameters = registry.getAllParameters();
 
 for(int i = 0; i < parameters.size(); i++)
 {
   YoParameter<?> parameter = parameters.get(i);
         NameSpace relativeNamespace = AbstractParameterReader.getRelativeNamespace(parameter.getNameSpace(), registry);
      String value = parameter.getValueAsString();
   String min = String.valueOf(parameter.getVariable().getManualScalingMin());
   String max = String.valueOf(parameter.getVariable().getManualScalingMax());
   setValue(relativeNamespace, parameter.getName(), parameter.getDescription(), parameter.getClass().getSimpleName(), value, min, max);
    }
}

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

NameSpace relativeNamespace = getRelativeNamespace(parameter.getNameSpace(), registry);
String fullName = relativeNamespace + "." + parameter.getName();
ParameterData data = localMap.remove(fullName);
 parameter.loadDefault();
 defaultParametersToPack.add(fullName);

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

/**
*
* @return the namespace of this parameter
*/
public NameSpace getNameSpace()
{
 return getVariable().getNameSpace();
}

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

public static DoubleParameter findOrCreate(String name, YoVariableRegistry registry, double initialValue)
  {
   Optional<YoParameter<?>> parameter = registry.getParametersInThisRegistry().stream().filter(p -> p.getName().equals(name)).findFirst();
   if (parameter.isPresent())
   {
     return (DoubleParameter) parameter.get();
   }
   return new DoubleParameter(name, registry, initialValue);
  }
}

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

/**
* Sets the suggested range for tuning purposes.
* 
* The minimum and maximum will not be enforced and the parameter can be 
* set to any value. This is just a suggestion to the user. 
* 
* @param min Lower end of the suggested range for this parameter.
* @param max Upper end of the suggested range for this parameter.
*/
public void setSuggestedRange(int min, int max)
{
 super.setSuggestedRange(min, max);
}

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

if (variable.isParameter())
 ParameterLoadStatus loadStatus = variable.getParameter().getLoadStatus();
 switch (loadStatus)

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

public static void readParameter(YoParameter<?> parameter, double doubleValue, ParameterLoadStatus loadStatus)
  {
   if (loadStatus == ParameterLoadStatus.UNLOADED)
   {
     throw new RuntimeException("Can not load parameter and set the status to unloaded.");
   }
   parameter.getVariable().setValueFromDouble(doubleValue);
   parameter.loadStatus = loadStatus;
  }
}

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

/**
* Sets the suggested range for tuning purposes.
* 
* The minimum and maximum will not be enforced and the parameter can be 
* set to any value. This is just a suggestion to the user. 
* 
* @param min Lower end of the suggested range for this parameter.
* @param max Upper end of the suggested range for this parameter.
*/
public void setSuggestedRange(long min, long max)
{
 super.setSuggestedRange(min, max);
}

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

void setSuggestedRange(double min, double max)
{
 getVariable().setManualScalingMinMax(min, max);
}

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

/**
* Sets the suggested range for tuning purposes.
* 
* The minimum and maximum will not be enforced and the parameter can be 
* set to any value. This is just a suggestion to the user. 
* 
* @param min Lower end of the suggested range for this parameter.
* @param max Upper end of the suggested range for this parameter.
*/
@Override
public void setSuggestedRange(double min, double max)
{
 super.setSuggestedRange(min, max);
}

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

public double getManualScalingMax()
{
 return getVariable().getManualScalingMax();
}

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

public double getManualScalingMin()
{
 return getVariable().getManualScalingMin();
}

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

/**
* Attaches an object implementing {@link ParameterChangedListener} to this parameter's list of listeners.
*
*<p>Instantiates a new list of listeners if it is currently empty.</p>
*
* @param ParameterChangedListener ParameterChangedListener to attach
*/
public void addParameterChangedListener(ParameterChangedListener parameterChangedListener)
{
 if (parameterChangedListenersHolder == null)
 {
   parameterChangedListenersHolder = new YoParameterChangedListenerHolder();
   getVariable().addVariableChangedListener(parameterChangedListenersHolder);
 }
 this.parameterChangedListenersHolder.add(parameterChangedListener);
}

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