private void assignRouteScoresByNumberOfTransactions(){
  HashMap<Id,Integer> correlationCount=new HashMap<>();
  for (  Id routeId : possibleMatsimRoutesSortedBynumberOfStops) {
    ArrayList<Id> stopList=routeIdToStopIdSequence.get(routeId);
    int score=0;
    for (    CepasTransaction transaction : cepasTransactions) {
      if (stopList.contains(transaction.stopId))       score++;
    }
    correlationCount.put(routeId,score);
  }
  routesSortedByNumberOfTransactions=new TreeSet<>(new ValueComparator(correlationCount));
  routesSortedByNumberOfTransactions.addAll(correlationCount.keySet());
}

private void assignRouteScoresByNumberOfTransactions ( ) { HashMap < Id , Integer > correlationCount = new HashMap < > ( ) ; for ( Id routeId : possibleMatsimRoutesSortedBynumberOfStops ) { ArrayList < Id > stopList = routeIdToStopIdSequence . get ( routeId ) ; int score = 0 ; for ( CepasTransaction transaction : cepasTransactions ) { if ( stopList . contains ( transaction . stopId ) ) score ++ ; } correlationCount . put ( routeId , score ) ; } routesSortedByNumberOfTransactions = new TreeSet < > ( new ValueComparator ( correlationCount ) ) ; routesSortedByNumberOfTransactions . addAll ( correlationCount . keySet ( ) ) ; }
orders the possible matsim routes for this line and direction by the number of transactions associated with the stops in the route
