@Ignore @Test public void should_setTimeSeriesWeights() throws CloneNotSupportedException { List<ProgressionUnit> progressionUnits = progressionUnitSetup(); harmonicLoopWeighter.assignTimeSeriesWeight(LoopPositions.POSITION_ONE, progressionUnits.get(1), progressionUnits.get(0)); assertThat(progressionUnits.get(1).getProgressionUnitBars() .get(LoopPositions.POSITION_ONE) .getHarmonicLoopOptions() .get(2) .getTimeseriesWeight()).isEqualTo(WeightClass.OK); assertThat(progressionUnits.get(1).getProgressionUnitBars() .get(LoopPositions.POSITION_ONE) .getHarmonicLoopOptions() .get(3) .getTimeseriesWeight()).isEqualTo(WeightClass.OK); progressionUnits = progressionUnitSetup(); harmonicLoopWeighter.assignTimeSeriesWeight(LoopPositions.POSITION_TWO, progressionUnits.get(1), progressionUnits.get(0)); assertThat(progressionUnits.get(1).getProgressionUnitBars() .get(LoopPositions.POSITION_TWO) .getHarmonicLoopOptions() .get(2) .getTimeseriesWeight()).isEqualTo(WeightClass.OK); assertThat(progressionUnits.get(1).getProgressionUnitBars() .get(LoopPositions.POSITION_TWO) .getHarmonicLoopOptions() .get(3) .getTimeseriesWeight()).isEqualTo(WeightClass.OK); progressionUnits = progressionUnitSetup(); harmonicLoopWeighter.assignTimeSeriesWeight(LoopPositions.POSITION_THREE, progressionUnits.get(1), progressionUnits.get(0)); assertThat(progressionUnits.get(1).getProgressionUnitBars() .get(LoopPositions.POSITION_THREE) .getHarmonicLoopOptions() .get(2) .getTimeseriesWeight()).isEqualTo(WeightClass.OK); assertThat(progressionUnits.get(1).getProgressionUnitBars() .get(LoopPositions.POSITION_THREE) .getHarmonicLoopOptions() .get(3) .getTimeseriesWeight()).isEqualTo(WeightClass.OK); progressionUnits = progressionUnitSetup(); harmonicLoopWeighter.assignTimeSeriesWeight(LoopPositions.POSITION_FOUR, progressionUnits.get(1), progressionUnits.get(0)); assertThat(progressionUnits.get(1).getProgressionUnitBars() .get(LoopPositions.POSITION_FOUR) .getHarmonicLoopOptions() .get(2) .getTimeseriesWeight()).isEqualTo(WeightClass.OK); assertThat(progressionUnits.get(1).getProgressionUnitBars() .get(LoopPositions.POSITION_FOUR) .getHarmonicLoopOptions() .get(3) .getTimeseriesWeight()).isEqualTo(WeightClass.OK); }
public void assignTimeSeriesWeight(Integer indexToWeight, ProgressionUnit currentProgressionUnit, ProgressionUnit priorProgressionUnit) { ProgressionUnitBar progressionUnitBar = currentProgressionUnit.getProgressionUnitBars().get(indexToWeight); for (int i = 0; i < progressionUnitBar.getHarmonicLoopOptions().size(); i++) { HarmonicLoop currentLoopOption = progressionUnitBar.getHarmonicLoopOptions().get(i); if (indexToWeight.equals(LoopPositions.POSITION_ONE) && priorProgressionUnit != null) { if (priorProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR).getHarmonicLoop() != null) { Integer previousLoopId = priorProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR).getHarmonicLoop().getId(); WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, progressionUnitBar, priorProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } if (indexToWeight.equals(LoopPositions.POSITION_TWO)) { if (currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_ONE).getHarmonicLoop() != null) { HarmonicLoop harmonicLoopOne = currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_ONE).getHarmonicLoop(); if (harmonicLoopOne != null) { WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO), currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_ONE), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } } if (indexToWeight.equals(LoopPositions.POSITION_THREE)) { if (currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO).getHarmonicLoop() != null) { HarmonicLoop harmonicLoop = currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO).getHarmonicLoop(); if (harmonicLoop != null) { WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE), currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } } if (indexToWeight.equals(LoopPositions.POSITION_FOUR)) { if (currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE).getHarmonicLoop() != null) { HarmonicLoop harmonicLoop = currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE).getHarmonicLoop(); if (harmonicLoop != null) { WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR), currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } } } }
HarmonicLoopWeighter { public void assignTimeSeriesWeight(Integer indexToWeight, ProgressionUnit currentProgressionUnit, ProgressionUnit priorProgressionUnit) { ProgressionUnitBar progressionUnitBar = currentProgressionUnit.getProgressionUnitBars().get(indexToWeight); for (int i = 0; i < progressionUnitBar.getHarmonicLoopOptions().size(); i++) { HarmonicLoop currentLoopOption = progressionUnitBar.getHarmonicLoopOptions().get(i); if (indexToWeight.equals(LoopPositions.POSITION_ONE) && priorProgressionUnit != null) { if (priorProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR).getHarmonicLoop() != null) { Integer previousLoopId = priorProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR).getHarmonicLoop().getId(); WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, progressionUnitBar, priorProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } if (indexToWeight.equals(LoopPositions.POSITION_TWO)) { if (currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_ONE).getHarmonicLoop() != null) { HarmonicLoop harmonicLoopOne = currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_ONE).getHarmonicLoop(); if (harmonicLoopOne != null) { WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO), currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_ONE), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } } if (indexToWeight.equals(LoopPositions.POSITION_THREE)) { if (currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO).getHarmonicLoop() != null) { HarmonicLoop harmonicLoop = currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO).getHarmonicLoop(); if (harmonicLoop != null) { WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE), currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } } if (indexToWeight.equals(LoopPositions.POSITION_FOUR)) { if (currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE).getHarmonicLoop() != null) { HarmonicLoop harmonicLoop = currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE).getHarmonicLoop(); if (harmonicLoop != null) { WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR), currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } } } } }
HarmonicLoopWeighter { public void assignTimeSeriesWeight(Integer indexToWeight, ProgressionUnit currentProgressionUnit, ProgressionUnit priorProgressionUnit) { ProgressionUnitBar progressionUnitBar = currentProgressionUnit.getProgressionUnitBars().get(indexToWeight); for (int i = 0; i < progressionUnitBar.getHarmonicLoopOptions().size(); i++) { HarmonicLoop currentLoopOption = progressionUnitBar.getHarmonicLoopOptions().get(i); if (indexToWeight.equals(LoopPositions.POSITION_ONE) && priorProgressionUnit != null) { if (priorProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR).getHarmonicLoop() != null) { Integer previousLoopId = priorProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR).getHarmonicLoop().getId(); WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, progressionUnitBar, priorProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } if (indexToWeight.equals(LoopPositions.POSITION_TWO)) { if (currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_ONE).getHarmonicLoop() != null) { HarmonicLoop harmonicLoopOne = currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_ONE).getHarmonicLoop(); if (harmonicLoopOne != null) { WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO), currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_ONE), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } } if (indexToWeight.equals(LoopPositions.POSITION_THREE)) { if (currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO).getHarmonicLoop() != null) { HarmonicLoop harmonicLoop = currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO).getHarmonicLoop(); if (harmonicLoop != null) { WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE), currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } } if (indexToWeight.equals(LoopPositions.POSITION_FOUR)) { if (currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE).getHarmonicLoop() != null) { HarmonicLoop harmonicLoop = currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE).getHarmonicLoop(); if (harmonicLoop != null) { WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR), currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } } } } @Autowired  HarmonicLoopWeighter(IRhythmWeighter rhythmWeighter, HarmonicLoopTimeseriesClassifier harmonicLoopTimeseriesClassifier, @Value("${bypass_eq_ratings}") boolean bypassEqRatings); }
HarmonicLoopWeighter { public void assignTimeSeriesWeight(Integer indexToWeight, ProgressionUnit currentProgressionUnit, ProgressionUnit priorProgressionUnit) { ProgressionUnitBar progressionUnitBar = currentProgressionUnit.getProgressionUnitBars().get(indexToWeight); for (int i = 0; i < progressionUnitBar.getHarmonicLoopOptions().size(); i++) { HarmonicLoop currentLoopOption = progressionUnitBar.getHarmonicLoopOptions().get(i); if (indexToWeight.equals(LoopPositions.POSITION_ONE) && priorProgressionUnit != null) { if (priorProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR).getHarmonicLoop() != null) { Integer previousLoopId = priorProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR).getHarmonicLoop().getId(); WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, progressionUnitBar, priorProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } if (indexToWeight.equals(LoopPositions.POSITION_TWO)) { if (currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_ONE).getHarmonicLoop() != null) { HarmonicLoop harmonicLoopOne = currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_ONE).getHarmonicLoop(); if (harmonicLoopOne != null) { WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO), currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_ONE), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } } if (indexToWeight.equals(LoopPositions.POSITION_THREE)) { if (currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO).getHarmonicLoop() != null) { HarmonicLoop harmonicLoop = currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO).getHarmonicLoop(); if (harmonicLoop != null) { WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE), currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } } if (indexToWeight.equals(LoopPositions.POSITION_FOUR)) { if (currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE).getHarmonicLoop() != null) { HarmonicLoop harmonicLoop = currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE).getHarmonicLoop(); if (harmonicLoop != null) { WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR), currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } } } } @Autowired  HarmonicLoopWeighter(IRhythmWeighter rhythmWeighter, HarmonicLoopTimeseriesClassifier harmonicLoopTimeseriesClassifier, @Value("${bypass_eq_ratings}") boolean bypassEqRatings); boolean setHarmonicLoopWeight(Integer indexToWeight, ProgressionUnit currentProgressionUnit, ProgressionUnit priorProgressionUnit, Iterable<AnalyticsHorizontal> analyticsHorizontals); void assignThemeWeight(Integer indexToWeight, ProgressionUnit currentProgressionUnit, ProgressionUnit priorProgressionUnit); void assignTimeSeriesWeight(Integer indexToWeight, ProgressionUnit currentProgressionUnit, ProgressionUnit priorProgressionUnit); void assignWeights(ProgressionUnitBar progressionUnitBar, List<WeightTaskResponse> weightTaskResponses); }
HarmonicLoopWeighter { public void assignTimeSeriesWeight(Integer indexToWeight, ProgressionUnit currentProgressionUnit, ProgressionUnit priorProgressionUnit) { ProgressionUnitBar progressionUnitBar = currentProgressionUnit.getProgressionUnitBars().get(indexToWeight); for (int i = 0; i < progressionUnitBar.getHarmonicLoopOptions().size(); i++) { HarmonicLoop currentLoopOption = progressionUnitBar.getHarmonicLoopOptions().get(i); if (indexToWeight.equals(LoopPositions.POSITION_ONE) && priorProgressionUnit != null) { if (priorProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR).getHarmonicLoop() != null) { Integer previousLoopId = priorProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR).getHarmonicLoop().getId(); WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, progressionUnitBar, priorProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } if (indexToWeight.equals(LoopPositions.POSITION_TWO)) { if (currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_ONE).getHarmonicLoop() != null) { HarmonicLoop harmonicLoopOne = currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_ONE).getHarmonicLoop(); if (harmonicLoopOne != null) { WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO), currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_ONE), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } } if (indexToWeight.equals(LoopPositions.POSITION_THREE)) { if (currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO).getHarmonicLoop() != null) { HarmonicLoop harmonicLoop = currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO).getHarmonicLoop(); if (harmonicLoop != null) { WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE), currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_TWO), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } } if (indexToWeight.equals(LoopPositions.POSITION_FOUR)) { if (currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE).getHarmonicLoop() != null) { HarmonicLoop harmonicLoop = currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE).getHarmonicLoop(); if (harmonicLoop != null) { WeightClass weightClass = harmonicLoopTimeseriesClassifier.classify(currentLoopOption, currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_FOUR), currentProgressionUnit.getProgressionUnitBars().get(LoopPositions.POSITION_THREE), null); currentLoopOption.setTimeseriesWeight(weightClass); continue; } } } } } @Autowired  HarmonicLoopWeighter(IRhythmWeighter rhythmWeighter, HarmonicLoopTimeseriesClassifier harmonicLoopTimeseriesClassifier, @Value("${bypass_eq_ratings}") boolean bypassEqRatings); boolean setHarmonicLoopWeight(Integer indexToWeight, ProgressionUnit currentProgressionUnit, ProgressionUnit priorProgressionUnit, Iterable<AnalyticsHorizontal> analyticsHorizontals); void assignThemeWeight(Integer indexToWeight, ProgressionUnit currentProgressionUnit, ProgressionUnit priorProgressionUnit); void assignTimeSeriesWeight(Integer indexToWeight, ProgressionUnit currentProgressionUnit, ProgressionUnit priorProgressionUnit); void assignWeights(ProgressionUnitBar progressionUnitBar, List<WeightTaskResponse> weightTaskResponses);  }