alpha = 0.602 gamma = 0.101 c = 1.419123356 a = 4.83338664027225 A = 30.0 C = 0 # added as an experiment - to control the behaviour of ck - (0 = no impact) # Order : In-vehicle time, Access time, Egress time, Transfer Walk time, Origin wait time, Transfer wait time ##Applicable to mumford1 InvehicleTime, Origin Wait Time, Transfer Wait time initial_guess = [ 5.0, 5.0, 5.0 ] # [2.0, 2.8, 3.0, 1.0, 1.5, 2.0] # far [5.0, 5.0, 5.0, 5.0, 5.0, 5.0] initial_cost = sg.runAssignmentCalculateErrorRMSN( Visum, initial_guess, obsStopPoints=observedStopPointDf, obsLineRoutes=observedRouteListDf) initial_cost = sg.runAssignmentCalculateErrorRMSN( Visum, initial_guess, obsStopPoints=observedStopPointDf, obsLineRoutes=observedRouteListDf) print initial_guess, initial_cost plot_dict = OrderedDict() plot_dict = {0: [initial_cost, initial_guess]} u = np.copy(initial_guess)
# print df_rmsn.head(10) - values are assigned correctly # Save simulated rmsn values to the dataframe estimateList = [1.0, 2.0, 2.0, 1.5, 2.0, 3.0] for estimate in range(len(estimateList)): estimates = copy.copy(estimateList) # print estimates for i in range(len(parameterValueList)): # print i estimates[estimate] = parameterValueList[i] print estimates rmsnValue = sg.runAssignmentCalculateErrorRMSN(Visum, estimates, obsStopPoints=observedStopPointDf, obsLineRoutes=observedRouteListDf) df_rmsn.at[i, df_rmsn_columns[estimate + 1]] = rmsnValue df_rmsn.to_csv( "C:\\Users\\thenuwan.jayasinghe\\OneDrive - tum.de\\Thesis\\1_Coding\\Experiments\\28012020_evaluate_spsa_varients\\results\\sensitivity_network_2_2.csv") # creating subplot titleList = ["In-Vehicle Time", "Access Time", "Egress Time", "Transfer Walk Time", "Origin Wait Time", "Transfer Wait Time"] df_rmsn_para = df_rmsn[['inVeh', 'access', 'egress', 'traWalk', 'oriWait', 'traWait']] fig, axes = plt.subplots(nrows=2, ncols=3) xlim = (0, 10) ylim = (0, 15) fig.suptitle('Sensitivity Analysis of the parameters')
max_iterations = 300 alpha = 0.602 gamma = 0.101 c = 0.6 a = 3.7 A = 30.0 C = 0 # added as an experiment - to control the behaviour of ck - (0 = no impact) # Order : In-vehicle time, Access time, Egress time, Walk time, Origin wait time, Transfer wait time initial_guess = [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] # [2.0, 2.8, 3.0, 1.0, 1.5, 2.0] # far [5.0, 5.0, 5.0, 5.0, 5.0, 5.0] #exact [1.0, 2.0, 2.0, 1.5, 2.0, 3.0] initial_cost = sg.runAssignmentCalculateErrorRMSN(Visum, initial_guess, observedStopPointDf, observedTransferWalkTimeDf) print initial_guess, initial_cost plot_dict = OrderedDict() plot_dict = {0: [initial_cost, initial_guess]} u = np.copy(initial_guess) # measure time - start t_start = timeit.default_timer() for k in range(max_iterations): ak = a / ((A + k + 1)**alpha) ck = c / ((C + k + 1)**gamma)
plot_dict = OrderedDict() parameterValueList = np.arange(0.0, 9.9, 0.1) print type(parameterValueList) # Order : In-vehicle time, Access time, Egress time, Walk time, Origin wait time, Transfer wait time estimateList = [1.0, 2.0, 2.0, 1.5, 2.0, 3.0] titleList = ["In-Vehicle Time", "Access Time", "Egress Time", "Transfer Walk Time", "Origin Wait Time", "Transfer Wait Time"] for i in range(len(parameterValueList)): # print i estimateList[5] = parameterValueList[i] print estimateList rmsnValue = sg.runAssignmentCalculateErrorRMSN(Visum, estimateList, observedStopPointDf, observedTransferWalkTimeDf) plot_dict[i] = rmsnValue # creation of the plot coefficient_values = parameterValueList.tolist() rmsn_values = [] for key, value in plot_dict.items(): rmsn_values.append(value) # customize the grid fig, ax = plt.subplots() plt.plot(coefficient_values, rmsn_values)