msmobility / mito

Microscopic Transportation Orchestrator
7 stars 13 forks source link

Travel Time Budget for HBW and HBE trips are not calculated properly #8

Closed nkuehnel closed 7 years ago

nkuehnel commented 7 years ago

[from Intellij todo as of latest version of TravelTimeBudget on github

// work and school trips are given by work place and school place locations, no budget to be calculated // todo: sum up work and school trips of all household members to calculate those travel budgets

see:

private void calculateTravelTimeBudget() {
        // main method to calculate the travel time budget for every household
        logger.info("  Started microscopic travel time budget calculation.");
        // loop over every household and calculate travel time budget by purpose
        for (MitoHousehold household : dataSet.getHouseholds().values()) {

            double totalTravelTimeBudget = totalTravelTimeCalc.calculateTTB(household, totalTtbAvail);
            calculateDiscretionaryPurposeBudgets(household);

            // work and school trips are given by work place and school place locations, no budget to be calculated
            // todo: sum up work and school trips of all household members to calculate those travel budgets
            for (MitoPerson person : household.getPersons()) {
                if (person.getOccupation() == 1) {
                    household.setTravelTimeBudgetByPurpose(Purpose.HBW, dataSet.getAutoTravelTimes().getTravelTimeFromTo(household.getHomeZone(), person.getWorkzone()));
                }
            }
            adjustDiscretionaryPurposeBudget(household, totalTravelTimeBudget);
        }
        logger.info("  Finished microscopic travel time budget calculation.");
    }