gpt4 book ai didi

us.ihmc.yoVariables.variable.YoInteger类的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 02:06:40 25 4
gpt4 key购买 nike

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

YoInteger介绍

[英]Integer implementation of the YoVariable class.

All abstract functions of YoVariable will be implemented using integer type for interpretation. Values will be interpreted, compared, and returned as integers rather than other native types.
[中]YoVariable类的整数实现。
YoVariable的所有抽象函数都将使用整数类型进行解释。值将被解释、比较和返回为整数,而不是其他本机类型。

代码示例

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

/**
* Sets this YoInteger to its current value minus one.
*/
public void decrement()
{
 this.set(this.getIntegerValue() - 1);
}

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

/**
* Creates a new YoInteger with the same parameters as this one, and registers it to the passed {@link YoVariableRegistry}.
*
* @param newRegistry YoVariableRegistry to duplicate this YoInteger to
* @return the newly created and registered YoInteger
*/
@Override public YoInteger duplicate(YoVariableRegistry newRegistry)
{
 YoInteger retVar = new YoInteger(getName(), getDescription(), newRegistry, getManualScalingMin(), getManualScalingMax());
 retVar.set(getIntegerValue());
 return retVar;
}

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

/**
* Add a value and return a handle to the object.
*
* @return value at the last position. This object can still hold data.
*/
public T add()
{
 maxCapacityCheck(position.getIntegerValue() + 1);
 position.increment();
 T val = values[position.getIntegerValue()];
 return val;
}

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

public GlitchFilteredYoInteger(String name, int windowSize, YoInteger position, YoVariableRegistry registry)
{
 super(name, GlitchFilteredYoInteger.class.getSimpleName(), registry);
 this.position = position;
 previousPosition = new YoInteger(name + "PrevValue", registry);
 counter = new YoInteger(name + "Count", registry);
 YoInteger yoWindowSize = new YoInteger(name + "WindowSize", registry);
 yoWindowSize.set(windowSize);
 this.windowSize = yoWindowSize;
}

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

public YoCounter(String namePrefix, YoVariableRegistry registry)
{
 count = new YoInteger(namePrefix + "Count", registry);
 maxCount = new YoInteger(namePrefix + "MaxCount", registry);
}

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

public void update(int currentValue)
{
 if (currentValue == previousPosition.getIntegerValue())
   counter.increment();
 else
   counter.set(0);
 if (counter.getIntegerValue() >= windowSize.getValue())
 {
   set(currentValue);
   counter.set(0);
 }
 previousPosition.set(currentValue);
}

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

/**
* Clears the list.
*
* This function just resets the size to 0. The underlying data objects are not emptied or removed.
*/
public void resetQuick()
{
 position.set(-1);
}

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

@Override
  public String toString()
  {
   if (numberOfWaypoints.getIntegerValue() == 0)
     return namePrefix + ": Has no waypoints.";
   else
     return namePrefix + ": number of waypoints = " + numberOfWaypoints.getIntegerValue() + ", current waypoint index = "
        + currentWaypointIndex.getIntegerValue() + "\nFirst waypoint: " + waypoints.get(0) + ", last waypoint: "
        + waypoints.get(numberOfWaypoints.getIntegerValue() - 1);
  }
}

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

@Override
public void doControl()
{
 if ((ticksTillNextWrite == null) || (ticksTillNextWrite.getIntegerValue() <= 0))
 {
   write();
      if (ticksTillNextWrite != null) ticksTillNextWrite.set(writeEveryNTicks-1);
 }
 else
 {
   ticksTillNextWrite.decrement();
 }
}

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

public void set(Point3DReadOnly[] points)
{
 if (points.length > this.ccwOrderedYoFramePoints.length)
   throw new RuntimeException("Cannot plot more vertices than the maximum number");
 numberOfPoints.set(points.length);
 for (int i = 0; i < numberOfPoints.getValue(); i++)
   ccwOrderedYoFramePoints[i].set(points[i]);
 for (int i = numberOfPoints.getValue(); i < ccwOrderedYoFramePoints.length; i++)
   ccwOrderedYoFramePoints[i].setToNaN();
}

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit-test

@Override
public void doAction()
{
  ticksInState.increment();
}

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

public boolean isDone()
{
 if (isEmpty())
   return true;
 boolean isLastWaypoint = currentWaypointIndex.getIntegerValue() >= numberOfWaypoints.getIntegerValue() - 2;
 if (!isLastWaypoint)
   return false;
 return currentTrajectoryTime.getValue() >= waypoints.get(currentWaypointIndex.getValue() + 1).getTime();
}

代码示例来源:origin: us.ihmc/ihmc-quadruped-robotics-test

@Override
public void doScript(double t)
{
 if(counter.getIntegerValue() == 0)
 {
   teleopManager.update();
   updateCounter();
 }
 else
 {
   counter.decrement();
 }
}

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

/**
* Returns String representation of this YoInteger.
*
* @return String representing this YoInteger and its current value as an integer
*/
@Override public String toString()
{
 return String.format("%s: %d", getName(), getIntegerValue());
}

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

public void doAverage()
{
 if (dataLength.getIntegerValue() < 1)
   return;
 set(dataCumulated.getDoubleValue() / dataLength.getValueAsDouble());
 reset();
}

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

/** {@inheritDoc} */
@Override
public void addVertex(double x, double y)
{
 isUpToDate = false;
 YoFramePoint2D newVertex = vertexBuffer.get(numberOfVertices.getValue());
 if (newVertex == null)
   throw new RuntimeException("This polygon has reached its maximum number of vertices.");
 newVertex.set(x, y);
 numberOfVertices.increment();
}

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

/** {@inheritDoc} */
@Override
public int getNumberOfVertices()
{
 return numberOfVertices.getValue();
}

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

/**
* Removes the last element in the list. The underlying data object is not emptied or removed
*/
public void remove()
{
 nonEmptyCheck();
 position.decrement();
}

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

public YoPreallocatedList(Class<T> clazz, Supplier<T> allocator, String prefix, YoVariableRegistry registry, int capacity)
{
 this.clazz = clazz;
 this.position = new YoInteger(prefix + "Index", registry);
 this.values = (T[]) Array.newInstance(clazz, capacity);
 for (int i = 0; i < capacity; i++)
 {
   values[i] = allocator.get();
 }
 position.set(-1);
}

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

public RTPSDebugRegistry()
{
 
 this.skippedPackets = new YoInteger("skippedPackets", loggerDebugRegistry);
 this.skippedIncomingPackets = new YoInteger("skippedIncomingPackets", loggerDebugRegistry);
 this.nonIncreasingTimestamps = new YoInteger("nonIncreasingTimestamps", loggerDebugRegistry);
 this.packetsOutOfOrder = new YoInteger("packetsOutOfOrder", loggerDebugRegistry);
 this.mergedPackets = new YoInteger("mergedPackets", loggerDebugRegistry);
 this.totalPackets = new YoInteger("totalPackets", loggerDebugRegistry);
 this.skippedPacketDueToFullBuffer = new YoInteger("skippedPacketDueToFullBuffer", loggerDebugRegistry);
 this.firstSegmentsMissing = new YoInteger("firstSegmentsMissing", loggerDebugRegistry);
}

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