Scaffold FG
Scaffold FG
#Land use and travel time datasets are available in this workscape
import pandas as pd
import numpy as np
import geopandas as gpd
import os
import matplotlib.pyplot as plt
## Creating a mean travel time matrix from the available data for all possible
origin-destination pairs:
# Merging the information together with mean travel time matrix to check for
reliability:
TT_check= pd.merge(TT_mean1, TT_count, on=['Origin Code','Destination Code'])
# Combing the travel time and land use data for baseline scenario:
TL_ij = pd.merge(TT_mean1,landuse,left_on='Destination
Code',right_on='SA2_CODE',how='left')
TL_ij
## Getting the job accessibility for Sydney CBD in the baseline scenario:
# Filtering the land use and transport data relevant for Sydney CBD scenario:
SydTL1_ij = TL_ij[(TL_ij['Origin Code'].isin(Sydlist)) & (TL_ij['Destination
Code'].isin(Sydlist))].reset_index(drop=True)
# Calculating the weights for each job accessibility for Sydney CBD in baseline
scenario:
SydJA1['Weighted Access'] = SydJA1['Population']*SydJA1['Wachs']/Syd1_P
SydJA1
# Calculating the weights for each job accessibility for Parramatta in baseline
scenario:
ParJA1['Weighted Access'] = ParJA1['Population']*ParJA1['Wachs']/Par1_P
ParJA1
# Filtering the land use and transport data relevant for Liverpool scenario:
LivTL1_ij = TL_ij[(TL_ij['Origin Code'].isin(Livlist)) & (TL_ij['Destination
Code'].isin(Livlist))].reset_index(drop=True)
# Calculating the weights for each job accessibility for Liverpool in baseline
scenario:
LivJA1['Weighted Access'] = LivJA1['Population']*LivJA1['Wachs']/Liv1_P
LivJA1
# Applying job shifts where the central region will be skipped in the shift:
for idx in range(len(df_copy)):
if idx == central_index:
continue
# If shift is in percentage:
if is_percentage:
shift_amount = (shift_amount / 100) * current_jobs
# Ensuring the shift amount does not exceed the number of jobs:
shift_amount = min(shift_amount, current_jobs)
## Getting the land use data for Sydney CBD in the centralised scenario:
# Getting the current job and population distribution for Sydney CBD:
SydJPdf = Syddf.merge(landuse[['SA2_CODE', 'Population', 'Jobs']],
left_on='Periphery Code', right_on='SA2_CODE', how='left')
SydJPdf = SydJPdf.drop(columns=['Centre Code','Centre Name','SA2_CODE'])
SydJPdf
## Getting the travel time data for Sydney CBD in the centralised scenario:
# Merging the travel time data with the new job distribution
SydTL2_ij = SydTL1_ij.merge(Sydcendf[['Periphery Code', 'New Jobs Cen']],
left_on='Destination Code', right_on='Periphery Code', how='left')
# Calculating the weights for each job accessibility for Sydney CBD in centralised
scenario:
SydJA2['Weighted Access'] = SydJA2['Population']*SydJA2['Wachs Cen']/Syd1_P
SydJA2
## Getting the land use data for Parramatta in the centralised scenario:
ParJPdf
## Getting the travel time data for Parramatta in the centralised scenario:
# Merging the travel time data with the new job distribution
ParTL2_ij = ParTL1_ij.merge(Parcendf[['Periphery Code', 'New Jobs Cen']],
left_on='Destination Code', right_on='Periphery Code', how='left')
# Calculating the weights for each job accessibility for Parramatta in centralised
scenario:
ParJA2['Weighted Access'] = ParJA2['Population']*ParJA2['Wachs Cen']/Par1_P
ParJA2
## Getting the land use data for Liverpool in the centralised scenario:
LivJPdf
# Defining job shift amounts in absolute amount for peripheries:
shift_amounts = [400, 9000, 3000, 100, 0, 0]
## Getting the travel time data for Liverpool in the centralised scenario:
# Merging the travel time data with the new job distribution
LivTL2_ij = LivTL1_ij.merge(Livcendf[['Periphery Code', 'New Jobs Cen']],
left_on='Destination Code', right_on='Periphery Code', how='left')
# Calculating the weights for each job accessibility for Liverpool in centralised
scenario:
LivJA2['Weighted Access'] = LivJA2['Population']*LivJA2['Wachs Cen']/Liv1_P
LivJA2
# Summing the weighted accessibilities:
Liv2_PWA = LivJA2['Weighted Access'].sum()
Liv2_PWA
## Getting the travel time data for Sydney CBD in the decentralised scenario:
# Merging the travel time data with the new job distribution
SydTL3_ij = SydTL1_ij.merge(Syddendf[['Periphery Code', 'New Jobs DCen']],
left_on='Destination Code', right_on='Periphery Code', how='left')
## Getting the travel time data for Parramatta in the decentralised scenario:
# Merging the travel time data with the new job distribution
ParTL3_ij = ParTL1_ij.merge(Pardendf[['Periphery Code', 'New Jobs DCen']],
left_on='Destination Code', right_on='Periphery Code', how='left')
## Getting the travel time data for Liverpool in the decentralised scenario:
# Merging the travel time data with the new job distribution
LivTL3_ij = LivTL1_ij.merge(Livdendf[['Periphery Code', 'New Jobs DCen']],
left_on='Destination Code', right_on='Periphery Code', how='left')
# Calculating the weights for each job accessibility for Liverpool in decentralised
scenario:
LivJA3['Weighted Access'] = LivJA3['Population']*LivJA3['Wachs DCen']/Liv1_P
LivJA3