Skip to content

Commit

Permalink
corrected bug in reporting distances to carStream file.
Browse files Browse the repository at this point in the history
  • Loading branch information
jim committed Dec 11, 2020
1 parent 5bc917b commit 133b0c2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'java'

jar {
baseName = 'carTracker'
version = '10Dec2020_v1.11'
version = '11Dec2020_v1.12'
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/appLayer/CarAllocatorMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public static void main( String[] args ) {

CarAllocatorMain mainObj = new CarAllocatorMain();

System.out.println ( "CarTracker, 10Dec2020, v1.11, starting." );
System.out.println ( "CarTracker, 11Dec2020, v1.12, starting." );

ResourceBundle rb = null;
if ( args.length >=0 ) {
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/appLayer/WriteCarAllocationOutputFilesMag.java
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,8 @@ record = hh.getId()+","+
destHome = nextTrip.getOrigAct() == PurposeCategories.HOME.getIndex() ? 1 : 0;
origHome = trip.getDestAct() == PurposeCategories.HOME.getIndex() ? 1 : 0;
if(((SikForTrip[k]>threhsoldRoundUp & trip.getPnum() != nextTrip.getPnum())||GikForTrip[k]>threhsoldRoundUp) && destTaz != nextOrigTaz){ // no need to write intra-zonal car reposition trip
autoRecordDistance = sharedDistanceObject.getOffpeakDistanceFromTaz(origTaz)[geogManager.getMazTazValue(nextTrip.getOrigMaz())];
autoRecordDistance = sharedDistanceObject.getOffpeakDistanceFromTaz(geogManager.getMazTazValue(trip.getDestMaz()))[geogManager.getMazTazValue(nextTrip.getOrigMaz())];
//autoRecordDistance = sharedDistanceObject.getOffpeakDistanceFromTaz(origTaz)[geogManager.getMazTazValue(nextTrip.getOrigMaz())];
float departureTime = (scheduleDepart + trip.getSchedTime() + depLate - depEarly) ;
float arrivalTime = (scheduleDepart + trip.getSchedTime() + depLate - depEarly)+ Float.parseFloat(propertyMap.get("minutes.per.mile"))*autoRecordDistance;
if(SikForTrip[k]>threhsoldRoundUp){
Expand All @@ -515,8 +516,10 @@ record = hh.getId()+","+
departureTime = (nextTrip.getSchedDepart() + depLateNext - depEarlyNext) - Float.parseFloat(propertyMap.get("minutes.per.mile"))*autoRecordDistance;
arrivalTime = (nextTrip.getSchedDepart() + depLateNext - depEarlyNext);
}
tripDistanceFromHome = distanceFromHome[nextOrigTaz];
tripDistanceFromHomeToOrig = distanceFromHome[destTaz];
tripDistanceFromHome = distanceFromHome[geogManager.getMazTazValue(nextTrip.getOrigMaz())];
tripDistanceFromHomeToOrig = distanceFromHome[geogManager.getMazTazValue(trip.getDestMaz())];
//tripDistanceFromHome = distanceFromHome[nextOrigTaz];
//tripDistanceFromHomeToOrig = distanceFromHome[destTaz];
record = hh.getId()+","+
(j+1)+","+
ifAvHh+","+
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/appLayer/WriteCarAllocationOutputFilesOhio.java
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,8 @@ record = hh.getId()+","+
destHome = nextTrip.getOrigAct() == PurposeCategories.HOME.getIndex() ? 1 : 0;
origHome = trip.getDestAct() == PurposeCategories.HOME.getIndex() ? 1 : 0;
if(((SikForTrip[k]>threhsoldRoundUp & trip.getPnum() != nextTrip.getPnum())||GikForTrip[k]>threhsoldRoundUp) && destTaz != nextOrigTaz){ // no need to write intra-zonal car reposition trip
autoRecordDistance = sharedDistanceObject.getOffpeakDistanceFromTaz(origTaz)[geogManager.getMazTazValue(nextTrip.getOrigMaz())];
autoRecordDistance = sharedDistanceObject.getOffpeakDistanceFromTaz(geogManager.getMazTazValue(trip.getDestMaz()))[geogManager.getMazTazValue(nextTrip.getOrigMaz())];
//autoRecordDistance = sharedDistanceObject.getOffpeakDistanceFromTaz(origTaz)[geogManager.getMazTazValue(nextTrip.getOrigMaz())];
float departureTime = (scheduleDepart + trip.getSchedTime() + depLate - depEarly) ;
float arrivalTime = (scheduleDepart + trip.getSchedTime() + depLate - depEarly)+ Float.parseFloat(propertyMap.get("minutes.per.mile"))*autoRecordDistance;
if(SikForTrip[k]>threhsoldRoundUp){
Expand All @@ -572,8 +573,10 @@ record = hh.getId()+","+
departureTime = (nextTrip.getSchedDepart() + depLateNext - depEarlyNext) - Float.parseFloat(propertyMap.get("minutes.per.mile"))*autoRecordDistance;
arrivalTime = (nextTrip.getSchedDepart() + depLateNext - depEarlyNext);
}
tripDistanceFromHome = distanceFromHome[nextOrigTaz];
tripDistanceFromHomeToOrig = distanceFromHome[destTaz];
tripDistanceFromHome = distanceFromHome[geogManager.getMazTazValue(nextTrip.getOrigMaz())];
tripDistanceFromHomeToOrig = distanceFromHome[geogManager.getMazTazValue(trip.getDestMaz())];
//tripDistanceFromHome = distanceFromHome[nextOrigTaz];
//tripDistanceFromHomeToOrig = distanceFromHome[destTaz];
record = hh.getId()+","+
(j+1)+","+
ifAvHh+","+
Expand Down

0 comments on commit 133b0c2

Please sign in to comment.