\begin{algorithm}
        \caption{Act-Distribution}
        \label{alg:act_distribution}
		\begin{algorithmic}[1]
        \Require 
            \Statex $K$, set of POI Type profiles
			\Statex $sub$, a sub-stop
	    \State $A$ = empty dictionary;
        \State $Type$ = empty dictionary;
        \State $Time$ = empty dictionary;
        \State $Day$ = empty dictionary;
        
        \For {($i$ = 0; $i$ < $K$.size(); $i$++)}
			\State $k$ = $K$.get(i);
			\If {$k.type$ == $sub.poi.type$}
            	\State $Type[k.activity]$ += $k.frequency$;
                \State $start\_time$ = $sub\_stop.time.start$;
                \State $end\_time$ = $sub\_stop.time.end$;
				\State $day$ = $sub\_stop.day$;
				\If {$day$ == $k$.day}
                	\State $Day[k.activity]$ += $k.frequency$;
                \EndIf
                
				\If {$start\_time$ $\leqslant$ $k$.time $\leqslant$ $end\_time$}
                	\State $Time[k.activity]$ += $k.frequency$;
                \EndIf
            \EndIf
		\EndFor
        
        \For {($i$ = 0; $i$ < $Type$.keys().size(); $i$++)}
        	\State $activity$ = $Type$.keys()[i];
            \State $Day[activity]$ = $Day[activity]$ / $Type[activity]$;
			\State $Time[activity]$ = $Time[activity]$ / $Type[activity]$;
            \State $A[activity]$ = $Time[activity]$ * $Day[activity]$;
        \EndFor \\
		\Return $A$
\end{algorithmic}
\end{algorithm}