Commit 6306c9fd authored by O.V.B Sewmina's avatar O.V.B Sewmina

Merge branch 'IT19179568' into 'master'

final merge

See merge request 2022-020/2022-020!41
parents a63b406d 0e0508f7
Dipature,Arrival,Time
Dehiwala,Fort ,25min
Dehiwala,wellawatte,5min
Dehiwala,bambalapitiya,9min
Dehiwala,kollupitiya,13min
Dehiwala,kompannavidiya,16min
wellawatte,bambalapitiya,4min
wellawatte,kollupitiya,8min
wellawatte,kompannavidiya,11min
wellawatte,Fort ,13min
bambalapitiya,kollupitiya,4min
bambalapitiya,kompannavidiya,7min
bambalapitiya,Fort ,9min
kollupitiya,kompannavidiya,3min
kollupitiya,Fort ,5min
kompannavidiya,Fort ,3min
Dehiwala,Fort ,25min
Dehiwala,wellawatte,5min
Dehiwala,bambalapitiya,9min
Dehiwala,kollupitiya,13min
Dehiwala,kompannavidiya,16min
wellawatte,bambalapitiya,4min
wellawatte,kollupitiya,8min
wellawatte,kompannavidiya,11min
wellawatte,Fort ,13min
bambalapitiya,kollupitiya,4min
bambalapitiya,kompannavidiya,7min
bambalapitiya,Fort ,9min
kollupitiya,kompannavidiya,3min
kollupitiya,Fort ,5min
kompannavidiya,Fort ,3min
Dehiwala,Fort ,25min
Dehiwala,wellawatte,5min
Dehiwala,bambalapitiya,9min
Dehiwala,kollupitiya,13min
Dehiwala,kompannavidiya,16min
wellawatte,bambalapitiya,4min
wellawatte,kollupitiya,8min
wellawatte,kompannavidiya,11min
wellawatte,Fort ,13min
bambalapitiya,kollupitiya,4min
bambalapitiya,kompannavidiya,7min
bambalapitiya,Fort ,9min
kollupitiya,kompannavidiya,3min
kollupitiya,Fort ,5min
kompannavidiya,Fort ,3min
Dehiwala,Fort ,25min
Dehiwala,wellawatte,5min
Dehiwala,bambalapitiya,9min
Dehiwala,kollupitiya,13min
Dehiwala,kompannavidiya,16min
wellawatte,bambalapitiya,4min
wellawatte,kollupitiya,8min
wellawatte,kompannavidiya,11min
wellawatte,Fort ,13min
bambalapitiya,kollupitiya,4min
bambalapitiya,kompannavidiya,7min
bambalapitiya,Fort ,9min
kollupitiya,kompannavidiya,3min
kollupitiya,Fort ,5min
kompannavidiya,Fort ,3min
Dehiwala,Fort ,25min
Dehiwala,wellawatte,5min
Dehiwala,bambalapitiya,9min
Dehiwala,kollupitiya,13min
Dehiwala,kompannavidiya,16min
wellawatte,bambalapitiya,4min
wellawatte,kollupitiya,8min
wellawatte,kompannavidiya,11min
wellawatte,Fort ,13min
bambalapitiya,kollupitiya,4min
bambalapitiya,kompannavidiya,7min
bambalapitiya,Fort ,9min
kollupitiya,kompannavidiya,3min
kollupitiya,Fort ,5min
kompannavidiya,Fort ,3min
Dehiwala,Fort ,25min
Dehiwala,wellawatte,5min
Dehiwala,bambalapitiya,9min
Dehiwala,kollupitiya,13min
Dehiwala,kompannavidiya,16min
wellawatte,bambalapitiya,4min
wellawatte,kollupitiya,8min
wellawatte,kompannavidiya,11min
wellawatte,Fort ,13min
bambalapitiya,kollupitiya,4min
bambalapitiya,kompannavidiya,7min
bambalapitiya,Fort ,9min
kollupitiya,kompannavidiya,3min
kollupitiya,Fort ,5min
kompannavidiya,Fort ,3min
Dehiwala,Fort ,25min
Dehiwala,wellawatte,5min
Dehiwala,bambalapitiya,9min
Dehiwala,kollupitiya,13min
Dehiwala,kompannavidiya,16min
wellawatte,bambalapitiya,4min
wellawatte,kollupitiya,8min
wellawatte,kompannavidiya,11min
wellawatte,Fort ,13min
bambalapitiya,kollupitiya,4min
bambalapitiya,kompannavidiya,7min
bambalapitiya,Fort ,9min
kollupitiya,kompannavidiya,3min
kollupitiya,Fort ,5min
kompannavidiya,Fort ,3min
Dehiwala,Fort ,25min
Dehiwala,wellawatte,5min
Dehiwala,bambalapitiya,9min
Dehiwala,kollupitiya,13min
Dehiwala,kompannavidiya,16min
wellawatte,bambalapitiya,4min
wellawatte,kollupitiya,8min
wellawatte,kompannavidiya,11min
wellawatte,Fort ,13min
bambalapitiya,kollupitiya,4min
bambalapitiya,kompannavidiya,7min
bambalapitiya,Fort ,9min
kollupitiya,kompannavidiya,3min
kollupitiya,Fort ,5min
kompannavidiya,Fort ,3min
Dehiwala,Fort ,25min
Dehiwala,wellawatte,5min
Dehiwala,bambalapitiya,9min
Dehiwala,kollupitiya,13min
Dehiwala,kompannavidiya,16min
wellawatte,bambalapitiya,4min
wellawatte,kollupitiya,8min
wellawatte,kompannavidiya,11min
wellawatte,Fort ,13min
bambalapitiya,kollupitiya,4min
bambalapitiya,kompannavidiya,7min
bambalapitiya,Fort ,9min
kollupitiya,kompannavidiya,3min
kollupitiya,Fort ,5min
kompannavidiya,Fort ,3min
Dehiwala,Fort ,25min
Dehiwala,wellawatte,5min
Dehiwala,bambalapitiya,9min
Dehiwala,kollupitiya,13min
Dehiwala,kompannavidiya,16min
wellawatte,bambalapitiya,4min
wellawatte,kollupitiya,8min
wellawatte,kompannavidiya,11min
wellawatte,Fort ,13min
bambalapitiya,kollupitiya,4min
bambalapitiya,kompannavidiya,7min
bambalapitiya,Fort ,9min
kollupitiya,kompannavidiya,3min
kollupitiya,Fort ,5min
kompannavidiya,Fort ,3min
Dehiwala 1
wellawatte 2
bambalapitiya 3
kollupitiya 4
kompannavidiya 5
Fort 6
{
"cells": [
{
"cell_type": "code",
"execution_count": 62,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": 63,
"metadata": {},
"outputs": [],
"source": [
"data = pd.read_csv('TrainData.csv')"
]
},
{
"cell_type": "code",
"execution_count": 64,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Dipature</th>\n",
" <th>Arrival</th>\n",
" <th>Time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Dehiwala</td>\n",
" <td>Fort</td>\n",
" <td>25min</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Dehiwala</td>\n",
" <td>wellawatte</td>\n",
" <td>5min</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Dehiwala</td>\n",
" <td>bambalapitiya</td>\n",
" <td>9min</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Dehiwala</td>\n",
" <td>kollupitiya</td>\n",
" <td>13min</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Dehiwala</td>\n",
" <td>kompannavidiya</td>\n",
" <td>16min</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Dipature Arrival Time\n",
"0 Dehiwala Fort 25min\n",
"1 Dehiwala wellawatte 5min\n",
"2 Dehiwala bambalapitiya 9min\n",
"3 Dehiwala kollupitiya 13min\n",
"4 Dehiwala kompannavidiya 16min"
]
},
"execution_count": 64,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.head()"
]
},
{
"cell_type": "code",
"execution_count": 65,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'pandas.core.frame.DataFrame'>\n",
"RangeIndex: 150 entries, 0 to 149\n",
"Data columns (total 3 columns):\n",
" # Column Non-Null Count Dtype \n",
"--- ------ -------------- ----- \n",
" 0 Dipature 150 non-null object\n",
" 1 Arrival 150 non-null object\n",
" 2 Time 150 non-null object\n",
"dtypes: object(3)\n",
"memory usage: 3.6+ KB\n"
]
}
],
"source": [
"data.info()"
]
},
{
"cell_type": "code",
"execution_count": 66,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array(['Dehiwala', 'wellawatte', 'bambalapitiya', 'kollupitiya',\n",
" 'kompannavidiya'], dtype=object)"
]
},
"execution_count": 66,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data['Dipature'].unique()"
]
},
{
"cell_type": "code",
"execution_count": 67,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0 1\n",
"1 1\n",
"2 1\n",
"3 1\n",
"4 1\n",
" ..\n",
"145 3\n",
"146 3\n",
"147 4\n",
"148 4\n",
"149 5\n",
"Name: Dipature, Length: 150, dtype: int64"
]
},
"execution_count": 67,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data['Dipature'].map({'Dehiwala':1,'wellawatte':2,'bambalapitiya':3,'kollupitiya':4,'kompannavidiya':5})"
]
},
{
"cell_type": "code",
"execution_count": 68,
"metadata": {},
"outputs": [],
"source": [
"data['Dipature'] = data['Dipature'].map({'Dehiwala':1,'wellawatte':2,'bambalapitiya':3,'kollupitiya':4,'kompannavidiya':5})"
]
},
{
"cell_type": "code",
"execution_count": 69,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array(['Fort ', 'wellawatte', 'bambalapitiya', 'kollupitiya',\n",
" 'kompannavidiya'], dtype=object)"
]
},
"execution_count": 69,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data['Arrival'].unique()"
]
},
{
"cell_type": "code",
"execution_count": 70,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0 6\n",
"1 2\n",
"2 3\n",
"3 4\n",
"4 5\n",
" ..\n",
"145 5\n",
"146 6\n",
"147 5\n",
"148 6\n",
"149 6\n",
"Name: Arrival, Length: 150, dtype: int64"
]
},
"execution_count": 70,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data['Arrival'].map({'Fort ':6,'wellawatte':2,'bambalapitiya':3,'kollupitiya':4,'kompannavidiya':5})"
]
},
{
"cell_type": "code",
"execution_count": 71,
"metadata": {},
"outputs": [],
"source": [
"data['Arrival'] = data['Arrival'].map({'Fort ':6,'wellawatte':2,'bambalapitiya':3,'kollupitiya':4,'kompannavidiya':5})"
]
},
{
"cell_type": "code",
"execution_count": 72,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Dipature</th>\n",
" <th>Arrival</th>\n",
" <th>Time</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1</td>\n",
" <td>6</td>\n",
" <td>25min</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>5min</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1</td>\n",
" <td>3</td>\n",
" <td>9min</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>1</td>\n",
" <td>4</td>\n",
" <td>13min</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>1</td>\n",
" <td>5</td>\n",
" <td>16min</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Dipature Arrival Time\n",
"0 1 6 25min\n",
"1 1 2 5min\n",
"2 1 3 9min\n",
"3 1 4 13min\n",
"4 1 5 16min"
]
},
"execution_count": 72,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.head()"
]
},
{
"cell_type": "code",
"execution_count": 73,
"metadata": {},
"outputs": [],
"source": [
"X = data.drop(['Time'],axis=1)"
]
},
{
"cell_type": "code",
"execution_count": 74,
"metadata": {},
"outputs": [],
"source": [
"y = data['Time']"
]
},
{
"cell_type": "code",
"execution_count": 75,
"metadata": {},
"outputs": [],
"source": [
"from sklearn.model_selection import train_test_split"
]
},
{
"cell_type": "code",
"execution_count": 76,
"metadata": {},
"outputs": [],
"source": [
"X_train,X_test,y_train,y_test = train_test_split(X,y,test_size=0.2,random_state=42)"
]
},
{
"cell_type": "code",
"execution_count": 77,
"metadata": {},
"outputs": [],
"source": [
"from sklearn.neural_network import MLPClassifier"
]
},
{
"cell_type": "code",
"execution_count": 78,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\Users\\Shiv\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\sklearn\\neural_network\\_multilayer_perceptron.py:702: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.\n",
" warnings.warn(\n"
]
},
{
"data": {
"text/html": [
"<style>#sk-container-id-18 {color: black;background-color: white;}#sk-container-id-18 pre{padding: 0;}#sk-container-id-18 div.sk-toggleable {background-color: white;}#sk-container-id-18 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-18 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-18 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-18 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-18 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-18 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-18 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-18 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-18 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-18 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-18 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-18 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-18 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-18 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-18 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-18 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-18 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-18 div.sk-item {position: relative;z-index: 1;}#sk-container-id-18 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-18 div.sk-item::before, #sk-container-id-18 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-18 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-18 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-18 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-18 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-18 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-18 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-18 div.sk-label-container {text-align: center;}#sk-container-id-18 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-18 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-18\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>MLPClassifier()</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-18\" type=\"checkbox\" checked><label for=\"sk-estimator-id-18\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">MLPClassifier</label><div class=\"sk-toggleable__content\"><pre>MLPClassifier()</pre></div></div></div></div></div>"
],
"text/plain": [
"MLPClassifier()"
]
},
"execution_count": 78,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"NN = MLPClassifier()\n",
"NN.fit(X_train,y_train)"
]
},
{
"cell_type": "code",
"execution_count": 79,
"metadata": {},
"outputs": [],
"source": [
"y_pred1 = NN.predict(X_test)"
]
},
{
"cell_type": "code",
"execution_count": 80,
"metadata": {},
"outputs": [],
"source": [
"df1 = pd.DataFrame({'Actual':y_test, 'NN Results':y_pred1})"
]
},
{
"cell_type": "code",
"execution_count": 81,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Dipature</th>\n",
" <th>Arrival</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Dipature Arrival\n",
"0 1 2"
]
},
"execution_count": 81,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data = {'Dipature':1,\n",
" 'Arrival':2,\n",
" }\n",
"df = pd.DataFrame(data,index=[0])\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 82,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Train Travel Time Prediction :- 5min \n"
]
}
],
"source": [
"predit = NN.predict(df)\n",
"print('Train Travel Time Prediction :- ',*predit,' ')"
]
},
{
"cell_type": "code",
"execution_count": 83,
"metadata": {},
"outputs": [],
"source": [
"def GetTrainPrediction(Dipature,Arrival):\n",
" data = {'Dipature':Dipature,\n",
" 'Arrival':Arrival,\n",
" }\n",
" df = pd.DataFrame(data,index=[0])\n",
" predit = NN.predict(df)\n",
" print('Train Travel Time Prediction :- ',*predit,' ')"
]
},
{
"cell_type": "code",
"execution_count": 84,
"metadata": {},
"outputs": [],
"source": [
"def GetDipatureCode(data):\n",
" if('Dehiwala' == data):\n",
" return 1\n",
" elif('wellawatte' == data):\n",
" return 2\n",
" elif('bambalapitiya' == data):\n",
" return 3\n",
" elif('kollupitiya' == data):\n",
" return 4\n",
" elif('kompannavidiya' == data):\n",
" return 5"
]
},
{
"cell_type": "code",
"execution_count": 85,
"metadata": {},
"outputs": [],
"source": [
"def GetArrivalCode(data):\n",
" if('Fort' == data):\n",
" return 6\n",
" elif('wellawatte' == data):\n",
" return 2\n",
" elif('bambalapitiya' == data):\n",
" return 3\n",
" elif('kollupitiya' == data):\n",
" return 4\n",
" elif('kompannavidiya' == data):\n",
" return 5"
]
},
{
"cell_type": "code",
"execution_count": 86,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Train Travel Time Prediction :- 25min \n"
]
}
],
"source": [
"Dipature = GetDipatureCode('Dehiwala')\n",
"Arrival = GetArrivalCode('Fort')\n",
"\n",
"GetTrainPrediction(Dipature,Arrival)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.10.7 64-bit",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.7"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "5cf8c3d3e58a91b903f819a9c98dd2220f70e367ec47969cb612bf546ce9e823"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
# %%
import pandas as pd
# %%
data = pd.read_csv('TravelTimePrediction\TrainData\TrainData.csv')
# %%
# %%
# %%
# %%
data['Dipature'].map({'Dehiwala':1,'wellawatte':2,'bambalapitiya':3,'kollupitiya':4,'kompannavidiya':5})
# %%
data['Dipature'] = data['Dipature'].map({'Dehiwala':1,'wellawatte':2,'bambalapitiya':3,'kollupitiya':4,'kompannavidiya':5})
# %%
# %%
data['Arrival'].map({'Fort ':6,'wellawatte':2,'bambalapitiya':3,'kollupitiya':4,'kompannavidiya':5})
# %%
data['Arrival'] = data['Arrival'].map({'Fort ':6,'wellawatte':2,'bambalapitiya':3,'kollupitiya':4,'kompannavidiya':5})
# %%
# %%
X = data.drop(['Time'],axis=1)
# %%
y = data['Time']
# %%
from sklearn.model_selection import train_test_split
# %%
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size=0.2,random_state=42)
# %%
from sklearn.neural_network import MLPClassifier
# %%
NN = MLPClassifier()
NN.fit(X_train,y_train)
# %%
y_pred1 = NN.predict(X_test)
# %%
df1 = pd.DataFrame({'Actual':y_test, 'NN Results':y_pred1})
# %%
data = {'Dipature':1,
'Arrival':2,
}
df = pd.DataFrame(data,index=[0])
# %%
predit = NN.predict(df)
# %%
def GetTrainPrediction(Dipature,Arrival):
data = {'Dipature':Dipature,
'Arrival':Arrival,
}
df = pd.DataFrame(data,index=[0])
predit = NN.predict(df)
print('Train Travel Time Prediction :- ',*predit,' ')
# %%
def GetDipatureCode(data):
if('Dehiwala' == data):
return 1
elif('wellawatte' == data):
return 2
elif('bambalapitiya' == data):
return 3
elif('kollupitiya' == data):
return 4
elif('kompannavidiya' == data):
return 5
# %%
def GetArrivalCode(data):
if('Fort' == data):
return 6
elif('wellawatte' == data):
return 2
elif('bambalapitiya' == data):
return 3
elif('kollupitiya' == data):
return 4
elif('kompannavidiya' == data):
return 5
# %%
def GetPrediction(Dvalue,Avalue):
Dipature = GetDipatureCode(Dvalue)
Arrival = GetArrivalCode(Avalue)
GetTrainPrediction(Dipature,Arrival)
GetPrediction('Dehiwala','Fort')
\ No newline at end of file
plugins { plugins {
id 'com.android.application' id 'com.android.application'
id 'com.chaquo.python'
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
id 'com.google.gms.google-services' id 'com.google.gms.google-services'
} }
apply plugin: 'com.android.application'
apply plugin: 'com.chaquo.python'
android { android {
namespace 'com.app.travelle' namespace 'com.app.travelle'
compileSdk 32 compileSdk 32
...@@ -15,7 +23,42 @@ android { ...@@ -15,7 +23,42 @@ android {
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
python{
pip{
install "numpy"
install "pandas"
install "matplotlib"
install "sklearn"
install "matplotlib"
install "scikit-learn"
install "networkx"
install "asyncio"
}
}
ndk {
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
python {
buildPython "C:/Users/Chamod Abeyrathna/AppData/Local/Programs/Python/Python39/python.exe"
}
python {
version "3.8"
}
sourceSets {
main {
setRoot "src/main/"
python.srcDir "src/main/python"
}
}
} }
buildTypes { buildTypes {
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.Travelle" android:theme="@style/Theme.Travelle"
tools:targetApi="31"> tools:targetApi="31">
<!-- <!--
TODO: Before you run your application, you need a Google Maps API key. TODO: Before you run your application, you need a Google Maps API key.
...@@ -30,9 +29,13 @@ ...@@ -30,9 +29,13 @@
project's local.properties file (e.g. MAPS_API_KEY=Aiza...), and replace the project's local.properties file (e.g. MAPS_API_KEY=Aiza...), and replace the
"YOUR_API_KEY" string in this file with "${MAPS_API_KEY}". "YOUR_API_KEY" string in this file with "${MAPS_API_KEY}".
--> -->
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data <meta-data
android:name="com.google.android.geo.API_KEY" android:name="com.google.android.geo.API_KEY"
android:value="YOUR_API_KEY" /> android:value="@string/google_maps_key" />
<activity <activity
android:name=".RetrieveBusMap" android:name=".RetrieveBusMap"
...@@ -78,6 +81,15 @@ ...@@ -78,6 +81,15 @@
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".RouteActivity"
android:exported="false">
<meta-data <meta-data
android:name="android.app.lib_name" android:name="android.app.lib_name"
......
package com.app.travelle;
import com.google.android.gms.maps.model.LatLng;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* Created by Vishal on 10/20/2018.
*/
public class DataParser {
public List<List<HashMap<String, String>>> parse(JSONObject jObject) {
List<List<HashMap<String, String>>> routes = new ArrayList<>();
JSONArray jRoutes;
JSONArray jLegs;
JSONArray jSteps;
try {
jRoutes = jObject.getJSONArray("routes");
/** Traversing all routes */
for (int i = 0; i < jRoutes.length(); i++) {
jLegs = ((JSONObject) jRoutes.get(i)).getJSONArray("legs");
List path = new ArrayList<>();
/** Traversing all legs */
for (int j = 0; j < jLegs.length(); j++) {
jSteps = ((JSONObject) jLegs.get(j)).getJSONArray("steps");
/** Traversing all steps */
for (int k = 0; k < jSteps.length(); k++) {
String polyline = "";
polyline = (String) ((JSONObject) ((JSONObject) jSteps.get(k)).get("polyline")).get("points");
List<LatLng> list = decodePoly(polyline);
/** Traversing all points */
for (int l = 0; l < list.size(); l++) {
HashMap<String, String> hm = new HashMap<>();
hm.put("lat", Double.toString((list.get(l)).latitude));
hm.put("lng", Double.toString((list.get(l)).longitude));
path.add(hm);
}
}
routes.add(path);
}
}
} catch (JSONException e) {
e.printStackTrace();
} catch (Exception e) {
}
return routes;
}
/**
* Method to decode polyline points
* Courtesy : https://jeffreysambells.com/2010/05/27/decoding-polylines-from-google-maps-direction-api-with-java
*/
private List<LatLng> decodePoly(String encoded) {
List<LatLng> poly = new ArrayList<>();
int index = 0, len = encoded.length();
int lat = 0, lng = 0;
while (index < len) {
int b, shift = 0, result = 0;
do {
b = encoded.charAt(index++) - 63;
result |= (b & 0x1f) << shift;
shift += 5;
} while (b >= 0x20);
int dlat = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
lat += dlat;
shift = 0;
result = 0;
do {
b = encoded.charAt(index++) - 63;
result |= (b & 0x1f) << shift;
shift += 5;
} while (b >= 0x20);
int dlng = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
lng += dlng;
LatLng p = new LatLng((((double) lat / 1E5)),
(((double) lng / 1E5)));
poly.add(p);
}
return poly;
}
}
\ No newline at end of file
package com.app.travelle;
import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* Created by Vishal on 10/20/2018.
*/
public class FetchURL extends AsyncTask<String, Void, String> {
Context mContext;
String directionMode = "driving";
public FetchURL(Context mContext) {
this.mContext = mContext;
}
@Override
protected String doInBackground(String... strings) {
// For storing data from web service
String data = "";
directionMode = strings[1];
try {
// Fetching the data from web service
data = downloadUrl(strings[0]);
Log.d("mylog", "Background task data " + data.toString());
} catch (Exception e) {
Log.d("Background Task", e.toString());
}
return data;
}
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
PointsParser parserTask = new PointsParser(mContext, directionMode);
// Invokes the thread for parsing the JSON data
parserTask.execute(s);
}
private String downloadUrl(String strUrl) throws IOException {
String data = "";
InputStream iStream = null;
HttpURLConnection urlConnection = null;
try {
URL url = new URL(strUrl);
// Creating an http connection to communicate with url
urlConnection = (HttpURLConnection) url.openConnection();
// Connecting to url
urlConnection.connect();
// Reading data from url
iStream = urlConnection.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(iStream));
StringBuffer sb = new StringBuffer();
String line = "";
while ((line = br.readLine()) != null) {
sb.append(line);
}
data = sb.toString();
Log.d("mylog", "Downloaded URL: " + data.toString());
br.close();
} catch (Exception e) {
Log.d("mylog", "Exception downloading URL: " + e.toString());
} finally {
iStream.close();
urlConnection.disconnect();
}
return data;
}
}
...@@ -6,12 +6,14 @@ import androidx.core.app.ActivityCompat; ...@@ -6,12 +6,14 @@ import androidx.core.app.ActivityCompat;
import android.Manifest; import android.Manifest;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Color; import android.graphics.Color;
import android.location.Location; import android.location.Location;
import android.os.Bundle; import android.os.Bundle;
import android.text.Editable;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.view.WindowManager; import android.view.WindowManager;
...@@ -28,25 +30,35 @@ import com.google.android.gms.maps.model.BitmapDescriptorFactory; ...@@ -28,25 +30,35 @@ import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MapStyleOptions; import com.google.android.gms.maps.model.MapStyleOptions;
import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.maps.model.Polyline;
import com.google.android.gms.maps.model.PolylineOptions;
import com.google.android.gms.tasks.OnSuccessListener; import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task; import com.google.android.gms.tasks.Task;
import android.view.View; import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.chaquo.python.PyObject;
import com.chaquo.python.Python;
import com.chaquo.python.android.AndroidPlatform;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class InitialMap extends AppCompatActivity { public class InitialMap extends AppCompatActivity {
private AutoCompleteTextView editText;
private static final String[] CITIES = new String[]{ private static final String[] CITIES = new String[]{
"Viharamahadevi Park","House Of Fashion","Castle Street","Rajagiriya","HSBC Rajagiriya","Ethulkotte New","Parliament Junction","Battaramulla Junction","Ganahena","Koswatta","Kotte-Bope" "Viharamahadevi Park","House Of Fashion","Castle Street","Rajagiriya","HSBC Rajagiriya","Ethulkotte New","Parliament Junction","Battaramulla Junction","Ganahena","Koswatta","Kotte-Bope"
,"Thalahena Junction","Malabe","Fort_TR","Kompannavidiya_TR","Kollupitiya_TR","Bambalapitiya_TR","Wellawatte_TR","Dehiwala_TR" ,"Thalahena Junction","Malabe","Fort_TR","Kompannavidiya_TR","Kollupitiya_TR","Bambalapitiya_TR","Wellawatte_TR","Dehiwala_TR"
}; };
//Initialize variable //Initialize variable
SupportMapFragment supportMapFragment; SupportMapFragment supportMapFragment;
FusedLocationProviderClient client; FusedLocationProviderClient client;
GoogleMap map; GoogleMap map;
TextView textView;
Button findBtn;
Double Longi;
Double Lati;
ProgressDialog pd;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -55,14 +67,23 @@ public class InitialMap extends AppCompatActivity { ...@@ -55,14 +67,23 @@ public class InitialMap extends AppCompatActivity {
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
getSupportActionBar().hide(); getSupportActionBar().hide();
setContentView(R.layout.activity_initial_map); setContentView(R.layout.activity_initial_map);
pd = new ProgressDialog(this);
//find button function
findBtn = findViewById(R.id.findbus);
//id selecting
textView = findViewById(R.id.current_location);
//Where to declaration //Where to declaration
AutoCompleteTextView editText = findViewById(R.id.where_to); editText = findViewById(R.id.where_to);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this , android.R.layout.simple_list_item_1, CITIES); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this , android.R.layout.simple_list_item_1, CITIES);
editText.setAdapter(adapter); editText.setAdapter(adapter);
//Assign variable //Assign variable
supportMapFragment = (SupportMapFragment) getSupportFragmentManager() supportMapFragment = (SupportMapFragment) getSupportFragmentManager()
...@@ -77,20 +98,54 @@ public class InitialMap extends AppCompatActivity { ...@@ -77,20 +98,54 @@ public class InitialMap extends AppCompatActivity {
//When granted //When granted
//Call method //Call method
getCurrentLocation(); getCurrentLocation();
} }
else{ else{
//When denied request permission //When denied request permission
ActivityCompat.requestPermissions(InitialMap.this, ActivityCompat.requestPermissions(InitialMap.this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},44); new String[]{Manifest.permission.ACCESS_FINE_LOCATION},44);
} }
}
public void btnRetrieveLocation(View view) {
startActivity(new Intent(getApplicationContext(),RetrieveBusMap.class)); findBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//set title of progress dialog
String value = editText.getText().toString();
String valu2 = textView.getText().toString();
String locationOne = textView.getText().toString();//start location
String locationTwo = editText.getText().toString();//end location
int travelTime = GetTravelTime(locationOne,locationTwo);
int ArrivalValue = GetStationID(locationTwo);
startActivity(new Intent(InitialMap.this, RouteActivity.class)
.putExtra("key", 79.95430199947661)
.putExtra("rname", 6.903962700873259)
.putExtra("TimePrediction", travelTime)
.putExtra("EndLocation", ArrivalValue)
);
}
});
} }
private void getCurrentLocation() { private void getCurrentLocation() {
//Initialize task location //Initialize task location
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
...@@ -101,6 +156,8 @@ public class InitialMap extends AppCompatActivity { ...@@ -101,6 +156,8 @@ public class InitialMap extends AppCompatActivity {
// int[] grantResults) // int[] grantResults)
// to handle the case where the user grants the permission. See the documentation // to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details. // for ActivityCompat#requestPermissions for more details.
return; return;
} }
Task<Location> task = client.getLastLocation(); Task<Location> task = client.getLastLocation();
...@@ -117,6 +174,14 @@ public class InitialMap extends AppCompatActivity { ...@@ -117,6 +174,14 @@ public class InitialMap extends AppCompatActivity {
//Initialize lat lan //Initialize lat lan
LatLng latLng = new LatLng(location.getLatitude(), LatLng latLng = new LatLng(location.getLatitude(),
location.getLongitude()); location.getLongitude());
Longi=location.getLongitude();
Lati=location.getLatitude();
System.out.println("Longi :- "+Longi +" Lat:- "+Lati);
textView.setText(""+GetCurrentLocationName(Longi,Lati));
//Create marker //Create marker
MarkerOptions options = new MarkerOptions() MarkerOptions options = new MarkerOptions()
.position(latLng) .position(latLng)
...@@ -124,10 +189,6 @@ public class InitialMap extends AppCompatActivity { ...@@ -124,10 +189,6 @@ public class InitialMap extends AppCompatActivity {
.title("You are here"); .title("You are here");
//Zoom map //Zoom map
googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 18)); googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 18));
//Add marker //Add marker
...@@ -149,6 +210,7 @@ public class InitialMap extends AppCompatActivity { ...@@ -149,6 +210,7 @@ public class InitialMap extends AppCompatActivity {
} }
}); });
} }
} }
}); });
} }
...@@ -166,4 +228,115 @@ public class InitialMap extends AppCompatActivity { ...@@ -166,4 +228,115 @@ public class InitialMap extends AppCompatActivity {
} }
} }
} }
}
\ No newline at end of file
public String GetCurrentLocationName(Double longi,Double lat){
if (! Python.isStarted()) {
Python.start(new AndroidPlatform(this));
}
Python py = Python.getInstance();
PyObject pyobj = py.getModule("AL");
PyObject obj = pyobj.callAttr("get_nearest_station",lat,longi);
PyObject obj2 = pyobj.callAttr("get_route",1,2,3);
//semina function call and get the current location name
return obj.toString();
}
public int GetStationID(String name){
// Create a HashMap object called capitalCities
HashMap<String, Integer> capitalCities = new HashMap<String, Integer>();
// Add keys and values (name,value)
capitalCities.put("Kollupitiya", 0);
capitalCities.put("Viharamahadevi Park", 1);
capitalCities.put("House Of Fashion", 2);
capitalCities.put("Castle Street", 3);
capitalCities.put("Rajagiriya", 4);
capitalCities.put("HSBC Rajagiriya", 5);
capitalCities.put("Ethulkotte New", 6);
capitalCities.put("Parliament Junction", 7);
capitalCities.put("Battaramulla Junction", 8);
capitalCities.put("Ganahena", 9);
capitalCities.put("Koswatta", 10);
capitalCities.put("Kotte-Bope", 11);
capitalCities.put("Thalahena Junction", 12);
capitalCities.put("Malabe", 13);
capitalCities.put("Fort_TR", 14);
capitalCities.put("Kompannavidiya_TR", 15);
capitalCities.put("Kollupitiya_TR", 16);
capitalCities.put("Bambalapitiya_TR", 17);
capitalCities.put("Wellawatte_TR", 18);
capitalCities.put("Dehiwala_TR", 19);
int val = capitalCities.get(name);
return val;
}
public int GetTravelTime(String StartLocation,String EndLocation){
int time=0;
if(StartLocation.equals("Malabe")){
if(EndLocation.equals("Koswatta")){
time = 20;
}
else if(EndLocation.equals("Kollupitiya")){
time = 58;
}
else if(EndLocation.equals("Viharamahadevi Park")){
time = 56;
}
else if(EndLocation.equals("House Of Fashion")){
time = 44;
}
else if(EndLocation.equals("Castle Street")){
time = 41;
}
else if(EndLocation.equals("Rajagiriya")){
time = 43;
}
else if(EndLocation.equals("HSBC Rajagiriya")){
time = 42;
}
else if(EndLocation.equals("Ethulkotte New")){
time = 34;
}
else if(EndLocation.equals("Parliaent Junction")){
time = 31;
}
else if(EndLocation.equals("Battaramulla Junction")){
time = 28;
}
else if(EndLocation.equals("Ganahena")){
time = 26;
}
else if(EndLocation.equals("Kotte-Bope")){
time = 20;
}
else if(EndLocation.equals("Thalahena Junction")){
time = 15;
}
}else{
}
return time;
}
}
...@@ -2,16 +2,19 @@ package com.app.travelle; ...@@ -2,16 +2,19 @@ package com.app.travelle;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.app.ProgressDialog;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.Button; import android.widget.Button;
import android.widget.Toast;
public class Login extends AppCompatActivity { public class Login extends AppCompatActivity {
private Button login_btn; private Button login_btn;
private Button direct_to_signup_btn; private Button direct_to_signup_btn;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
...@@ -20,6 +23,8 @@ public class Login extends AppCompatActivity { ...@@ -20,6 +23,8 @@ public class Login extends AppCompatActivity {
getSupportActionBar().hide(); getSupportActionBar().hide();
setContentView(R.layout.activity_login); setContentView(R.layout.activity_login);
login_btn = (Button) findViewById(R.id.login); login_btn = (Button) findViewById(R.id.login);
direct_to_signup_btn = (Button) findViewById(R.id.signup); direct_to_signup_btn = (Button) findViewById(R.id.signup);
......
...@@ -11,6 +11,10 @@ import android.view.Window; ...@@ -11,6 +11,10 @@ import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.Button; import android.widget.Button;
import com.chaquo.python.PyObject;
import com.chaquo.python.Python;
import com.chaquo.python.android.AndroidPlatform;
public class MainActivity extends AppCompatActivity { public class MainActivity extends AppCompatActivity {
private Button button; private Button button;
...@@ -31,6 +35,10 @@ public class MainActivity extends AppCompatActivity { ...@@ -31,6 +35,10 @@ public class MainActivity extends AppCompatActivity {
openLogin(); openLogin();
} }
}); });
if (! Python.isStarted()) {
Python.start(new AndroidPlatform(this));
}
} }
public void openLogin(){ public void openLogin(){
Intent intent = new Intent(this, Login.class); Intent intent = new Intent(this, Login.class);
......
package com.app.travelle;
import android.content.Context;
import android.graphics.Color;
import android.os.AsyncTask;
import android.util.Log;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.PolylineOptions;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* Created by Vishal on 10/20/2018.
*/
public class PointsParser extends AsyncTask<String, Integer, List<List<HashMap<String, String>>>> {
TaskLoadedCallback taskCallback;
String directionMode = "driving";
public PointsParser(Context mContext, String directionMode) {
this.taskCallback = (TaskLoadedCallback) mContext;
this.directionMode = directionMode;
}
// Parsing the data in non-ui thread
@Override
protected List<List<HashMap<String, String>>> doInBackground(String... jsonData) {
JSONObject jObject;
List<List<HashMap<String, String>>> routes = null;
try {
jObject = new JSONObject(jsonData[0]);
Log.d("mylog", jsonData[0].toString());
DataParser parser = new DataParser();
Log.d("mylog", parser.toString());
// Starts parsing data
routes = parser.parse(jObject);
Log.d("mylog", "Executing routes");
Log.d("mylog", routes.toString());
} catch (Exception e) {
Log.d("mylog", e.toString());
e.printStackTrace();
}
return routes;
}
// Executes in UI thread, after the parsing process
@Override
protected void onPostExecute(List<List<HashMap<String, String>>> result) {
ArrayList<LatLng> points;
PolylineOptions lineOptions = null;
// Traversing through all the routes
for (int i = 0; i < result.size(); i++) {
points = new ArrayList<>();
lineOptions = new PolylineOptions();
// Fetching i-th route
List<HashMap<String, String>> path = result.get(i);
// Fetching all the points in i-th route
for (int j = 0; j < path.size(); j++) {
HashMap<String, String> point = path.get(j);
double lat = Double.parseDouble(point.get("lat"));
double lng = Double.parseDouble(point.get("lng"));
LatLng position = new LatLng(lat, lng);
points.add(position);
}
// Adding all the points in the route to LineOptions
lineOptions.addAll(points);
if (directionMode.equalsIgnoreCase("walking")) {
lineOptions.width(10);
lineOptions.color(Color.MAGENTA);
} else {
lineOptions.width(20);
lineOptions.color(Color.BLUE);
}
Log.d("mylog", "onPostExecute lineoptions decoded");
}
// Drawing polyline in the Google Map for the i-th route
if (lineOptions != null) {
//mMap.addPolyline(lineOptions);
taskCallback.onTaskDone(lineOptions);
} else {
Log.d("mylog", "without Polylines drawn");
}
}
}
...@@ -116,7 +116,7 @@ public class RetrieveBusMap extends FragmentActivity implements OnMapReadyCallba ...@@ -116,7 +116,7 @@ public class RetrieveBusMap extends FragmentActivity implements OnMapReadyCallba
} }
@Override @Override
public void onCancelled(@NonNull DatabaseError databaseError) { public void onCancelled(@NonNull DatabaseError databaseError) {
...@@ -125,4 +125,4 @@ public class RetrieveBusMap extends FragmentActivity implements OnMapReadyCallba ...@@ -125,4 +125,4 @@ public class RetrieveBusMap extends FragmentActivity implements OnMapReadyCallba
} }
} }
\ No newline at end of file
package com.app.travelle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.chaquo.python.PyObject;
import com.chaquo.python.Python;
import com.chaquo.python.android.AndroidPlatform;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.LatLngBounds;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.maps.model.Polyline;
import com.google.android.gms.maps.model.PolylineOptions;
import com.google.common.base.CharMatcher;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.sql.SQLOutput;
import java.util.ArrayList;
import org.json.JSONException;
import org.json.JSONObject;
import io.grpc.internal.JsonParser;
public class RouteActivity extends AppCompatActivity implements OnMapReadyCallback, TaskLoadedCallback {
private GoogleMap mMap;
private MarkerOptions place1, place2;
Button getDirection;
private Polyline currentPolyline;
Marker mm;
Bundle bundle;
TextView timeDisplay,fireDisply,TrackerLoca;
String[] Route;
ProgressDialog pd;
@SuppressLint("MissingInflatedId")
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.route_activity);
//requestWindowFeature(getWindow().FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
getSupportActionBar().hide();
pd = new ProgressDialog(this);
timeDisplay = findViewById(R.id.time_pred);
fireDisply = findViewById(R.id.fair_calc);
TrackerLoca = findViewById(R.id.TrackerL);
MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.mapsFrag);
mapFragment.getMapAsync(this);
//27.658143,85.3199503
//27.667491,85.3208583
Intent intent = getIntent();
bundle = intent.getExtras();
int ArrivalID = bundle.getInt("EndLocation");
Route = findRoute(1,13,ArrivalID);
int Routlength = Route.length - 1;
place1 = new MarkerOptions().position(new LatLng(Double.valueOf(Route[1]), Double.valueOf(Route[2]))).title("Location 1");
place2 = new MarkerOptions().position(new LatLng(Double.valueOf(Route[Routlength-2]), Double.valueOf(Route[Routlength-1]))).title("Location 2");
String url = getUrl(place1.getPosition(), place2.getPosition(), "transit");
new FetchURL(RouteActivity.this).execute(getUrl(place1.getPosition(), place2.getPosition(), "driving"), "driving");
pd.setTitle("Travelle Fetching..");
pd.show();
}
@Override
public void onMapReady(@NonNull GoogleMap googleMap) {
mMap = googleMap;
mMap.addMarker(place1);
mMap.addMarker(place2);
// Firebase data come from here
DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReference("/");
System.out.println("================================================") ;
System.out.println(databaseReference);
ValueEventListener listener = databaseReference.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
System.out.println("changing-----------------------------");
String latitude = dataSnapshot.child("latitude").getValue(String.class);
String longitude = dataSnapshot.child("longitude").getValue(String.class);
System.out.println(latitude+longitude);
LatLng location = new LatLng(Double.parseDouble(latitude),Double.parseDouble(longitude));
//Toast.makeText(RouteActivity.this, "This is data :-"+latitude+" Longi :-"+longitude, Toast.LENGTH_SHORT).show();
//Set the location
String NearestValue = GetCurrentLocationName(Double.parseDouble(longitude),Double.parseDouble(latitude));
TrackerLoca.setText(NearestValue);
if(mm != null){
mm.remove();
}
mm = mMap.addMarker(new MarkerOptions()
.position(location)
.title("117")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_icon))
);
//bus stop marker here
LatLng BStopLocation = new LatLng(6.913578717566548,79.99873889604599);
mMap.addMarker(new MarkerOptions()
.position(BStopLocation)
.title("BusStop1")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.transit))
);
//bus stop marker end here
int Routlength = Route.length - 1;
LatLngBounds.Builder builder = new LatLngBounds.Builder();
builder.include(new LatLng(Double.valueOf(Route[1]), Double.valueOf(Route[2])));
builder.include(new LatLng(Double.valueOf(Route[Routlength-2]), Double.valueOf(Route[Routlength-1])));
mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 190));
pd.dismiss();
mMap.setOnCameraMoveListener(new GoogleMap.OnCameraMoveListener() {
@Override
public void onCameraMove() {
}
});
int TravelTime = bundle.getInt("TimePrediction");
timeDisplay.setText(""+TravelTime+"min");
fireDisply.setText("LKR "+Route[0]+".00");
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
}
private String getUrl(LatLng origin, LatLng dest, String directionMode) {
// Origin of route
String str_origin = "origin=" + origin.latitude + "," + origin.longitude;
// Destination of route
String str_dest = "destination=" + dest.latitude + "," + dest.longitude;
// Mode
String mode = "mode=" + directionMode;
// Building the parameters to the web service
String parameters = str_origin + "&" + str_dest + "&" + mode;
// Output format
String output = "json";
// Building the url to the web service
String url = "https://maps.googleapis.com/maps/api/directions/" + output + "?" + parameters + "&key=" + getString(R.string.google_maps_key);
return url;
}
@Override
public void onTaskDone(Object... values) {
if (currentPolyline != null)
currentPolyline.remove();
currentPolyline = mMap.addPolyline((PolylineOptions) values[0]);
}
public String[] findRoute(int map,int start, int destination){
if (! Python.isStarted()) {
Python.start(new AndroidPlatform(this));
}
Python py = Python.getInstance();
PyObject pyobj = py.getModule("AL");
PyObject obj = pyobj.callAttr("get_route",map,start,destination);
System.out.println("-----------ssssssssssssssssssssssss-------------------");
String testValue = obj.toString();
String valueRE = testValue.replace("[(","");
String valueRE2 = valueRE.replace(")]","");
String valueRE3 = valueRE2.replace(")","");
String valueRE4 = valueRE3.replace("(","");
String valueRE5 = valueRE4.replace("[","");
int occurance = CharMatcher.is(',').countIn(valueRE5);
String[] arrOfStr = valueRE5.split(",", occurance);
for (String a : arrOfStr)
System.out.println(a);
return arrOfStr;
}
public String GetCurrentLocationName(Double longi,Double lat){
if (! Python.isStarted()) {
Python.start(new AndroidPlatform(this));
}
Python py = Python.getInstance();
PyObject pyobj = py.getModule("AL");
PyObject obj = pyobj.callAttr("get_nearest_station",lat,longi);
PyObject obj2 = pyobj.callAttr("get_route",1,2,3);
//semina function call and get the current location name
return obj.toString();
}
}
\ No newline at end of file
package com.app.travelle;
/**
* Created by Vishal on 10/20/2018.
*/
public interface TaskLoadedCallback {
void onTaskDone(Object... values);
}
#from asyncio.windows_events import NULL
from cmath import inf
from tokenize import ContStr
from helpers import load_map_test, load_map_bus, load_map_train,route_177,route_176,route_8717
from math import radians, cos, sin, asin, sqrt
import json
class PathPlanner():
def __init__(self, M, start=None, goal=None, type=None):
self.map = M
self.start= start
self.goal = goal
self.type = type
self.range = 0
self.cost = 0
self.allRoutes = [177,176,8717]
self.closedSet = self.create_closedSet() if goal != None and start != None else None
self.openSet = self.create_openSet() if goal != None and start != None else None
self.cameFrom = self.create_cameFrom() if goal != None and start != None else None
self.gScore = self.create_gScore() if goal != None and start != None else None
self.fScore = self.create_fScore() if goal != None and start != None else None
self.path = self.run_search() if self.map and self.start != None and self.goal != None else None
def reconstruct_path(self, current):
total_path = [current]
while current in self.cameFrom.keys():
current = self.cameFrom[current]
total_path.append(current)
return total_path
def _reset(self):
self.closedSet = None
self.openSet = None
self.cameFrom = None
self.gScore = None
self.fScore = None
self.path = self.run_search() if self.map and self.start and self.goal else None
def run_search(self):
""" """
if self.map == None:
raise(ValueError, "Must create map before running search")
if self.goal == None:
raise(ValueError, "Must create goal node before running search")
if self.start == None:
raise(ValueError, "Must create start node before running search")
self.closedSet = self.closedSet if self.closedSet != None else self.create_closedSet()
self.openSet = self.openSet if self.openSet != None else self.create_openSet()
self.cameFrom = self.cameFrom if self.cameFrom != None else self.create_cameFrom()
self.gScore = self.gScore if self.gScore != None else self.create_gScore()
self.fScore = self.fScore if self.fScore != None else self.create_fScore()
while not self.is_open_empty():
current = self.get_current_node()
if current == self.goal:
self.path = [x for x in reversed(self.reconstruct_path(current))]
return self.path
else:
self.openSet.remove(current)
self.closedSet.add(current)
for neighbor in self.get_neighbors(current):
if neighbor in self.closedSet:
continue # Ignore the neighbor which is already evaluated.
if not neighbor in self.openSet: # Discover a new node
self.openSet.add(neighbor)
# The distance from start to a neighbor
if self.getTempGScore(current, neighbor) >= self.get_gScore(neighbor):
continue
# This path is the best until now. Record it!
self.record_best_path_to(current, neighbor)
#self.range += self.dis
self.path = None
return False
def create_closedSet(self):
return set()
def create_openSet(self):
openSet = set()
openSet.add(self.start)
return openSet
def create_cameFrom(self):
cameFrom = {}
return cameFrom
def create_gScore(self):
gScore = {}
for node in self.map.intersections.keys():
if node == self.start:
gScore[node] = 0
else: gScore[node] = float('inf')
return gScore
def create_fScore(self):
if self.start != None:
fScore = {}
for node in self.map.intersections.keys():
if node == self.start:
fScore[node] = self.heuristic_cost_estimate(self.start)
else: fScore[node] = float('inf')
return fScore
raise(ValueError, "Must create start node before creating fScore.")
def set_map(self, M):
"set map attribute "
self._reset(self)
self.start = None
self.goal = None
self.map = M
def set_start(self, start):
" set start attribute "
self._reset(self)
self.start = start
self.goal = None
def set_goal(self, goal):
"set goal attribute "
self._reset(self)
self.goal = goal
#-------------------------------- get information --------------------------------#
def is_open_empty(self):
"returns True if the open set is empty"
return not bool(self.openSet)
def get_current_node(self):
" Returns the node in the open set with the lowest value of f(node)"
current = None
minim = float('inf')
for node in self.openSet:
if self.fScore[node] < minim:
minim = self.fScore[node]
current = node
return current
def get_neighbors(self, node):
"""Returns the neighbors of a node"""
return set(self.map.roads[node])
#-------------------------------- Calculations --------------------------------#
def get_gScore(self, node):
return self.gScore[node]
def getTempGScore(self, current, neighbor):
# distance from the current node to it's neighbors
g_score_current = self.get_gScore(current)
dist_current_neighbor = self.distance(current,neighbor)
return g_score_current+dist_current_neighbor
def heuristic_cost_estimate(self, node):
if self.goal != None:
heuristic_estimate = self.distance(node,self.goal)
return heuristic_estimate
raise(ValueError, "Must create goal node before calculating huristic ")
def calculate_fscore(self, node):
# F = G + H
f_score = self.get_gScore(node) + self.heuristic_cost_estimate(node)
return f_score
# best path
def record_best_path_to(self, current, neighbor):
self.cameFrom[neighbor] = current
self.gScore[neighbor] = self.getTempGScore(current,neighbor)
self.fScore[neighbor] = self.gScore[neighbor] + self.heuristic_cost_estimate(neighbor)
def distance(self, node_1, node_2):
#The math module contains a function named
#radians which converts from degrees to radians.
lon1 = radians(self.map.intersections [node_1][0])
lon2 = radians(self.map.intersections [node_2][0])
lat1 = radians(self.map.intersections [node_1][1])
lat2 = radians(self.map.intersections [node_2][1])
# Haversine formula
dlon = lon2 - lon1
dlat = lat2 - lat1
a = sin(dlat / 2)**2 + cos(lat1) * cos(lat2) * sin(dlon / 2)**2
c = 2 * asin(sqrt(a))
# Radius of earth in kilometers. Use 3956 for miles
r = 6371
# calculate the result
dist = (c * r)
#print (dist)
#self.dis = dist
return dist
# def get_traveled_distance(self):
# #traveled_distance
# lastNode = self.start
# for n in self.path[1:]:
# self.range = range + distance(self,lastNode, n)
# lastNode = n
# return self.range
def get_fare(self,path):
routeNumbers = []
for each in path:
routeNumbers.append(self.map.routeNo[each])
#routeNumbers
for n in self.allRoutes:
val = routeNumbers.count(n)
if val >= 0:
self.funcc(n, val)
return self.cost
def funcc(self, no, nodes):
if(no == 177):
self.cost = self.cost + route_177.get(nodes)
elif(no == 176):
self.cost = self.cost + route_176.get(nodes)
elif(no == 8717):
self.cost = self.cost + route_8717.get(nodes)
else:
pass
# Get route
def get_route( val, start, destination):
if val == 3:
map = load_map_train()
elif val == 2:
map = load_map_bus()
else:
map = load_map_test()
planner = PathPlanner(map,start,destination)
#print(map.roads)
path = planner.path
print(type(path))
if path == False:
print("No path Found ")
return False
else:
# print('path = ' ,path)
#dist = planner.get_traveled_distance()/10
dist =10
# print('distance = ' , dist)
fare = planner.get_fare(path)
# print('trip RS.' , fare)
# return path
#data = dict()
data = []
data.append(fare)
for each in path:
data.append(map.intersections[each])
#print(type(data))
return data
# for each in path:
# data[each] = list()
#raw = {map.intersections[each],map.name[each],map.routeNo[each],map.type[each]}
# jsonData=json.dumps(data)
#
# data[each].extend(raw)
#
# route = json.dumps(data)
#
#
# return route,dist,fare
#>>>>>>>>>>>>>>>>>>>>>
def test1(typ,start,stop1,stop2,stop3):
noOfStops = 3
fullPath = []
totalTrips = 0
if (typ == NULL & start == NULL & stop1 == NULL & stop2 == NULL):
raise ValueError('Nodes must not be NULL')
if stop3 == NULL:
noOfStops = 2
if typ == 3:
map = load_map_train()
elif typ == 2:
map = load_map_bus()
else:
map = load_map_test()
planner1 = PathPlanner(map,start,stop1)
path1 = planner1.path
if path1 == False:
raise ValueError("No path found for planner")
if stop3 == NULL:
planner2 = PathPlanner(map,stop1,stop2)
path2 = planner2.path
if path1 == False:
raise ValueError("No path found for planner")
path1.extend(path2)
print(path1)
else:
planner2 = PathPlanner(map,stop1,stop2)
path2 = planner2.path
if path1 == False:
raise ValueError("No path found for planner")
planner3 = PathPlanner(map,stop2,stop3)
path3 = planner3.path
if path1 == False:
raise ValueError("No path found for planner")
path1.extend(path2 + path3)
print (path1)
def get_nearest_station(lon,lat):
map = load_map_test()
tempDist = float('inf')
nearestStation = None
lon1 = radians(lon)
lat1 = radians(lat)
for node in map.intersections.keys():
lon2 = radians(map.intersections [node][0])
lat2 = radians(map.intersections [node][1])
# Haversine formula
dlon = lon2 - lon1
dlat = lat2 - lat1
a = sin(dlat / 2)**2 + cos(lat1) * cos(lat2) * sin(dlon / 2)**2
c = 2 * asin(sqrt(a))
# Radius of earth in kilometers
r = 6371
# calculate the result
dist = (c * r)
if dist <= tempDist:
tempDist = dist
nearestStation = map.name[node]
return nearestStation
#<<<<<<<<<<<<<<<<<
#print(get_route( 1, 14, 15) )
#>>>>>>>>>>>>>>
#test1(1,2,3,14,18)
#print(get_nearest_station(6.920044890702823, 79.85393963666239))
#>>>>>>>>>>>>>
# from test import test
# test(PathPlanner)
\ No newline at end of file
Drving Travel
Date Time Day Special CongestionSpeed Stops WeatherDistanceTime
1/1/2019 6Sunday No 5 40 14 25 14.7 56
1/2/2019 7Sunday No 8 40 14 27 14.7 55
1/3/2019 8Sunday No 9 40 14 28 14.7 55
1/4/2019 9Sunday No 7 40 14 29 14.7 56
1/5/2019 10Sunday No 6 40 14 29 14.7 56
1/6/2019 11Sunday No 4 40 14 30 14.7 56
1/7/2019 12Sunday No 4 40 14 30 14.7 56
1/8/2019 13Sunday No 4 40 14 30 14.7 56
1/9/2019 14Sunday No 8 40 14 30 14.7 56
1/10/2019 15Sunday No 8 40 14 29 14.7 56
1/11/2019 16Sunday Yes 6 40 14 29 14.7 56
1/12/2019 17Sunday No 7 40 14 28 14.7 56
1/13/2019 18Sunday No 8 40 14 27 14.7 56
1/14/2019 19Sunday No 9 40 14 27 14.7 71
1/15/2019 20Sunday No 6 40 14 26 14.7 73
1/16/2019 21Sunday No 6 40 14 26 14.7 72
1/17/2019 22Sunday No 5 40 14 25 14.7 75
1/18/2019 6Monday No 5 40 14 25 14.7 56
1/19/2019 7Monday No 8 40 14 27 14.7 55
1/20/2019 8Monday No 9 40 14 28 14.7 55
1/21/2019 9Monday No 7 40 14 29 14.7 56
1/22/2019 10Monday No 6 40 14 29 14.7 56
1/23/2019 11Monday No 4 40 14 30 14.7 56
1/24/2019 12Monday No 4 40 14 30 14.7 56
1/25/2019 13Monday No 4 40 14 30 14.7 56
1/26/2019 14Monday No 8 40 14 30 14.7 56
1/27/2019 15Monday No 8 40 14 29 14.7 56
1/28/2019 16Monday Yes 6 40 14 29 14.7 56
1/29/2019 17Monday No 7 40 14 28 14.7 56
1/30/2019 18Monday No 8 40 14 27 14.7 56
1/31/2019 19Monday No 9 40 14 27 14.7 71
2/1/2019 20Monday No 6 40 14 26 14.7 73
2/2/2019 21Monday No 6 40 14 26 14.7 72
2/3/2019 22Monday No 5 40 14 25 14.7 75
2/4/2019 6TuesdayNo 5 40 14 25 14.7 56
2/5/2019 7TuesdayNo 8 40 14 27 14.7 55
2/6/2019 8TuesdayNo 9 40 14 28 14.7 55
2/7/2019 9TuesdayNo 7 40 14 29 14.7 56
2/8/2019 10TuesdayNo 6 40 14 29 14.7 56
2/9/2019 11TuesdayNo 4 40 14 30 14.7 56
2/10/2019 12TuesdayNo 4 40 14 30 14.7 56
2/11/2019 13TuesdayNo 4 40 14 30 14.7 56
2/12/2019 14TuesdayNo 8 40 14 30 14.7 56
2/13/2019 15TuesdayNo 8 40 14 29 14.7 56
2/14/2019 16TuesdayYes 6 40 14 29 14.7 56
2/15/2019 17TuesdayNo 7 40 14 28 14.7 56
2/16/2019 18TuesdayNo 8 40 14 27 14.7 56
2/17/2019 19TuesdayNo 9 40 14 27 14.7 71
2/18/2019 20TuesdayNo 6 40 14 26 14.7 73
2/19/2019 21TuesdayNo 6 40 14 26 14.7 72
2/20/2019 22TuesdayNo 5 40 14 25 14.7 75
2/21/2019 6Sunday No 7 40 0 25 1.2 9
2/22/2019 6Sunday No 9 40 0 25 1.2 11
2/23/2019 6Sunday No 3 40 1 25 1.2 8
2/24/2019 6Sunday No 2 40 0 25 1.2 3
2/25/2019 6Sunday No 2 40 1 25 3 3
2/26/2019 17Sunday No 9 40 1 25 3 12
2/27/2019 17Sunday No 9 40 4 25 4.7 19
2/28/2019 17Sunday No 3 40 4 25 4.7 12
3/1/2019 17Sunday No 6 40 4 25 4.7 15
3/2/2019 6Sunday No 7 40 9 25 7.5 34
3/3/2019 6Sunday No 9 40 9 25 7.5 39
3/4/2019 6Sunday No 5 40 9 25 7.5 30
3/5/2019 6Monday No 5 40 12 25 10.1 36
3/6/2019 6Monday No 9 40 12 25 10.1 43
3/7/2019 6Monday No 3 40 12 25 10.1 33
3/8/2019 13Monday No 5 40 12 25 10.1 36
3/9/2019 13Monday No 9 40 12 25 10.1 43
3/10/2019 13Monday No 3 40 12 25 10.1 33
3/11/2019 6Monday No 5 40 12 25 12.1 43
3/12/2019 6Monday No 9 40 12 25 12.1 49
3/13/2019 6Monday No 3 40 12 25 12.1 40
3/14/2019 12Monday No 5 40 12 25 12.1 43
3/15/2019 12Monday No 9 40 12 25 12.1 49
3/16/2019 12Monday No 3 40 12 25 12.1 40
3/17/2019 6Sunday No 5 40 14 25 14.7 56
3/18/2019 7Sunday No 8 40 14 27 14.7 55
3/19/2019 8Sunday No 9 40 14 28 14.7 55
3/20/2019 9Sunday No 7 40 14 29 14.7 56
3/21/2019 10Sunday No 6 40 14 29 14.7 56
3/22/2019 11Sunday No 4 40 14 30 14.7 56
3/23/2019 12Sunday No 4 40 14 30 14.7 56
3/24/2019 13Sunday No 4 40 14 30 14.7 56
3/25/2019 14Sunday No 8 40 14 30 14.7 56
3/26/2019 15Sunday No 8 40 14 29 14.7 56
3/27/2019 16Sunday Yes 6 40 14 29 14.7 56
3/28/2019 17Sunday No 7 40 14 28 14.7 56
3/29/2019 18Sunday No 8 40 14 27 14.7 56
3/30/2019 19Sunday No 9 40 14 27 14.7 71
3/31/2019 20Sunday No 6 40 14 26 14.7 73
4/1/2019 21Sunday No 6 40 14 26 14.7 72
4/2/2019 22Sunday No 5 40 14 25 14.7 75
4/3/2019 6Monday No 5 40 14 25 14.7 56
4/4/2019 7Monday No 8 40 14 27 14.7 55
4/5/2019 8Monday No 9 40 14 28 14.7 55
4/6/2019 9Monday No 7 40 14 29 14.7 56
4/7/2019 10Monday No 6 40 14 29 14.7 56
4/8/2019 11Monday No 4 40 14 30 14.7 56
4/9/2019 12Monday No 4 40 14 30 14.7 56
4/10/2019 13Monday No 4 40 14 30 14.7 56
4/11/2019 14Monday No 8 40 14 30 14.7 56
4/12/2019 15Monday No 8 40 14 29 14.7 56
4/13/2019 16Monday Yes 6 40 14 29 14.7 56
4/14/2019 17Monday No 7 40 14 28 14.7 56
4/15/2019 18Monday No 8 40 14 27 14.7 56
4/16/2019 19Monday No 9 40 14 27 14.7 71
4/17/2019 20Monday No 6 40 14 26 14.7 73
4/18/2019 21Monday No 6 40 14 26 14.7 72
4/19/2019 22Monday No 5 40 14 25 14.7 75
4/20/2019 6TuesdayNo 5 40 14 25 14.7 56
4/21/2019 7TuesdayNo 8 40 14 27 14.7 55
4/22/2019 8TuesdayNo 9 40 14 28 14.7 55
4/23/2019 9TuesdayNo 7 40 14 29 14.7 56
4/24/2019 10TuesdayNo 6 40 14 29 14.7 56
4/25/2019 11TuesdayNo 4 40 14 30 14.7 56
4/26/2019 12TuesdayNo 4 40 14 30 14.7 56
4/27/2019 13TuesdayNo 4 40 14 30 14.7 56
4/28/2019 14TuesdayNo 8 40 14 30 14.7 56
4/29/2019 15TuesdayNo 8 40 14 29 14.7 56
4/30/2019 16TuesdayYes 6 40 14 29 14.7 56
5/1/2019 17TuesdayNo 7 40 14 28 14.7 56
5/2/2019 18TuesdayNo 8 40 14 27 14.7 56
5/3/2019 19TuesdayNo 9 40 14 27 14.7 71
5/4/2019 20TuesdayNo 6 40 14 26 14.7 73
5/5/2019 21TuesdayNo 6 40 14 26 14.7 72
5/6/2019 22TuesdayNo 5 40 14 25 14.7 75
5/7/2019 6Sunday No 7 40 0 25 1.2 9
5/8/2019 6Sunday No 9 40 0 25 1.2 11
5/9/2019 6Sunday No 3 40 1 25 1.2 8
5/10/2019 6Sunday No 2 40 0 25 1.2 3
5/11/2019 6Sunday No 2 40 1 25 3 3
5/12/2019 17Sunday No 9 40 1 25 3 12
5/13/2019 17Sunday No 9 40 4 25 4.7 19
5/14/2019 17Sunday No 3 40 4 25 4.7 12
5/15/2019 17Sunday No 6 40 4 25 4.7 15
5/16/2019 6Sunday No 7 40 9 25 7.5 34
5/17/2019 6Sunday No 9 40 9 25 7.5 39
5/18/2019 6Sunday No 5 40 9 25 7.5 30
5/19/2019 6Monday No 5 40 12 25 10.1 36
5/20/2019 6Monday No 9 40 12 25 10.1 43
5/21/2019 6Monday No 3 40 12 25 10.1 33
5/22/2019 13Monday No 5 40 12 25 10.1 36
5/23/2019 13Monday No 9 40 12 25 10.1 43
5/24/2019 13Monday No 3 40 12 25 10.1 33
5/25/2019 6Monday No 5 40 12 25 12.1 43
5/26/2019 6Monday No 9 40 12 25 12.1 49
5/27/2019 6Monday No 3 40 12 25 12.1 40
5/28/2019 12Monday No 5 40 12 25 12.1 43
5/29/2019 12Monday No 9 40 12 25 12.1 49
5/30/2019 12Monday No 3 40 12 25 12.1 40
5/31/2019 6Sunday No 5 40 14 25 14.7 56
6/1/2019 7Sunday No 8 40 14 27 14.7 55
6/2/2019 8Sunday No 9 40 14 28 14.7 55
6/3/2019 9Sunday No 7 40 14 29 14.7 56
6/4/2019 10Sunday No 6 40 14 29 14.7 56
6/5/2019 11Sunday No 4 40 14 30 14.7 56
6/6/2019 12Sunday No 4 40 14 30 14.7 56
6/7/2019 13Sunday No 4 40 14 30 14.7 56
6/8/2019 14Sunday No 8 40 14 30 14.7 56
6/9/2019 15Sunday No 8 40 14 29 14.7 56
6/10/2019 16Sunday Yes 6 40 14 29 14.7 56
6/11/2019 17Sunday No 7 40 14 28 14.7 56
6/12/2019 18Sunday No 8 40 14 27 14.7 56
6/13/2019 19Sunday No 9 40 14 27 14.7 71
6/14/2019 20Sunday No 6 40 14 26 14.7 73
6/15/2019 21Sunday No 6 40 14 26 14.7 72
6/16/2019 22Sunday No 5 40 14 25 14.7 75
6/17/2019 6Monday No 5 40 14 25 14.7 56
6/18/2019 7Monday No 8 40 14 27 14.7 55
6/19/2019 8Monday No 9 40 14 28 14.7 55
6/20/2019 9Monday No 7 40 14 29 14.7 56
6/21/2019 10Monday No 6 40 14 29 14.7 56
6/22/2019 11Monday No 4 40 14 30 14.7 56
6/23/2019 12Monday No 4 40 14 30 14.7 56
6/24/2019 13Monday No 4 40 14 30 14.7 56
6/25/2019 14Monday No 8 40 14 30 14.7 56
6/26/2019 15Monday No 8 40 14 29 14.7 56
6/27/2019 16Monday Yes 6 40 14 29 14.7 56
6/28/2019 17Monday No 7 40 14 28 14.7 56
6/29/2019 18Monday No 8 40 14 27 14.7 56
6/30/2019 19Monday No 9 40 14 27 14.7 71
7/1/2019 20Monday No 6 40 14 26 14.7 73
7/2/2019 21Monday No 6 40 14 26 14.7 72
7/3/2019 22Monday No 5 40 14 25 14.7 75
7/4/2019 6TuesdayNo 5 40 14 25 14.7 56
7/5/2019 7TuesdayNo 8 40 14 27 14.7 55
7/6/2019 8TuesdayNo 9 40 14 28 14.7 55
7/7/2019 9TuesdayNo 7 40 14 29 14.7 56
7/8/2019 10TuesdayNo 6 40 14 29 14.7 56
7/9/2019 11TuesdayNo 4 40 14 30 14.7 56
7/10/2019 12TuesdayNo 4 40 14 30 14.7 56
7/11/2019 13TuesdayNo 4 40 14 30 14.7 56
7/12/2019 14TuesdayNo 8 40 14 30 14.7 56
7/13/2019 15TuesdayNo 8 40 14 29 14.7 56
7/14/2019 16TuesdayYes 6 40 14 29 14.7 56
7/15/2019 17TuesdayNo 7 40 14 28 14.7 56
7/16/2019 18TuesdayNo 8 40 14 27 14.7 56
7/17/2019 19TuesdayNo 9 40 14 27 14.7 71
7/18/2019 20TuesdayNo 6 40 14 26 14.7 73
7/19/2019 21TuesdayNo 6 40 14 26 14.7 72
7/20/2019 22TuesdayNo 5 40 14 25 14.7 75
7/21/2019 6Sunday No 7 40 0 25 1.2 9
7/22/2019 6Sunday No 9 40 0 25 1.2 11
7/23/2019 6Sunday No 3 40 1 25 1.2 8
7/24/2019 6Sunday No 2 40 0 25 1.2 3
7/25/2019 6Sunday No 2 40 1 25 3 3
7/26/2019 17Sunday No 9 40 1 25 3 12
7/27/2019 17Sunday No 9 40 4 25 4.7 19
7/28/2019 17Sunday No 3 40 4 25 4.7 12
7/29/2019 17Sunday No 6 40 4 25 4.7 15
7/30/2019 6Sunday No 7 40 9 25 7.5 34
7/31/2019 6Sunday No 9 40 9 25 7.5 39
8/1/2019 6Sunday No 5 40 9 25 7.5 30
8/2/2019 6Monday No 5 40 12 25 10.1 36
8/3/2019 6Monday No 9 40 12 25 10.1 43
8/4/2019 6Monday No 3 40 12 25 10.1 33
8/5/2019 13Monday No 5 40 12 25 10.1 36
8/6/2019 13Monday No 9 40 12 25 10.1 43
8/7/2019 13Monday No 3 40 12 25 10.1 33
8/8/2019 6Monday No 5 40 12 25 12.1 43
8/9/2019 6Monday No 9 40 12 25 12.1 49
8/10/2019 6Monday No 3 40 12 25 12.1 40
8/11/2019 12Monday No 5 40 12 25 12.1 43
8/12/2019 12Monday No 9 40 12 25 12.1 49
8/13/2019 12Monday No 3 40 12 25 12.1 40
8/14/2019 6Sunday No 5 40 14 25 14.7 56
8/15/2019 7Sunday No 8 40 14 27 14.7 55
8/16/2019 8Sunday No 9 40 14 28 14.7 55
8/17/2019 9Sunday No 7 40 14 29 14.7 56
8/18/2019 10Sunday No 6 40 14 29 14.7 56
8/19/2019 11Sunday No 4 40 14 30 14.7 56
8/20/2019 12Sunday No 4 40 14 30 14.7 56
8/21/2019 13Sunday No 4 40 14 30 14.7 56
8/22/2019 14Sunday No 8 40 14 30 14.7 56
8/23/2019 15Sunday No 8 40 14 29 14.7 56
8/24/2019 16Sunday Yes 6 40 14 29 14.7 56
8/25/2019 17Sunday No 7 40 14 28 14.7 56
8/26/2019 18Sunday No 8 40 14 27 14.7 56
8/27/2019 19Sunday No 9 40 14 27 14.7 71
8/28/2019 20Sunday No 6 40 14 26 14.7 73
8/29/2019 21Sunday No 6 40 14 26 14.7 72
8/30/2019 22Sunday No 5 40 14 25 14.7 75
8/31/2019 6Monday No 5 40 14 25 14.7 56
9/1/2019 7Monday No 8 40 14 27 14.7 55
9/2/2019 8Monday No 9 40 14 28 14.7 55
9/3/2019 9Monday No 7 40 14 29 14.7 56
9/4/2019 10Monday No 6 40 14 29 14.7 56
9/5/2019 11Monday No 4 40 14 30 14.7 56
9/6/2019 12Monday No 4 40 14 30 14.7 56
9/7/2019 13Monday No 4 40 14 30 14.7 56
9/8/2019 14Monday No 8 40 14 30 14.7 56
9/9/2019 15Monday No 8 40 14 29 14.7 56
9/10/2019 16Monday Yes 6 40 14 29 14.7 56
9/11/2019 17Monday No 7 40 14 28 14.7 56
9/12/2019 18Monday No 8 40 14 27 14.7 56
9/13/2019 19Monday No 9 40 14 27 14.7 71
9/14/2019 20Monday No 6 40 14 26 14.7 73
9/15/2019 21Monday No 6 40 14 26 14.7 72
9/16/2019 22Monday No 5 40 14 25 14.7 75
9/17/2019 6TuesdayNo 5 40 14 25 14.7 56
9/18/2019 7TuesdayNo 8 40 14 27 14.7 55
9/19/2019 8TuesdayNo 9 40 14 28 14.7 55
9/20/2019 9TuesdayNo 7 40 14 29 14.7 56
9/21/2019 10TuesdayNo 6 40 14 29 14.7 56
9/22/2019 11TuesdayNo 4 40 14 30 14.7 56
9/23/2019 12TuesdayNo 4 40 14 30 14.7 56
9/24/2019 13TuesdayNo 4 40 14 30 14.7 56
9/25/2019 14TuesdayNo 8 40 14 30 14.7 56
9/26/2019 15TuesdayNo 8 40 14 29 14.7 56
9/27/2019 16TuesdayYes 6 40 14 29 14.7 56
9/28/2019 17TuesdayNo 7 40 14 28 14.7 56
9/29/2019 18TuesdayNo 8 40 14 27 14.7 56
9/30/2019 19TuesdayNo 9 40 14 27 14.7 71
10/1/2019 20TuesdayNo 6 40 14 26 14.7 73
10/2/2019 21TuesdayNo 6 40 14 26 14.7 72
10/3/2019 22TuesdayNo 5 40 14 25 14.7 75
10/4/2019 6Sunday No 7 40 0 25 1.2 9
10/5/2019 6Sunday No 9 40 0 25 1.2 11
10/6/2019 6Sunday No 3 40 1 25 1.2 8
10/7/2019 6Sunday No 2 40 0 25 1.2 3
10/8/2019 6Sunday No 2 40 1 25 3 3
10/9/2019 17Sunday No 9 40 1 25 3 12
10/10/2019 17Sunday No 9 40 4 25 4.7 19
10/11/2019 17Sunday No 3 40 4 25 4.7 12
10/12/2019 17Sunday No 6 40 4 25 4.7 15
10/13/2019 6Sunday No 7 40 9 25 7.5 34
10/14/2019 6Sunday No 9 40 9 25 7.5 39
10/15/2019 6Sunday No 5 40 9 25 7.5 30
10/16/2019 6Monday No 5 40 12 25 10.1 36
10/17/2019 6Monday No 9 40 12 25 10.1 43
10/18/2019 6Monday No 3 40 12 25 10.1 33
10/19/2019 13Monday No 5 40 12 25 10.1 36
10/20/2019 13Monday No 9 40 12 25 10.1 43
10/21/2019 13Monday No 3 40 12 25 10.1 33
10/22/2019 6Monday No 5 40 12 25 12.1 43
10/23/2019 6Monday No 9 40 12 25 12.1 49
10/24/2019 6Monday No 3 40 12 25 12.1 40
10/25/2019 12Monday No 5 40 12 25 12.1 43
10/26/2019 12Monday No 9 40 12 25 12.1 49
10/27/2019 12Monday No 3 40 12 25 12.1 40
10/28/2019 6Sunday No 5 40 14 25 14.7 56
10/29/2019 7Sunday No 8 40 14 27 14.7 55
10/30/2019 8Sunday No 9 40 14 28 14.7 55
10/31/2019 9Sunday No 7 40 14 29 14.7 56
11/1/2019 10Sunday No 6 40 14 29 14.7 56
11/2/2019 11Sunday No 4 40 14 30 14.7 56
11/3/2019 12Sunday No 4 40 14 30 14.7 56
11/4/2019 13Sunday No 4 40 14 30 14.7 56
11/5/2019 14Sunday No 8 40 14 30 14.7 56
11/6/2019 15Sunday No 8 40 14 29 14.7 56
11/7/2019 16Sunday Yes 6 40 14 29 14.7 56
11/8/2019 17Sunday No 7 40 14 28 14.7 56
11/9/2019 18Sunday No 8 40 14 27 14.7 56
11/10/2019 19Sunday No 9 40 14 27 14.7 71
11/11/2019 20Sunday No 6 40 14 26 14.7 73
11/12/2019 21Sunday No 6 40 14 26 14.7 72
11/13/2019 22Sunday No 5 40 14 25 14.7 75
11/14/2019 6Monday No 5 40 14 25 14.7 56
11/15/2019 7Monday No 8 40 14 27 14.7 55
11/16/2019 8Monday No 9 40 14 28 14.7 55
11/17/2019 9Monday No 7 40 14 29 14.7 56
11/18/2019 10Monday No 6 40 14 29 14.7 56
11/19/2019 11Monday No 4 40 14 30 14.7 56
11/20/2019 12Monday No 4 40 14 30 14.7 56
11/21/2019 13Monday No 4 40 14 30 14.7 56
11/22/2019 14Monday No 8 40 14 30 14.7 56
11/23/2019 15Monday No 8 40 14 29 14.7 56
11/24/2019 16Monday Yes 6 40 14 29 14.7 56
11/25/2019 17Monday No 7 40 14 28 14.7 56
11/26/2019 18Monday No 8 40 14 27 14.7 56
11/27/2019 19Monday No 9 40 14 27 14.7 71
11/28/2019 20Monday No 6 40 14 26 14.7 73
11/29/2019 21Monday No 6 40 14 26 14.7 72
11/30/2019 22Monday No 5 40 14 25 14.7 75
12/1/2019 6TuesdayNo 5 40 14 25 14.7 56
12/2/2019 7TuesdayNo 8 40 14 27 14.7 55
12/3/2019 8TuesdayNo 9 40 14 28 14.7 55
12/4/2019 9TuesdayNo 7 40 14 29 14.7 56
12/5/2019 10TuesdayNo 6 40 14 29 14.7 56
12/6/2019 11TuesdayNo 4 40 14 30 14.7 56
12/7/2019 12TuesdayNo 4 40 14 30 14.7 56
12/8/2019 13TuesdayNo 4 40 14 30 14.7 56
12/9/2019 14TuesdayNo 8 40 14 30 14.7 56
12/10/2019 15TuesdayNo 8 40 14 29 14.7 56
12/11/2019 16TuesdayYes 6 40 14 29 14.7 56
12/12/2019 17TuesdayNo 7 40 14 28 14.7 56
12/13/2019 18TuesdayNo 8 40 14 27 14.7 56
12/14/2019 19TuesdayNo 9 40 14 27 14.7 71
12/15/2019 20TuesdayNo 6 40 14 26 14.7 73
12/16/2019 21TuesdayNo 6 40 14 26 14.7 72
12/17/2019 22TuesdayNo 5 40 14 25 14.7 75
12/18/2019 6Sunday No 7 40 0 25 1.2 9
12/19/2019 6Sunday No 9 40 0 25 1.2 11
12/20/2019 6Sunday No 3 40 1 25 1.2 8
12/21/2019 6Sunday No 2 40 0 25 1.2 3
12/22/2019 6Sunday No 2 40 1 25 3 3
12/23/2019 17Sunday No 9 40 1 25 3 12
12/24/2019 17Sunday No 9 40 4 25 4.7 19
12/25/2019 17Sunday No 3 40 4 25 4.7 12
12/26/2019 17Sunday No 6 40 4 25 4.7 15
12/27/2019 6Sunday No 7 40 9 25 7.5 34
12/28/2019 6Sunday No 9 40 9 25 7.5 39
12/29/2019 6Sunday No 5 40 9 25 7.5 30
12/30/2019 6Monday No 5 40 12 25 10.1 36
12/31/2019 6Monday No 9 40 12 25 10.1 43
1/1/2020 6Monday No 3 40 12 25 10.1 33
1/2/2020 13Monday No 5 40 12 25 10.1 36
1/3/2020 13Monday No 9 40 12 25 10.1 43
1/4/2020 13Monday No 3 40 12 25 10.1 33
1/5/2020 6Monday No 5 40 12 25 12.1 43
1/6/2020 6Monday No 9 40 12 25 12.1 49
1/7/2020 6Monday No 3 40 12 25 12.1 40
1/8/2020 12Monday No 5 40 12 25 12.1 43
1/9/2020 12Monday No 9 40 12 25 12.1 49
1/10/2020 12Monday No 3 40 12 25 12.1 40
1/11/2020 6Sunday No 5 40 14 25 14.7 56
1/12/2020 7Sunday No 8 40 14 27 14.7 55
1/13/2020 8Sunday No 9 40 14 28 14.7 55
1/14/2020 9Sunday No 7 40 14 29 14.7 56
1/15/2020 10Sunday No 6 40 14 29 14.7 56
1/16/2020 11Sunday No 4 40 14 30 14.7 56
1/17/2020 12Sunday No 4 40 14 30 14.7 56
1/18/2020 13Sunday No 4 40 14 30 14.7 56
1/19/2020 14Sunday No 8 40 14 30 14.7 56
1/20/2020 15Sunday No 8 40 14 29 14.7 56
1/21/2020 16Sunday Yes 6 40 14 29 14.7 56
1/22/2020 17Sunday No 7 40 14 28 14.7 56
1/23/2020 18Sunday No 8 40 14 27 14.7 56
1/24/2020 19Sunday No 9 40 14 27 14.7 71
1/25/2020 20Sunday No 6 40 14 26 14.7 73
1/26/2020 21Sunday No 6 40 14 26 14.7 72
1/27/2020 22Sunday No 5 40 14 25 14.7 75
1/28/2020 6Monday No 5 40 14 25 14.7 56
1/29/2020 7Monday No 8 40 14 27 14.7 55
1/30/2020 8Monday No 9 40 14 28 14.7 55
1/31/2020 9Monday No 7 40 14 29 14.7 56
2/1/2020 10Monday No 6 40 14 29 14.7 56
2/2/2020 11Monday No 4 40 14 30 14.7 56
2/3/2020 12Monday No 4 40 14 30 14.7 56
2/4/2020 13Monday No 4 40 14 30 14.7 56
2/5/2020 14Monday No 8 40 14 30 14.7 56
2/6/2020 15Monday No 8 40 14 29 14.7 56
2/7/2020 16Monday Yes 6 40 14 29 14.7 56
2/8/2020 17Monday No 7 40 14 28 14.7 56
2/9/2020 18Monday No 8 40 14 27 14.7 56
2/10/2020 19Monday No 9 40 14 27 14.7 71
2/11/2020 20Monday No 6 40 14 26 14.7 73
2/12/2020 21Monday No 6 40 14 26 14.7 72
2/13/2020 22Monday No 5 40 14 25 14.7 75
2/14/2020 6TuesdayNo 5 40 14 25 14.7 56
2/15/2020 7TuesdayNo 8 40 14 27 14.7 55
2/16/2020 8TuesdayNo 9 40 14 28 14.7 55
2/17/2020 9TuesdayNo 7 40 14 29 14.7 56
2/18/2020 10TuesdayNo 6 40 14 29 14.7 56
2/19/2020 11TuesdayNo 4 40 14 30 14.7 56
2/20/2020 12TuesdayNo 4 40 14 30 14.7 56
2/21/2020 13TuesdayNo 4 40 14 30 14.7 56
2/22/2020 14TuesdayNo 8 40 14 30 14.7 56
2/23/2020 15TuesdayNo 8 40 14 29 14.7 56
2/24/2020 16TuesdayYes 6 40 14 29 14.7 56
2/25/2020 17TuesdayNo 7 40 14 28 14.7 56
2/26/2020 18TuesdayNo 8 40 14 27 14.7 56
2/27/2020 19TuesdayNo 9 40 14 27 14.7 71
2/28/2020 20TuesdayNo 6 40 14 26 14.7 73
2/29/2020 21TuesdayNo 6 40 14 26 14.7 72
3/1/2020 22TuesdayNo 5 40 14 25 14.7 75
3/2/2020 6Sunday No 7 40 0 25 1.2 9
3/3/2020 6Sunday No 9 40 0 25 1.2 11
3/4/2020 6Sunday No 3 40 1 25 1.2 8
3/5/2020 6Sunday No 2 40 0 25 1.2 3
3/6/2020 6Sunday No 2 40 1 25 3 3
3/7/2020 17Sunday No 9 40 1 25 3 12
3/8/2020 17Sunday No 9 40 4 25 4.7 19
3/9/2020 17Sunday No 3 40 4 25 4.7 12
3/10/2020 17Sunday No 6 40 4 25 4.7 15
3/11/2020 6Sunday No 7 40 9 25 7.5 34
3/12/2020 6Sunday No 9 40 9 25 7.5 39
3/13/2020 6Sunday No 5 40 9 25 7.5 30
3/14/2020 6Monday No 5 40 12 25 10.1 36
3/15/2020 6Monday No 9 40 12 25 10.1 43
3/16/2020 6Monday No 3 40 12 25 10.1 33
3/17/2020 13Monday No 5 40 12 25 10.1 36
3/18/2020 13Monday No 9 40 12 25 10.1 43
3/19/2020 13Monday No 3 40 12 25 10.1 33
3/20/2020 6Monday No 5 40 12 25 12.1 43
3/21/2020 6Monday No 9 40 12 25 12.1 49
3/22/2020 6Monday No 3 40 12 25 12.1 40
3/23/2020 12Monday No 5 40 12 25 12.1 43
3/24/2020 12Monday No 9 40 12 25 12.1 49
3/25/2020 12Monday No 3 40 12 25 12.1 40
3/26/2020 6Sunday No 5 40 14 25 14.7 56
3/27/2020 7Sunday No 8 40 14 27 14.7 55
3/28/2020 8Sunday No 9 40 14 28 14.7 55
3/29/2020 9Sunday No 7 40 14 29 14.7 56
3/30/2020 10Sunday No 6 40 14 29 14.7 56
3/31/2020 11Sunday No 4 40 14 30 14.7 56
4/1/2020 12Sunday No 4 40 14 30 14.7 56
4/2/2020 13Sunday No 4 40 14 30 14.7 56
4/3/2020 14Sunday No 8 40 14 30 14.7 56
4/4/2020 15Sunday No 8 40 14 29 14.7 56
4/5/2020 16Sunday Yes 6 40 14 29 14.7 56
4/6/2020 17Sunday No 7 40 14 28 14.7 56
4/7/2020 18Sunday No 8 40 14 27 14.7 56
4/8/2020 19Sunday No 9 40 14 27 14.7 71
4/9/2020 20Sunday No 6 40 14 26 14.7 73
4/10/2020 21Sunday No 6 40 14 26 14.7 72
4/11/2020 22Sunday No 5 40 14 25 14.7 75
4/12/2020 6Monday No 5 40 14 25 14.7 56
4/13/2020 7Monday No 8 40 14 27 14.7 55
4/14/2020 8Monday No 9 40 14 28 14.7 55
4/15/2020 9Monday No 7 40 14 29 14.7 56
4/16/2020 10Monday No 6 40 14 29 14.7 56
4/17/2020 11Monday No 4 40 14 30 14.7 56
4/18/2020 12Monday No 4 40 14 30 14.7 56
4/19/2020 13Monday No 4 40 14 30 14.7 56
4/20/2020 14Monday No 8 40 14 30 14.7 56
4/21/2020 15Monday No 8 40 14 29 14.7 56
4/22/2020 16Monday Yes 6 40 14 29 14.7 56
4/23/2020 17Monday No 7 40 14 28 14.7 56
4/24/2020 18Monday No 8 40 14 27 14.7 56
4/25/2020 19Monday No 9 40 14 27 14.7 71
4/26/2020 20Monday No 6 40 14 26 14.7 73
4/27/2020 21Monday No 6 40 14 26 14.7 72
4/28/2020 22Monday No 5 40 14 25 14.7 75
4/29/2020 6TuesdayNo 5 40 14 25 14.7 56
4/30/2020 7TuesdayNo 8 40 14 27 14.7 55
5/1/2020 8TuesdayNo 9 40 14 28 14.7 55
5/2/2020 9TuesdayNo 7 40 14 29 14.7 56
5/3/2020 10TuesdayNo 6 40 14 29 14.7 56
5/4/2020 11TuesdayNo 4 40 14 30 14.7 56
5/5/2020 12TuesdayNo 4 40 14 30 14.7 56
5/6/2020 13TuesdayNo 4 40 14 30 14.7 56
5/7/2020 14TuesdayNo 8 40 14 30 14.7 56
5/8/2020 15TuesdayNo 8 40 14 29 14.7 56
5/9/2020 16TuesdayYes 6 40 14 29 14.7 56
5/10/2020 17TuesdayNo 7 40 14 28 14.7 56
5/11/2020 18TuesdayNo 8 40 14 27 14.7 56
5/12/2020 19TuesdayNo 9 40 14 27 14.7 71
5/13/2020 20TuesdayNo 6 40 14 26 14.7 73
5/14/2020 21TuesdayNo 6 40 14 26 14.7 72
5/15/2020 22TuesdayNo 5 40 14 25 14.7 75
5/16/2020 6Sunday No 7 40 0 25 1.2 9
5/17/2020 6Sunday No 9 40 0 25 1.2 11
5/18/2020 6Sunday No 3 40 1 25 1.2 8
5/19/2020 6Sunday No 2 40 0 25 1.2 3
5/20/2020 6Sunday No 2 40 1 25 3 3
5/21/2020 17Sunday No 9 40 1 25 3 12
5/22/2020 17Sunday No 9 40 4 25 4.7 19
5/23/2020 17Sunday No 3 40 4 25 4.7 12
5/24/2020 17Sunday No 6 40 4 25 4.7 15
5/25/2020 6Sunday No 7 40 9 25 7.5 34
5/26/2020 6Sunday No 9 40 9 25 7.5 39
5/27/2020 6Sunday No 5 40 9 25 7.5 30
5/28/2020 6Monday No 5 40 12 25 10.1 36
5/29/2020 6Monday No 9 40 12 25 10.1 43
5/30/2020 6Monday No 3 40 12 25 10.1 33
5/31/2020 13Monday No 5 40 12 25 10.1 36
6/1/2020 13Monday No 9 40 12 25 10.1 43
6/2/2020 13Monday No 3 40 12 25 10.1 33
6/3/2020 6Monday No 5 40 12 25 12.1 43
6/4/2020 6Monday No 9 40 12 25 12.1 49
6/5/2020 6Monday No 3 40 12 25 12.1 40
6/6/2020 12Monday No 5 40 12 25 12.1 43
6/7/2020 12Monday No 9 40 12 25 12.1 49
6/8/2020 12Monday No 3 40 12 25 12.1 40
6/9/2020 6Sunday No 5 40 14 25 14.7 56
6/10/2020 7Sunday No 8 40 14 27 14.7 55
6/11/2020 8Sunday No 9 40 14 28 14.7 55
6/12/2020 9Sunday No 7 40 14 29 14.7 56
6/13/2020 10Sunday No 6 40 14 29 14.7 56
6/14/2020 11Sunday No 4 40 14 30 14.7 56
6/15/2020 12Sunday No 4 40 14 30 14.7 56
6/16/2020 13Sunday No 4 40 14 30 14.7 56
6/17/2020 14Sunday No 8 40 14 30 14.7 56
6/18/2020 15Sunday No 8 40 14 29 14.7 56
6/19/2020 16Sunday Yes 6 40 14 29 14.7 56
6/20/2020 17Sunday No 7 40 14 28 14.7 56
6/21/2020 18Sunday No 8 40 14 27 14.7 56
6/22/2020 19Sunday No 9 40 14 27 14.7 71
6/23/2020 20Sunday No 6 40 14 26 14.7 73
6/24/2020 21Sunday No 6 40 14 26 14.7 72
6/25/2020 22Sunday No 5 40 14 25 14.7 75
6/26/2020 6Monday No 5 40 14 25 14.7 56
6/27/2020 7Monday No 8 40 14 27 14.7 55
6/28/2020 8Monday No 9 40 14 28 14.7 55
6/29/2020 9Monday No 7 40 14 29 14.7 56
6/30/2020 10Monday No 6 40 14 29 14.7 56
7/1/2020 11Monday No 4 40 14 30 14.7 56
7/2/2020 12Monday No 4 40 14 30 14.7 56
7/3/2020 13Monday No 4 40 14 30 14.7 56
7/4/2020 14Monday No 8 40 14 30 14.7 56
7/5/2020 15Monday No 8 40 14 29 14.7 56
7/6/2020 16Monday Yes 6 40 14 29 14.7 56
7/7/2020 17Monday No 7 40 14 28 14.7 56
7/8/2020 18Monday No 8 40 14 27 14.7 56
7/9/2020 19Monday No 9 40 14 27 14.7 71
7/10/2020 20Monday No 6 40 14 26 14.7 73
7/11/2020 21Monday No 6 40 14 26 14.7 72
7/12/2020 22Monday No 5 40 14 25 14.7 75
7/13/2020 6TuesdayNo 5 40 14 25 14.7 56
7/14/2020 7TuesdayNo 8 40 14 27 14.7 55
7/15/2020 8TuesdayNo 9 40 14 28 14.7 55
7/16/2020 9TuesdayNo 7 40 14 29 14.7 56
7/17/2020 10TuesdayNo 6 40 14 29 14.7 56
7/18/2020 11TuesdayNo 4 40 14 30 14.7 56
7/19/2020 12TuesdayNo 4 40 14 30 14.7 56
7/20/2020 13TuesdayNo 4 40 14 30 14.7 56
7/21/2020 14TuesdayNo 8 40 14 30 14.7 56
7/22/2020 15TuesdayNo 8 40 14 29 14.7 56
7/23/2020 16TuesdayYes 6 40 14 29 14.7 56
7/24/2020 17TuesdayNo 7 40 14 28 14.7 56
7/25/2020 18TuesdayNo 8 40 14 27 14.7 56
7/26/2020 19TuesdayNo 9 40 14 27 14.7 71
7/27/2020 20TuesdayNo 6 40 14 26 14.7 73
7/28/2020 21TuesdayNo 6 40 14 26 14.7 72
7/29/2020 22TuesdayNo 5 40 14 25 14.7 75
7/30/2020 6Sunday No 7 40 0 25 1.2 9
7/31/2020 6Sunday No 9 40 0 25 1.2 11
8/1/2020 6Sunday No 3 40 1 25 1.2 8
8/2/2020 6Sunday No 2 40 0 25 1.2 3
8/3/2020 6Sunday No 2 40 1 25 3 3
8/4/2020 17Sunday No 9 40 1 25 3 12
8/5/2020 17Sunday No 9 40 4 25 4.7 19
8/6/2020 17Sunday No 3 40 4 25 4.7 12
8/7/2020 17Sunday No 6 40 4 25 4.7 15
8/8/2020 6Sunday No 7 40 9 25 7.5 34
8/9/2020 6Sunday No 9 40 9 25 7.5 39
8/10/2020 6Sunday No 5 40 9 25 7.5 30
8/11/2020 6Monday No 5 40 12 25 10.1 36
8/12/2020 6Monday No 9 40 12 25 10.1 43
8/13/2020 6Monday No 3 40 12 25 10.1 33
8/14/2020 13Monday No 5 40 12 25 10.1 36
8/15/2020 13Monday No 9 40 12 25 10.1 43
8/16/2020 13Monday No 3 40 12 25 10.1 33
8/17/2020 6Monday No 5 40 12 25 12.1 43
8/18/2020 6Monday No 9 40 12 25 12.1 49
8/19/2020 6Monday No 3 40 12 25 12.1 40
8/20/2020 12Monday No 5 40 12 25 12.1 43
8/21/2020 12Monday No 9 40 12 25 12.1 49
8/22/2020 12Monday No 3 40 12 25 12.1 40
\ No newline at end of file
...@@ -2,8 +2,10 @@ ...@@ -2,8 +2,10 @@
import pandas as pd import pandas as pd
# %% # %%
data = pd.read_csv('TravelTimePrediction\BusTravelData.csv') #data = pd.read_csv('../TravelTimePrediction\BusTravelData.csv')
from os.path import dirname, join
filename = join(dirname(__file__), "BusTravelData.csv")
data = pd.read_csv(filename)
# %% # %%
data['Day'].unique() data['Day'].unique()
...@@ -36,6 +38,8 @@ X = data.drop(['Date','Travel Time'],axis=1) ...@@ -36,6 +38,8 @@ X = data.drop(['Date','Travel Time'],axis=1)
# %% # %%
y = data['Travel Time'] y = data['Travel Time']
print("Python printing")
# %% [markdown] # %% [markdown]
# Train/test split # Train/test split
......
import networkx as nx
#from chart_studio import plotly as py
import random
#init_notebook_mode(connected=True)
route_177 = {
0:0,
1: 34,
2: 42,
3: 54,
4: 67,
5: 80,
6: 92,
7: 105,
8: 109,
9: 117,
10: 126,
11: 134,
12: 140,
13: 149,
14: 157,
15: 163,
}
route_176 = {
0:0,
1: 34,
2: 42,
3: 54,
}
route_8717 = {
0:0,
1: 20,
2: 20,
3: 20,
4: 20,
5: 40
}
map_test = {
0: {'pos': (6.911034627182109, 79.84918916006576), 'connections': [1,16], 'name' : 'Kollupitiya','type': 0,'routeNo': 177, 'hValue': 5},
1: {'pos': (6.911751932322411, 79.86194701315071), 'connections': [0,2], 'name' : 'Viharamahadevi Park', 'type': 0, 'routeNo': 177, 'hValue': 1},
2: {'pos': (6.911385550864001, 79.87682791026592), 'connections': [1,3], 'name' : 'House Of Fashion', 'type': 0, 'routeNo': 177, 'hValue': 1},
3: {'pos': (6.911031363415147, 79.88498429384545), 'connections': [2,4], 'name' : 'Castle Street', 'type': 0, 'routeNo': 177, 'hValue': 1},
4: {'pos': (6.908462881966912, 79.89338919261249), 'connections': [3,5], 'name' : 'Rajagiriya', 'type': 0, 'routeNo': 177, 'hValue': 1},
5: {'pos': (6.906663916178293, 79.90205413217801), 'connections': [4,6], 'name' : 'HSBC Rajagiriya', 'type': 0, 'routeNo': 177, 'hValue': 1},
6: {'pos': (6.90333333857459, 79.90747047529919), 'connections': [5,7], 'name' : 'Ethulkotte New', 'type': 0, 'routeNo': 177, 'hValue': 1},
7: {'pos': (6.903185701293392, 79.91168232658337), 'connections': [6,8], 'name' : 'Parliaent Junction', 'type': 0, 'routeNo': 177, 'hValue': 1},
8: {'pos': (6.902102452411621, 79.91741047710077), 'connections': [7,9], 'name' : 'Battaramulla Junction', 'type': 0, 'routeNo': 177, 'hValue': 1},
9: {'pos': (6.90431022366131, 79.92400480782847), 'connections': [8,10], 'name' : 'Ganahena', 'type': 0, 'routeNo': 177, 'hValue': 1},
10: {'pos': (6.906173952520986, 79.92862087153598), 'connections': [9,11], 'name' : 'Koswatta', 'type': 0, 'routeNo': 177, 'hValue': 1},
11: {'pos': (6.9084657304543455, 79.9383708894408), 'connections': [10,12], 'name' : 'Kotte-Bope', 'type': 0, 'routeNo': 177, 'hValue': 1},
12: {'pos': (6.9085023402918155, 79.94425286198016), 'connections': [11,13], 'name' : 'Thalahena Junction', 'type': 0, 'routeNo': 177, 'hValue': 1},
13: {'pos': (6.903962700873259, 79.95430199947661), 'connections': [12,14], 'name' : 'Malabe', 'type': 0, 'routeNo': 177, 'hValue': 1},
14: {'pos': (6.933539686667202, 79.85005389798111), 'connections': [15], 'name' : 'Fort_TR', 'type': 1, 'routeNo': 8717, 'hValue': 1},
15: {'pos': (6.923619774894732, 79.84965509086771), 'connections': [14,16], 'name' : 'Kompannavidiya_TR', 'type': 1, 'routeNo': 8717, 'hValue': 1},
16: {'pos': (6.911282166657041, 79.84821747831087), 'connections': [15,1,17], 'name' : 'Kollupitiya_TR', 'type': 1, 'routeNo': 8717, 'hValue': 1},
17: {'pos': (6.893710110662125, 79.85300590028642), 'connections': [16,18], 'name' : 'Bambalapitiya_TR', 'type': 1, 'routeNo': 8717, 'hValue': 1},
18: {'pos': (6.875030063532378, 79.85744793142631), 'connections': [17,19], 'name' : 'Wellawatte_TR', 'type': 1, 'routeNo': 8717, 'hValue': 1},
19: {'pos': (6.850915755796403, 79.8620969312958), 'connections': [18], 'name' : 'Dehiwala_TR', 'type': 1, 'routeNo': 8717, 'hValue': 1},
}
class Map:
def __init__(self, G):
self._graph = G
self.intersections = nx.get_node_attributes(G, "pos")
self.routeNo = nx.get_node_attributes(G, "routeNo")
self.type = nx.get_node_attributes(G, "type")
self.name = nx.get_node_attributes(G, "name")
self.roads = [list(G[node]) for node in G.nodes()]
def load_map_graph(map_dict):
G = nx.Graph()
for node in map_dict.keys():
G.add_node(node, pos=map_dict[node]['pos'], type=map_dict[node]['type'],routeNo=map_dict[node]['routeNo'],name=map_dict[node]['name'])
for node in map_dict.keys():
for con_node in map_dict[node]['connections']:
G.add_edge(node, con_node)
return G
def load_map_b(map_dict):
G = nx.Graph()
for node in map_dict.keys():
G.add_node(node, pos=map_dict[node]['pos'], type=map_dict[node]['type'],routeNo=map_dict[node]['routeNo'])
for node in map_dict.keys():
for con_node in map_dict[node]['connections']:
if map_dict[node]['type'] != 1:
continue
elif map_dict[con_node]['type'] != 1:
continue
else:
G.add_edge(node, con_node)
return G
#map for train
def load_map_t(map_dict):
G = nx.Graph()
for node in map_dict.keys():
G.add_node(node, pos=map_dict[node]['pos'], type=map_dict[node]['type'],routeNo=map_dict[node]['routeNo'])
for node in map_dict.keys():
for con_node in map_dict[node]['connections']:
if map_dict[node]['type'] == 1:
continue
elif map_dict[con_node]['type'] == 1:
continue
else:
G.add_edge(node, con_node)
return G
def load_map_test():
G = load_map_graph(map_test)
return Map(G)
def load_map_bus():
G = load_map_b(map_test)
return Map(G)
def load_map_train():
G = load_map_t(map_test)
return Map(G)
def main(paka,paka2):
return paka+12
\ No newline at end of file
from helpers import load_map_train, load_map_test, load_map_bus
ANSWERS = [
(1,5, 10, [5, 6, 7, 8, 9,10]),
(1,5, 5, [5]),
(1,3, 18, [3, 2, 1, 16, 17, 18]),
(1,14, 18, [14, 15, 16, 17, 18]),
(1,15, 2, [15, 16, 1, 2])
]
def test(path_planner_function):
print('testing started ---------------')
correct = 0
for mapval, start, goal, answer_path in ANSWERS:
if mapval == 3:
map = load_map_train()
elif mapval == 2:
map = load_map_bus()
else:
map = load_map_test()
path = path_planner_function(map, start, goal).path
if path == answer_path:
correct += 1
print("For start:", start,
"Goal: ", goal,
"Your path:", path,
"Correct: ", answer_path)
else:
print("Error Testing faild !!!" )
if correct == len(ANSWERS):
print("All tests pass ")
else:
print("Only passed", correct, "/", len(ANSWERS), "test cases")
\ No newline at end of file
...@@ -13,49 +13,49 @@ ...@@ -13,49 +13,49 @@
android:id="@+id/maps_section" android:id="@+id/maps_section"
android:name="com.google.android.gms.maps.SupportMapFragment"/> android:name="com.google.android.gms.maps.SupportMapFragment"/>
<!-- <com.google.android.material.textfield.TextInputLayout
android:id="@+id/search_destination"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="340dp"
android:layout_height="70dp"
android:layout_marginStart="30dp"
android:layout_marginTop="260dp"
app:boxBackgroundColor="#FFFFFF"
app:boxCornerRadiusBottomEnd="60px"
app:boxCornerRadiusBottomStart="60px"
app:boxCornerRadiusTopEnd="60px"
app:boxCornerRadiusTopStart="60px"
app:boxStrokeColor="#FFFFFF"
app:endIconMode="clear_text"
app:startIconTint="@color/white"
app:endIconTint="#FFFFFF"
android:shadowColor="#000000"
android:shadowDx="1.2"
android:shadowDy="1.2"
android:shadowRadius="1.5"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/sans_bold"
android:hint="Where to?" />
</com.google.android.material.textfield.TextInputLayout> -->
<ImageView <ImageView
android:id="@+id/imageView10" android:id="@+id/imageView10"
android:layout_width="508dp" android:layout_width="508dp"
android:layout_height="297dp" android:layout_height="297dp"
android:layout_marginStart="-60dp" android:layout_marginStart="-60dp"
android:layout_marginTop="572dp" android:layout_marginTop="520dp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/rectangle_16" /> app:srcCompat="@drawable/rectangle_16" />
<!-- <com.google.android.material.textfield.TextInputLayout
android:id="@+id/search_destination"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="340dp"
android:layout_height="70dp"
android:layout_marginStart="30dp"
android:layout_marginTop="260dp"
app:boxBackgroundColor="#FFFFFF"
app:boxCornerRadiusBottomEnd="60px"
app:boxCornerRadiusBottomStart="60px"
app:boxCornerRadiusTopEnd="60px"
app:boxCornerRadiusTopStart="60px"
app:boxStrokeColor="#FFFFFF"
app:endIconMode="clear_text"
app:startIconTint="@color/white"
app:endIconTint="#FFFFFF"
android:shadowColor="#000000"
android:shadowDx="1.2"
android:shadowDy="1.2"
android:shadowRadius="1.5"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/sans_bold"
android:hint="Where to?" />
</com.google.android.material.textfield.TextInputLayout> -->
<Button <Button
android:id="@+id/findbus" android:id="@+id/findbus"
android:layout_width="124dp" android:layout_width="124dp"
...@@ -63,7 +63,6 @@ ...@@ -63,7 +63,6 @@
android:layout_marginStart="140dp" android:layout_marginStart="140dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:backgroundTint="#262730" android:backgroundTint="#262730"
android:onClick="btnRetrieveLocation"
android:text="FIND " android:text="FIND "
app:cornerRadius="60px" app:cornerRadius="60px"
android:textSize="60px" android:textSize="60px"
...@@ -72,6 +71,7 @@ ...@@ -72,6 +71,7 @@
<ImageView <ImageView
android:id="@+id/imageView7" android:id="@+id/imageView7"
android:layout_width="539dp" android:layout_width="539dp"
...@@ -95,12 +95,27 @@ ...@@ -95,12 +95,27 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/current_location"
android:layout_width="340dp"
android:layout_height="59dp"
android:layout_marginStart="32dp"
android:layout_marginBottom="10dp"
android:fontFamily="@font/sans_italic"
android:textSize="19dp"
android:gravity="center"
android:textColorHint="@drawable/selector"
android:textAlignment="center"
android:background="@drawable/rounded_corner"
app:layout_constraintBottom_toTopOf="@+id/where_to"
app:layout_constraintStart_toStartOf="parent" />
<AutoCompleteTextView <AutoCompleteTextView
android:id="@+id/where_to" android:id="@+id/where_to"
android:layout_width="340dp" android:layout_width="340dp"
android:layout_height="59dp" android:layout_height="59dp"
android:layout_marginStart="32dp" android:layout_marginStart="32dp"
android:layout_marginBottom="30dp" android:layout_marginBottom="20dp"
android:hint="Where to" android:hint="Where to"
android:fontFamily="@font/sans_bold" android:fontFamily="@font/sans_bold"
android:textColorHint="@drawable/selector" android:textColorHint="@drawable/selector"
...@@ -108,9 +123,9 @@ ...@@ -108,9 +123,9 @@
android:completionThreshold="1" android:completionThreshold="1"
android:completionHint="Select a city" android:completionHint="Select a city"
android:background="@drawable/rounded_corner" android:background="@drawable/rounded_corner"
app:layout_constraintBottom_toTopOf="@+id/findbus" app:layout_constraintBottom_toTopOf="@+id/findbus"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
android:name="com.google.android.gms.maps.SupportMapFragment" android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".RetrieveBusMap" /> tools:context=".RetrieveBusMap" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.cardview.widget.CardView
android:id="@+id/bus_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="5dp"
android:layout_marginRight="8dp"
android:clickable="false"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"
app:cardCornerRadius="4dp"
app:cardUseCompatPadding="true"
app:contentPadding="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="100">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="60"
android:orientation="vertical">
<!-- <TextView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:fontFamily="@font/calibri"-->
<!-- android:text="1st"-->
<!-- android:textColor="#000000"-->
<!-- android:textStyle="bold" />-->
<ImageView
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:paddingLeft="-130dp"
android:src="@drawable/bus_icon" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="22dp"
android:fontFamily="@font/sans_bold"
android:text="117"
android:textAlignment="textStart"
android:textSize="20sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_weight="40"
android:gravity="center"
android:paddingRight="10dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/calibri"
android:text="Bus is near"
android:textAlignment="textEnd"
android:textColor="#8a8a8a" />
<TextView
android:id="@+id/TrackerL"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:fontFamily="@font/sans_bold"
android:text="Tracker Location"
android:textSize="18sp"
android:textStyle="bold"
android:textAlignment="textEnd"
/>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="57dp"
android:layout_below="@+id/mapsFrag"
android:layout_marginTop="504dp"
android:layout_weight="1">
<TextView
android:id="@+id/time_pred"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:fontFamily="@font/nunito_bold"
android:text="Time"
android:textAlignment="center"
android:gravity="center"
android:textColor="#191C22"
android:textSize="28sp"
android:textStyle="bold" />
<TextView
android:id="@+id/fair_calc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:fontFamily="@font/calibri"
android:text="Fare"
android:gravity="center"
android:textAlignment="center"
android:textColor="#f5a622"
android:textSize="24sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="27dp"
android:layout_below="@+id/mapsFrag"
android:layout_marginTop="566dp"
android:layout_weight="1">
<TextView
android:id="@+id/textView3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Bus Stops"
android:textAlignment="center"
android:textColor="#191C22"
android:drawableLeft="@drawable/bus_stop__5_"
android:gravity="center"
android:drawablePadding="20dp"
android:paddingHorizontal="120dp"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/tw"
android:layout_below="@+id/mapsFrag"
android:layout_marginTop="594dp"
android:layout_weight="1">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
</RelativeLayout>
<androidx.cardview.widget.CardView
android:id="@+id/cardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="2dp"
android:layout_marginRight="8dp"
android:clickable="true"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"
app:cardCornerRadius="4dp"
app:cardUseCompatPadding="true"
app:contentPadding="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="100">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="60"
android:orientation="vertical">
<!-- <TextView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:fontFamily="@font/calibri"-->
<!-- android:text="1st"-->
<!-- android:textColor="#000000"-->
<!-- android:textStyle="bold" />-->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:fontFamily="@font/calibri"
android:text="Kaduwela"
android:textColor="#4b4b4b"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/calibri"
android:text="2.5 KM"
android:textColor="#8a8a8a" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:fontFamily="@font/calibri"
android:text="4mins"
android:textAlignment="textEnd"
android:textColor="#b3b3b3" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:clickable="true"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"
app:cardCornerRadius="4dp"
app:cardUseCompatPadding="true"
app:contentPadding="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="100">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="60"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:fontFamily="@font/calibri"
android:text="Kothalawala"
android:textColor="#4b4b4b"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/calibri"
android:text="3.4 KM"
android:textColor="#8a8a8a" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:fontFamily="@font/calibri"
android:text="12mins"
android:textAlignment="textEnd"
android:textColor="#b3b3b3" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:clickable="true"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"
app:cardCornerRadius="4dp"
app:cardUseCompatPadding="true"
app:contentPadding="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="100">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="60"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:fontFamily="@font/calibri"
android:text="SLIIT"
android:textColor="#4b4b4b"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/calibri"
android:text="7.9 KM"
android:textColor="#8a8a8a" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:fontFamily="@font/calibri"
android:text="21mins"
android:textAlignment="textEnd"
android:textColor="#b3b3b3" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:clickable="true"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"
app:cardCornerRadius="4dp"
app:cardUseCompatPadding="true"
app:contentPadding="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="100">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="60"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:fontFamily="@font/calibri"
android:text="Pittugala"
android:textColor="#4b4b4b"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/calibri"
android:text="11.3 KM"
android:textColor="#8a8a8a" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:fontFamily="@font/calibri"
android:text="24mins"
android:textAlignment="textEnd"
android:textColor="#b3b3b3" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:clickable="true"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"
app:cardCornerRadius="4dp"
app:cardUseCompatPadding="true"
app:contentPadding="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="100">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="60"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:fontFamily="@font/calibri"
android:text="Malabe"
android:textColor="#4b4b4b"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/calibri"
android:text="12.2 KM"
android:textColor="#8a8a8a" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:fontFamily="@font/calibri"
android:text="27mins"
android:textAlignment="textEnd"
android:textColor="#b3b3b3" />
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</ScrollView>
</LinearLayout>
<fragment
android:id="@+id/mapsFrag"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="504dp"
android:layout_below="@+id/rvToolbar"
android:layout_weight="1" />
</FrameLayout>
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav_graph2"
app:startDestination="@id/First2Fragment">
<fragment
android:id="@+id/First2Fragment"
android:name="com.app.travelle.First2Fragment"
android:label="@string/first_fragment_label"
tools:layout="@layout/fragment_first2">
<action
android:id="@+id/action_First2Fragment_to_Second2Fragment"
app:destination="@id/Second2Fragment" />
</fragment>
<fragment
android:id="@+id/Second2Fragment"
android:name="com.app.travelle.Second2Fragment"
android:label="@string/second_fragment_label"
tools:layout="@layout/fragment_second2">
<action
android:id="@+id/action_Second2Fragment_to_First2Fragment"
app:destination="@id/First2Fragment" />
</fragment>
</navigation>
\ No newline at end of file
<resources> <resources>
<dimen name="fab_margin">48dp</dimen> <dimen name="fab_margin">48dp</dimen>
</resources> </resources>
\ No newline at end of file \ No newline at end of file
<resources> <resources>
<dimen name="fab_margin">200dp</dimen> <dimen name="fab_margin">200dp</dimen>
</resources> </resources>
\ No newline at end of file \ No newline at end of file
<resources> <resources>
<dimen name="fab_margin">48dp</dimen> <dimen name="fab_margin">48dp</dimen>
</resources> </resources>
\ No newline at end of file \ No newline at end of file
<resources> <resources>
<dimen name="fab_margin">16dp</dimen> <dimen name="fab_margin">16dp</dimen>
<dimen name="activity_horizontal_margin">0dp</dimen> <dimen name="activity_horizontal_margin">0dp</dimen>
<dimen name="activity_vertical_margin">0dp</dimen> <dimen name="activity_vertical_margin">0dp</dimen>
</resources> </resources>
\ No newline at end of file \ No newline at end of file
...@@ -12,4 +12,6 @@ ...@@ -12,4 +12,6 @@
<string name="title_activity_homemap">homemap</string> <string name="title_activity_homemap">homemap</string>
<string name="title_activity_home_map">HomeMap</string> <string name="title_activity_home_map">HomeMap</string>
<string name="title_activity_retrieve_bus_map">RetrieveBusMap</string> <string name="title_activity_retrieve_bus_map">RetrieveBusMap</string>
<string name="title_activity_route">RouteActivity</string>
<string name="google_maps_key">AIzaSyA6byk50XLU3_WXUpsy7HGfpKbbrjwVlj8</string>
</resources> </resources>
\ No newline at end of file
...@@ -13,10 +13,13 @@ ...@@ -13,10 +13,13 @@
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item> <item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
</style> </style>
<style name="Theme.Travelle.NoActionBar"> <style name="Theme.Travelle.NoActionBar">
<item name="windowActionBar">false</item> <item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item> <item name="windowNoTitle">true</item>
</style> </style>
<style name="Theme.Travelle.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> <style name="Theme.Travelle.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Theme.Travelle.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> <style name="Theme.Travelle.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources> </resources>
\ No newline at end of file
buildscript { buildscript {
repositories { repositories {
// Make sure that you have the following two repositories // Make sure that you have the following two repositories
maven { url "https://chaquo.com/maven" }
} }
dependencies { dependencies {
classpath 'com.google.gms:google-services:4.3.14' classpath 'com.google.gms:google-services:4.3.14'
classpath "com.chaquo.python:gradle:13.0.0"
classpath "com.chaquo.python:gradle:13.0.0"
} }
...@@ -16,6 +17,7 @@ plugins { ...@@ -16,6 +17,7 @@ plugins {
id 'com.android.application' version '7.3.0' apply false id 'com.android.application' version '7.3.0' apply false
id 'com.android.library' version '7.3.0' apply false id 'com.android.library' version '7.3.0' apply false
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' version '2.0.1' apply false id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' version '2.0.1' apply false
id 'com.chaquo.python' version '13.0.0' apply false
} }
allprojects { allprojects {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment