|
@@ -218,7 +218,7 @@ public class SoundServiceImpl implements SoundService {
|
|
|
float sameTimes = 0;
|
|
|
for (Double time1 : times_s) {
|
|
|
for (Double time2 : times_r) {
|
|
|
- if(Math.abs(time2-time1)<1.5){
|
|
|
+ if(Math.abs(time2-time1)<1.3){
|
|
|
sameTimes++;
|
|
|
break;
|
|
|
}
|
|
@@ -232,14 +232,13 @@ public class SoundServiceImpl implements SoundService {
|
|
|
}
|
|
|
cadence = new BigDecimal(cadence_d).multiply(oneHandred).setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
- integrity = new BigDecimal(0);
|
|
|
- if(l_r.compareTo(BigDecimal.ZERO)<=0||l_s.compareTo(BigDecimal.ZERO)<=0){
|
|
|
-
|
|
|
- }else if(l_r.compareTo(l_s)<0){
|
|
|
- integrity = l_r.divide(l_s, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_HALF_UP).multiply(oneHandred).setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
- }else{
|
|
|
- integrity = new BigDecimal(100);
|
|
|
+ //完整度
|
|
|
+ BigDecimal time_s = new BigDecimal(times_s.size());
|
|
|
+ BigDecimal time_r = new BigDecimal(times_r.size());
|
|
|
+ if(time_s.compareTo(time_r)<0){
|
|
|
+ time_r = time_s;
|
|
|
}
|
|
|
+ integrity = time_r.divide(time_s, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_HALF_UP).multiply(oneHandred).setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
score = intonation.add(cadence).add(integrity).divide(new BigDecimal(3), 0, BigDecimal.ROUND_HALF_UP);
|
|
|
|