The following document contains the results of PMD's CPD 6.46.0.
| File | Line |
|---|---|
| org/opentrafficsim/core/animation/gtu/colorer/AccelerationGtuColorer.java | 85 |
| org/opentrafficsim/core/animation/gtu/colorer/SpeedGtuColorer.java | 59 |
if (ratio <= 0)
{
return this.legend.get(0).getColor();
}
if (ratio >= this.legend.size() - 1)
{
return this.legend.get(this.legend.size() - 1).getColor();
}
// Interpolate
int floor = (int) Math.floor(ratio);
return ColorInterpolator.interpolateColor(this.legend.get(floor).getColor(), this.legend.get(floor + 1).getColor(),
ratio - floor);
}
/** {@inheritDoc} */
@Override
public final List<LegendEntry> getLegend()
{
return Collections.unmodifiableList(this.legend);
}
/** {@inheritDoc} */
@Override
public final String toString()
{
return "Acceleration"; | |