本文整理汇总了Java中org.apache.commons.lang3.mutable.MutableDouble.doubleValue方法的典型用法代码示例。如果您正苦于以下问题:Java MutableDouble.doubleValue方法的具体用法?Java MutableDouble.doubleValue怎么用?Java MutableDouble.doubleValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang3.mutable.MutableDouble
的用法示例。
在下文中一共展示了MutableDouble.doubleValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findBestClusterToMerge
import org.apache.commons.lang3.mutable.MutableDouble; //导入方法依赖的package包/类
private Pair<Integer, Double> findBestClusterToMerge(int origCluster, int minCluster, int maxCluster, ContextCounts clusterContextCounts) {
MutableDouble bestScore = new MutableDouble(-Double.MAX_VALUE);
MutableInt bestCluster = new MutableInt(-1);
Utils.fasterParallelStream(clusterContextCounts.getAllClusters()).forEach(cluster -> {
if (cluster >= minCluster && cluster < maxCluster && cluster != origCluster) {
double score = computeMergeScore(origCluster, 0.0, cluster, clusterContextCounts);
if (score > bestScore.doubleValue()) {
synchronized (bestScore) {
if (score > bestScore.doubleValue()) { //bestScore might have changed while acquiring lock
bestScore.setValue(score);
bestCluster.setValue(cluster);
}
}
}
}
});
return new Pair<>(bestCluster.intValue(), bestScore.doubleValue());
}
示例2: updateNearestPoint
import org.apache.commons.lang3.mutable.MutableDouble; //导入方法依赖的package包/类
private void updateNearestPoint(
@Nonnull Body body, @Nonnull Point2D point, @Nonnull Mutable<Point2D> nearestPoint,
@Nonnull MutableDouble distanceToNearestPoint) {
double distanceToPoint = body.getDistanceTo(point);
if (distanceToPoint >= epsilon
&& (nearestPoint.get() == null || distanceToPoint < distanceToNearestPoint.doubleValue())) {
nearestPoint.set(point);
distanceToNearestPoint.setValue(distanceToPoint);
}
}
示例3: updateFarthestPoint
import org.apache.commons.lang3.mutable.MutableDouble; //导入方法依赖的package包/类
private static void updateFarthestPoint(
@Nonnull Body body, @Nonnull Point2D point, @Nonnull Mutable<Point2D> farthestPoint,
@Nonnull MutableDouble distanceToFarthestPoint, double startAngle, double finishAngle) {
double distanceToPoint = body.getDistanceTo(point);
if (GeometryUtil.isAngleBetween(new Vector2D(body.getPosition(), point).getAngle(), startAngle, finishAngle)
&& (farthestPoint.get() == null || distanceToPoint > distanceToFarthestPoint.doubleValue())) {
farthestPoint.set(point);
distanceToFarthestPoint.setValue(distanceToPoint);
}
}
示例4: getOutput
import org.apache.commons.lang3.mutable.MutableDouble; //导入方法依赖的package包/类
@Override
public Double getOutput(MutableDouble accumulatedValue)
{
return accumulatedValue.doubleValue();
}