question: private void writeLegsDistribution ( final String plansFile , final String outputFile ) { Map < Id < Person > , List < String > > personId2legs = getLegsForAllPlansInChoiceSet ( plansFile ) ; Map < Id < Person > , double [ ] > personId2LegsCounts = getPersonId2LegsCountInChoiceSet ( personId2legs ) ; int carIndex = 0 ; int ptIndex = 1 ; int legsClassesLength = 8 ; Map < Integer , double [ ] > legsClass2LegsCounter = new HashMap < > ( ) ; for ( int i = 0 ; i < legsClassesLength ; i ++ ) { double [ ] legsCounter = { 0. , 0. } ; legsClass2LegsCounter . put ( i , legsCounter ) ; } for ( Id < Person > id : personId2LegsCounts . keySet ( ) ) { double carLegs = personId2LegsCounts . get ( id ) [ carIndex ] ; double ptLegs = personId2LegsCounts . get ( id ) [ ptIndex ] ; for ( Integer j : legsClass2LegsCounter . keySet ( ) ) { if ( ( int ) carLegs == j ) { int carCounterSoFar = ( int ) legsClass2LegsCounter . get ( j ) [ carIndex ] ; double [ ] legsCounter = { carCounterSoFar + 1 , legsClass2LegsCounter . get ( j ) [ ptIndex ] } ; legsClass2LegsCounter . put ( j , legsCounter ) ; } if ( ( int ) ptLegs == j ) { int ptCounterSoFar = ( int ) legsClass2LegsCounter . get ( j ) [ ptIndex ] ; double [ ] legsCounter = { legsClass2LegsCounter . get ( j ) [ carIndex ] , ptCounterSoFar + 1 } ; legsClass2LegsCounter . put ( j , legsCounter ) ; } } } BufferedWriter writer = IOUtils . getBufferedWriter ( outputFile ) ; try { writer . write ( "numberOfLegs \t" + "car" + "\t" + "pt" + "\n" ) ; for ( Integer i : legsClass2LegsCounter . keySet ( ) ) { writer . write ( i + "\t" + legsClass2LegsCounter . get ( i ) [ carIndex ] + "\t" + legsClass2LegsCounter . get ( i ) [ ptIndex ] + "\n" ) ; } writer . close ( ) ; } catch ( Exception e ) { throw new RuntimeException ( "Data is not written in File. Reason " + e ) ; } log . info ( "Data has written to " + outputFile ) ; }
target:  write "how many persons have 0/1/2/...6/7 car/pt in their plans choice set?". For e.g. ==0	16699.0		66564.0==  indicates that 16699 persons have 0 car in their choice set and 66564 persons have 0 pt in their choice set.