Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add zone information to Segments

  • Loading branch information...
commit 46cc26fb1b6e5300b4520dfcd0e5ede6de3b94fa 1 parent 53e8b83
@snktagarwal authored
Showing with 55 additions and 29 deletions.
  1. +55 −29 delay_profile/Segments.py
View
84 delay_profile/Segments.py
@@ -9,12 +9,12 @@
Bangalore_stations = [ 'SBC', 'BNC', 'YPR', 'BNCE' ]
Hyderabad_stations = [ 'HYB', 'SC', 'KCG', 'BMT' ]
-## This file lists all the imp segments, with in b/w stations
+## This file lists all the imp segments, with in b/w stations
################### Northern Belt #####################
-# Amritsar(ASR) - Ambala(UMB)
+# Amritsar(ASR) - Ambala(UMB)
asr_umb = ['ASR','JRC','JUC','LDH','UMB']
#Ambala(UMB) - Panipat - Delhi
@@ -27,6 +27,9 @@
# Delhi- Jaipur(JP)
delhi_jp = ['DELHI','RE','AWR','JP']
+# Belt info
+north_belt = [ asr_umb, umb_delhi, umb_mb, delhi_jp ]
+
################## Eastern & Gangetic Belt #####################
@@ -43,7 +46,7 @@
# Delhi- Moradabad(MB)
delhi_mb= ['DELHI','MB']
-# Moradabad(MB)- Lucknow(LKO)
+# Moradabad(MB)- Lucknow(LKO)
mb_lko= ['MB','LKO']
# Kanpur(CNB)- Allahabad(ALD)
@@ -65,13 +68,9 @@
# Mugalsarai(MGS)- Ara - Danapur - Patna(PNBE)
mgs_pnbe= ['MGS','ARA','PNBE']
-# Sonpur(SEE)- Hajipur- Barauni- Katihar(KIR)
+# Sonpur(SEE)- Hajipur- Barauni- Katihar(KIR)
see_kir= ['SEE','HJP','BJU','KIR']
-#see_kir1= ['SEE','BJU']
-#see_kir2 see-kir only 13, bju-kir: 42, hjp-kir: 17, see-hjp: 69, see-hjp-bju: 75,
-#see_kir3
-
# Mugalsarai(MGS)- Gaya(GAYA)
mgs_gaya= ['MGS','DOS','GAYA']
@@ -93,6 +92,11 @@
# New Jalpaiguri - New Cooch Behar - New Bongaigon - Guwahati
njp_guwahati = ['NJP', 'NCB', 'NBQ', 'GHY']
+# Belt info
+igp_belt = [delhi_agc, delhi_cnb, delhi_mb, cnb_ald, cnb_lko, ald_mgs, \
+ lko_bsb, mb_lko, bsb_see, mgs_pnbe, see_kir, mgs_gaya, \
+ gaya_dhn, garwa_gomoh, pnbe_asn, dhanbad_kolkata, kolkata_mldt, njp_guwahati]
+
################# Western Belt #######################
#Jaipur(JP)- Ajmer(AII)- Marwar(MJ)
@@ -102,8 +106,8 @@
mj_adi= ['MJ','ABR','ADI']
# Ahmedabad(ADI)- Anand(ANND) -Vadodara(BRC)- Surat (ST)
-#adi_surat = ['ADI','ANND','BRC', 'ST']
-adi_surat = ['ADI','BRC', 'ST']
+#adi_surat = ['ADI','ANND','BRC', 'ST']
+adi_surat = ['ADI','BRC', 'ST']
# Ahmedabad(ADI) - Vadodara(BRC)
#adi_brc = ['ADI', 'BRC' ]
@@ -111,20 +115,22 @@
# Vadodara (BRC) - Surat (ST)
#brc_surat = ['BRC', 'ST']
-# Bhusaval(BSL)- Manmad - Kalyan
+# Bhusaval(BSL)- Manmad - Kalyan
bsl_kalyan = ['BSL','MMR','KYN' ]
# Surat- Mumbai(CSTM/BCT)
st_mumbai = ['ST','MUMBAI']
-# Mumbai-Pune(PUNE)
+# Mumbai-Pune(PUNE)
mumbai_pune = ['MUMBAI','PUNE']
# KOTA(KOTA)- Ratlam(RTM)- Vadodara(BRC)
-kota_brc= ['KOTA','RTM','BRC']
+kota_brc= ['KOTA','RTM','BRC']
# Agra(AF/AGC)- KOTA(KOTA)
+# Belt info
+west_belt = [jp_mj, mj_adi, adi_surat, bsl_kalyan, st_mumbai, mumbai_pune, kota_brc]
##################### South-eastern Belt ################
@@ -141,49 +147,54 @@
vskp_bza = ['VSKP', 'RJY', 'BZA']
# Vijaywada(BZA) - Guntur - Chennai(MAS/MS)
-bza_chennai = ['BZA', 'GNT', 'CHENNAI']
+bza_chennai = ['BZA', 'GNT', 'CHENNAI']
+
+# Belt info
+se_belt = [kolkata_kgp, kgp_bbs, bbs_vskp, vskp_bza, bza_chennai]
##################### Central Belt #################
-# Agra(AF/AGC)- Gwalior(GWL) - Jhansi(JHS)
+# Agra(AF/AGC)- Gwalior(GWL) - Jhansi(JHS)
agc_jhs= ['AGC','GWL','JHS']
-# Jhansi(JHS)- Bina - Bhopal(BPL)
+# Jhansi(JHS)- Bina - Bhopal(BPL)
jhs_bpl= ['JHS','BINA','BPL']
-# Bina - Katni(KTE)
+# Bina - Katni(KTE)
bina_kte= ['BINA','KTE']
-# Ujjain-Bhopal(BPL)- Itarsi(ET)
+# Ujjain-Bhopal(BPL)- Itarsi(ET)
ujn_et= ['UJN', 'BPL', 'ET']
-# Katni(KTE)- Jabalpur(JBP)- Itarsi(ET)
+# Katni(KTE)- Jabalpur(JBP)- Itarsi(ET)
kte_et= ['KTE','JBP','ET']
-# Itarsi(ET)- Bhusaval(BSL)
+# Itarsi(ET)- Bhusaval(BSL)
et_bsl= ['ET','BSL']
-# Itarsi(ET)- Amla(AMLA) - Nagpur(NGP)
+# Itarsi(ET)- Amla(AMLA) - Nagpur(NGP)
et_ngp= ['ET','AMLA','NGP']
-# Wardha - Kazipet - Secunderabad(SC) - Hyderabad(HYB)
+# Wardha - Kazipet - Secunderabad(SC) - Hyderabad(HYB)
wardha_hydbad= ['WR', 'KZJ', 'HYDBAD']
-# Katni(KTE)- Bilaspur(BSP) - Raipur(R)
+# Katni(KTE)- Bilaspur(BSP) - Raipur(R)
kte_r= ['KTE','BSP','R']
# Bilaspur - Rourkela
bilaspur_rourkela = [ 'BSP', 'ROU' ]
-# Raipur(R) - Titlagarh - Vizianagram - Vishakhapatnam(VSKP)
+# Raipur(R) - Titlagarh - Vizianagram - Vishakhapatnam(VSKP)
r_vskp= ['R', 'TIG', 'VZM', 'VSKP']
# Bhusaval(BSL)-Wardha-Nagpur(NGP)
bsl_ngp= ['BSL', 'WR', 'NGP']
-
+# Belt info
+central_belt = [ agc_jhs, jhs_bpl, bina_kte, ujn_et, kte_et, et_bsl, et_ngp, \
+ wardha_hydbad, kte_r, bilaspur_rourkela, r_vskp, bsl_ngp]
##################### Southern Belt #################
@@ -191,13 +202,13 @@
# Pune(PUNE) - Solapur(SUR) - Wadi(WADI) - Secunderabad/Hyderabad(HYB)
pune_hydbad = ['PUNE','SUR','WADI','HYDBAD']
-# Wadi(WADI)- Guntakal(GTL) - Bangalore(SBC/BNC)
+# Wadi(WADI)- Guntakal(GTL) - Bangalore(SBC/BNC)
wadi_blore = ['WADI','GTL','BLORE']
-# Mumbai- RATNAGIRI(RN)-MADGAON(MAO)
+# Mumbai- RATNAGIRI(RN)-MADGAON(MAO)
mumbai_mao= ['MUMBAI','RN','MAO']
-# MADGAON(MAO)- MANGALORE(MAQ)
+# MADGAON(MAO)- MANGALORE(MAQ)
mao_maq= ['MAO','MAQ']
# MANGALORE(MAQ)-Cannanore-Calicut(CLT)-Ernakulum(ERS)
@@ -212,13 +223,28 @@
# Coimbatore - Salem - Chennai
coimbatore_chennai = [ 'CBE', 'SA', 'CHENNAI' ]
+# Belt info
+south_belt = [pune_hydbad, wadi_blore, mumbai_mao, mao_maq, maq_ers, \
+ ers_tvc, gtl_chennai, coimbatore_chennai]
+
###############################################
# list containing all the above mentioned route segments
all_segments = [ asr_umb, umb_delhi, umb_mb, delhi_jp, delhi_agc, delhi_cnb, delhi_mb, mb_lko, cnb_ald, ald_mgs, cnb_lko, lko_bsb, bsb_see, mgs_pnbe, see_kir, mgs_gaya, gaya_dhn, garwa_gomoh, pnbe_asn, dhanbad_kolkata, kolkata_mldt, njp_guwahati, jp_mj, mj_adi, adi_surat, bsl_kalyan, st_mumbai, kota_brc, kolkata_kgp, kgp_bbs, bbs_vskp, vskp_bza, bza_chennai, agc_jhs, jhs_bpl, bina_kte, ujn_et, kte_et, et_bsl, et_ngp, wardha_hydbad, kte_r, bilaspur_rourkela, r_vskp, bsl_ngp, mumbai_pune, pune_hydbad, wadi_blore, mumbai_mao, mao_maq, maq_ers, ers_tvc, gtl_chennai, coimbatore_chennai ]
+if __name__=='__main__':
+
+ # Check if the belts have been defined for all segments
-segments_with_max_traffic = [asr_umb, umb_delhi, delhi_cnb, delhi_agc, cnb_ald, ald_mgs, mgs_pnbe, see_kir, dhanbad_kolkata, adi_surat, bsl_kalyan, st_mumbai, kolkata_kgp, vskp_bza, agc_jhs, jhs_bpl, kte_et, et_bsl, wardha_hydbad, bza_chennai, lko_bsb, ujn_et ]
+ print len(all_segments)
+ for s in all_segments:
+ print s
+ if s in north_belt: print 'North'
+ if s in igp_belt: print 'IGP'
+ if s in west_belt: print 'WEST'
+ if s in se_belt: print 'SE BELT'
+ if s in central_belt: print 'CENTRAL'
+ if s in south_belt: print 'SOUTH'
Please sign in to comment.
Something went wrong with that request. Please try again.