< Summary

Class:SizeAndRadiusConstrainedClustererBase
Assembly:bamlab.micromissiles
File(s):/github/workspace/Assets/Scripts/Algorithms/Clustering/SizeAndRadiusConstrainedClustererBase.cs
Covered lines:0
Uncovered lines:10
Coverable lines:10
Total lines:26
Line coverage:0% (0 of 10)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:1
Method coverage:0% (0 of 1)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SizeAndRadiusConstrainedClustererBase(...)0%12300%

File(s)

/github/workspace/Assets/Scripts/Algorithms/Clustering/SizeAndRadiusConstrainedClustererBase.cs

#LineLine coverage
 1using System;
 2
 3// Base implementation of a size and radius-constrained clustering algorithm.
 4//
 5// The size is defined as the maximum number of hierarchical objects within a cluster, and the
 6// radius denotes the maximum distance from the cluster's centroid to any of its assigned
 7// hierarchical objects.
 8public abstract class SizeAndRadiusConstrainedClustererBase : ClustererBase {
 9  // Maximum cluster size.
 010  protected readonly int _maxSize = 0;
 11
 12  // Maximum cluster radius.
 013  protected readonly float _maxRadius = 0;
 14
 015  public SizeAndRadiusConstrainedClustererBase(int maxSize, float maxRadius) {
 016    if (maxSize <= 0) {
 017      throw new ArgumentOutOfRangeException("Maximum size must be positive.", nameof(maxSize));
 18    }
 019    if (maxRadius < 0) {
 020      throw new ArgumentOutOfRangeException("Maximum radius must be non-negative.",
 21                                            nameof(maxRadius));
 22    }
 023    _maxSize = maxSize;
 024    _maxRadius = maxRadius;
 025  }
 26}