Exemplo n.º 1
0
objective_function_1 = 'pax_trips_unlinked_0_rmsn'
objective_function_2 = 'pass_trans_total_combined_rmsn'

objective_function_list = [objective_function_1, objective_function_2]

objective_function_count = {objective_function_1: 0, objective_function_2: 0}

# initial guesses

initial_guess = [
    2.0, 2.0, 2.0, 5.0
]  # [in_vehicle=1, transfer_walk, origin_wait, transfer_wait, transfer_penalty]
initial_cost_dict = sgs.runAssignmentCalculateErrorRMSN_all_error_terms(
    Visum=Visum,
    estimateList=initial_guess,
    obs_stops_df=observed_stop_df,
    obs_line_routes=observed_line_route_df)
initial_cost = initial_cost_dict[objective_function_1]
results_all_df = results_all_df.append(
    sgs.parse_error_from_dict_to_df(simulated_error_dict=initial_cost_dict,
                                    current_estimate=initial_guess,
                                    objective_function=objective_function_1))

results_dict = {0: [initial_cost, initial_guess]}

current_estimate = np.copy(initial_guess)

best_rmsn = np.copy(initial_cost)

np.random.seed(55)
Exemplo n.º 2
0
    4.0, 4.2, 4.4, 4.6, 4.8, 5.0, 5.2, 5.4, 5.6, 5.8, 6.0
]
#coefficient_list = [2.0]
#estimate_list = [0.001, 0.001, 0.001, 0.001, 0.001]
estimate_list = [1, 1, 1, 1, 1]

for estimate in range(len(estimate_list)):
    estimates = copy.copy(estimate_list)

    for i in range(len(coefficient_list)):
        temp_dict = {}
        estimates[estimate] = coefficient_list[i]
        print estimates
        error_dict = sgs.runAssignmentCalculateErrorRMSN_all_error_terms(
            Visum=Visum,
            estimateList=estimates,
            obs_stops_df=observed_stop_point_df,
            obs_line_routes=observed_line_route_df)

        temp_dict['in_veh'] = estimates[0]
        temp_dict['transfer_walk'] = estimates[1]
        temp_dict['origin_wait'] = estimates[2]
        temp_dict['transfer_wait'] = estimates[3]
        temp_dict['transfer_penalty'] = estimates[4]

        temp_dict['pax_trans_total_rmsn'] = error_dict['pax_trans_total_rmsn']
        temp_dict['pax_trans_walkb_rmsn'] = error_dict['pax_trans_walkb_rmsn']
        temp_dict['pax_trans_alightw_rmsn'] = error_dict[
            'pax_trans_alightw_rmsn']
        temp_dict['pass_trans_dir_rmsn'] = error_dict['pass_trans_dir_rmsn']
        temp_dict['pass_trans_total_combined_rmsn'] = error_dict[