diff --git a/build.gradle b/build.gradle index f63bc29..41b4eca 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'java' jar { baseName = 'carTracker' - version = '28Apr2020_v1.08' + version = '04May2020_v1.09' } repositories { diff --git a/src/main/java/algorithms/CarAllocation.java b/src/main/java/algorithms/CarAllocation.java index f0222ab..27b8296 100644 --- a/src/main/java/algorithms/CarAllocation.java +++ b/src/main/java/algorithms/CarAllocation.java @@ -452,11 +452,11 @@ private void setupObjectiveFunctionVariablesAndCoefficients( Household hh, MPSol if(nextAo == 0) parkCostGik = 0; - // set repositioning cost to very high value if non-AV hh and not starting in the same taz + // set repositioning cost to very high value if non-AV hh and not starting in the same taz and if the persons are not same for two trips if(hh.getIfAvHousehold() == 0 ){ reposCostToNextTripOrigGik = NON_AV_REPO_COST; reposCostToHome = NON_AV_REPO_COST; - if(!pairLi) + if(!pairLi || !samePerson) reposCostToNextTripOrigSik = NON_AV_REPO_COST; } for ( int j=0; j < numAutos; j++ ) { diff --git a/src/main/java/appLayer/CarAllocatorMain.java b/src/main/java/appLayer/CarAllocatorMain.java index bc08800..2ece4dc 100644 --- a/src/main/java/appLayer/CarAllocatorMain.java +++ b/src/main/java/appLayer/CarAllocatorMain.java @@ -260,7 +260,7 @@ public static void main( String[] args ) { CarAllocatorMain mainObj = new CarAllocatorMain(); - System.out.println ( "CarTracker, 28Apr2020, v1.08, starting." ); + System.out.println ( "CarTracker, 04May2020, v1.09, starting." ); ResourceBundle rb = null; if ( args.length >=0 ) { diff --git a/src/main/java/appLayer/WriteCarAllocationOutputFilesMag.java b/src/main/java/appLayer/WriteCarAllocationOutputFilesMag.java index c8b5dae..c129579 100644 --- a/src/main/java/appLayer/WriteCarAllocationOutputFilesMag.java +++ b/src/main/java/appLayer/WriteCarAllocationOutputFilesMag.java @@ -96,15 +96,15 @@ public void writeCarAllocationOutputFile( Logger logger, HashMap tripTableFiles = new String[numberOfPeriods]; - int numVotSegments = Integer.valueOf( propertyMap.get( "output.number.vot.segments" ) ); - if ( numVotSegments > 1 ) { - votThresholds = new int[numVotSegments-1]; - for(int i=0;i 1 ) { +// votThresholds = new int[numVotSegments-1]; +// for(int i=0;i periodIntervals[4][0] = Integer.valueOf( propertyMap.get( EV_PERIOD_START_KEY ) ); periodIntervals[4][1] = Integer.valueOf( propertyMap.get( EV_PERIOD_END_KEY ) ); - logger.info( "writing trip matrix files." ); String formatString = propertyMap.get( OUTPUT_TRIP_TABLE_FORMAT_KEY ); MatrixType matrixType = MatrixType.lookUpMatrixType( formatString ); @@ -852,139 +851,69 @@ record = hh.getId()+","+ logger.info(String.format( "%-60s","Total Unused AV Cars = ") + String.format("%,15d",totalUsedAVCars)); + logger.info( "writing trip matrix files." ); + int offset = 0; if ( separateCavFiles ) - offset = numModeTables*numberOfVotCategories; + offset = numModeTables; for ( int i=0; i < periodLabels.length; i++ ) { - Matrix[] matrices = new Matrix[numModeTables*numberOfVotCategories]; - String[] tripTableNames = new String[numModeTables*numberOfVotCategories]; + Matrix[] matrices = new Matrix[numModeTables]; + String[] tripTableNames = new String[numModeTables]; if ( separateCavFiles ) { - matrices = new Matrix[numModeTables*numberOfVotCategories*2]; - tripTableNames = new String[numModeTables*numberOfVotCategories*2]; + matrices = new Matrix[numModeTables*2]; + tripTableNames = new String[numModeTables*2]; } - if ( numberOfVotCategories > 1 ) { - - // if separateCavFiles, write empty table after mode tables - if ( separateCavFiles ) { - for ( int j=0; j < numModeTables-1; j++ ) { - for (int v = 0; v