diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 6dcf2c5..55d4f9d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -6,7 +6,8 @@ { "label": "Compile thesis", "type": "shell", - "command": "latexmk -pdf thesis.tex article.tex && latexmk -pdf -c thesis.tex article.tex" + "command": "latexmk -pdf thesis.tex article.tex && latexmk -pdf -c thesis.tex article.tex", + "problemMatcher": [] } ] } \ No newline at end of file diff --git a/BAB1/art_pendahuluan.tex b/BAB1/art_pendahuluan.tex new file mode 100644 index 0000000..e69de29 diff --git a/BAB4/art_metode.tex b/BAB4/art_metode.tex new file mode 100644 index 0000000..5355702 --- /dev/null +++ b/BAB4/art_metode.tex @@ -0,0 +1,108 @@ + + +Penentuan koordinat tentangga dapat ditemukan dengang mengubah koordinat polar menjadi koordinat kartesian. +Koordinat polar membutuhkan panjang $d_a$, dan sudut $\alpha$. +Panjang $d_a$ adalah variable yang didapat dari sensor yang memberikan nilai jarak dari robot $A$ ke robot $B$, +akan tetapi untuk mendapatkan koordinat polar, pengukuran sudu $\alpha$ tidak tersedia. +Algoritama yang ditawarkan memanfaatkan hukum \textit{cosinus} pada segitiga untuk mendapatkan sudut tersebut. + +\begin{figure} + \centering + \includegraphics[scale=.5]{BAB3/img/estimate_coordinate.png} + \caption{Strategi Penentuan Koordinat} + \label{fig:strategiPenentuanKoordinat} +\end{figure} + +Dapat diperhatikan pada gambar~\ref{fig:strategiPenentuanKoordinat} untuk gambaran strateginya. +Robot $B \in \tetangga_A$, adalah tetangga dari robot $A$. +Pertama-tama, sebelum robot $A$ bergerak, disimpan terlebih dahulu nilai $d_a$, +atau dinotasikan dengan $d_a[k]$ sebagai jarak sebelum bergerak. +Lalu robot $A$ berjalan secara random kesegala arah dengan jarak $l_a$. +Disimpan kembali nilai jara $d_a$, atau dinotasikan dengan $d_a[k+1]$. +Setalah itu dapat ditentukan sudut $\alpha[k+1]$ +\begin{align} + d_a[k]^2 & = d_a[k+1]^2 + l_a^2 + 2 d_a[k+1] l_a \cos{(\alpha[k+1])} \\ + \alpha[k+1] & = cos^{-1}\Bigg( \frac{l_a^2 + d_a[k+1]^2 -d_a[k]^2}{2d_a[k+1]l_a} \Bigg) + \label{eq:algo_getAngle} +\end{align} +Sebelum $\alpha[k+1]$ digunakan, jarak $d_a[k+1]$ dan $d_a[k]$ berpengaruh dalam penentuan koordinat. +Sehingga diperlukan sedikit algoritma +\begin{align} + \alpha_i= + \begin{cases} + \alpha[k+1] & ,d_a[k+1] > d_a[k] \\ + 180-\alpha[k+1] & ,d_a[k+1] < d_a[k] + \end{cases}.\label{eq:init_relatif_koordinat} +\end{align} + +Strategi pada gambar~\ref{fig:strategiPenentuanKoordinat} hanya berlaku apabila target ukur berhenti. Apabila dinotasikan koordinat $(x_B^A, y_B^A)$ adalah koordinat relatif robot $B$ terhadap $A$, +maka $(\dot{x}_B^A, \dot{y}_B^A)$ adalah notasi kecepatan koordinat dari robot B. +Dengan menggunakan persamaan~\eqref{eq:kinematika_robot} untuk menyelesaikan koordinat dalam +keadaan robot $B$ bergerak, yaitu mengirimkan informasi kecepatan koordinatnya +ke robot $A$. Lalu robot $A$ dapat mengkalkulasi koordinat relatif dengan persamaan berikut +\begin{align} + \alpha[k+1] & = \alpha[k]+tan^{-1} \Big[ \frac{\dot{x}_B^A}{\dot{y}_B^A} \Big] +\end{align} +dimana kondisi inisial adalah $\alpha[k] = \alpha_i$ diperoleh dari hasil strategi pada persamaan~\eqref{eq:init_relatif_koordinat}. +Dengan memanfaatkan kedua strategi tersebut dapat digunakan untuk +mengkalkulasi koordinat robot $B$ relatif terhadap robot $A$ +\begin{align} + x_B^A = \begin{bmatrix} + x_B = d_a[k]\cos \alpha[k] \\ + y_B = d_a[k]\sin \alpha[k] + \end{bmatrix} +\end{align} +Dalam strategi ini akan terjadi ketidak akuratan dalam pengukuran apabila target ukur +berada pada sudut $90^\circ$. +Akan tetapi, \kutip{Cao2007} sudah menjelaskan mengenai kriteria posisi agent ketika dalam kondisi inisial. +Yaitu semua agent tidak berada pada kondisi sejajar secara koordinat global. + +\begin{algorithm} + \DontPrintSemicolon + \KwInput{ + Integer $l_a>0$, + $\tetangga_i=getConnectionRobot()$, } + \KwOutput{$x_i^j$} + + \If{isInisilised() == false}{ + \tcc{inisialisasi} + \tcc{getRandomDirection() akan mengembalikan sudur random antara 0 - 360} + $dir = getRandomDirection()$\; + $d_{before} = getDistanceFromSensor(\tetangga_i)$\; + $r = \begin{bmatrix} + l_a \cos(dir) \\ + l_a \sin(dir) + \end{bmatrix}$\; + + \tcc{Menjalankan robot hingga mencapai setpoint} + \While{isSetpointReached()}{ + $runRobotToSetpoint(r)$\; + } + + \tcc{Mengambil jarak setelah robot mencapai setpoint} + $d_{after} = getDistanceFromSensor(\tetangga_i)$\; + + \tcc{Mengkalkulasi sudut} + $ang = cos^{-1}\Bigg[ \frac{l_a^2 + d_{after}^2 -d_{before}^2}{2d_{before}l_a} \Bigg]$\; + } + \Else{ + \tcc{mendapatkan infromasi state dari tetangga} + $\begin{bmatrix} + \dot{x}_B^A \\ \dot{y}_B^A + \end{bmatrix} = getState()$ \; + $ang = \alpha[k]+tan^{-1} \Big[ \frac{\dot{x}_B^A}{\dot{y}_B^A} \Big]$ \; + } + + \If{$d_{before} + + + + + + + + + + + + + + + + + + + + + + + +]> + + + latex + + article.aux + article-blx.bib + + + article.bbl + + + blx-dm.def + blx-compat.def + blx-bibtex.def + biblatex.def + standard.bbx + authoryear.bbx + authoryear-icomp.bbx + authoryear-icomp.cbx + biblatex.cfg + english.lbx + + + + bibtex + + bibtex + + article + + + article.aux + + + article.bbl + + + article.bbl + + + article.aux + article-blx.bib + + + OTHER/references.bib + + + biblatex.bst + + + diff --git a/article.tex b/article.tex index 56d2fce..5b52f74 100644 --- a/article.tex +++ b/article.tex @@ -21,45 +21,12 @@ \documentclass[twoside,twocolumn]{article} +\usepackage{uithesis} \usepackage{blindtext} % Package to generate dummy text throughout this template -\usepackage[sc]{mathpazo} % Use the Palatino font -\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs -\linespread{1.05} % Line spacing - Palatino needs more space between lines -\usepackage{microtype} % Slightly tweak font spacing for aesthetics - -\usepackage[english]{babel} % Language hyphenation and typographical rules - -\usepackage[hmarginratio=1:1,top=32mm,columnsep=20pt]{geometry} % Document margins -\usepackage[hang, small,labelfont=bf,up,textfont=it,up]{caption} % Custom captions under/above floats in tables or figures -\usepackage{booktabs} % Horizontal rules in tables - -\usepackage{lettrine} % The lettrine is the first enlarged letter at the beginning of the text - -\usepackage{enumitem} % Customized lists -\setlist[itemize]{noitemsep} % Make itemize lists more compact - -\usepackage{abstract} % Allows abstract customization -\renewcommand{\abstractnamefont}{\normalfont\bfseries} % Set the "Abstract" text to bold -\renewcommand{\abstracttextfont}{\normalfont\small\itshape} % Set the abstract itself to small italic text - -\usepackage{titlesec} % Allows customization of titles -\renewcommand\thesection{\Roman{section}} % Roman numerals for the sections -\renewcommand\thesubsection{\roman{subsection}} % roman numerals for subsections -\titleformat{\section}[block]{\large\scshape\centering}{\thesection.}{1em}{} % Change the look of the section titles -\titleformat{\subsection}[block]{\large}{\thesubsection.}{1em}{} % Change the look of the section titles - -\usepackage{fancyhdr} % Headers and footers -\pagestyle{fancy} % All pages have headers and footers -\fancyhead{} % Blank out the default header -\fancyfoot{} % Blank out the default footer -\fancyhead[C]{Running title $\bullet$ May 2016 $\bullet$ Vol. XXI, No. 1} % Custom header text -\fancyfoot[RO,LE]{\thepage} % Custom footer text - -\usepackage{titling} % Customizing the title section - -\usepackage{hyperref} % For hyperlinks in the PDF - +\addbibresource{OTHER/references.bib} +\input{laporan_setting} +\include{hype.indonesia} %---------------------------------------------------------------------------------------- % TITLE SECTION %---------------------------------------------------------------------------------------- @@ -96,85 +63,81 @@ % ARTICLE CONTENTS %---------------------------------------------------------------------------------------- -\section{Introduction} +\section{Pendahuluan} \lettrine[nindent=0em,lines=3]{L} orem ipsum dolor sit amet, consectetur adipiscing elit. -\blindtext % Dummy text - -\blindtext % Dummy text +\include{BAB1/art_pendahuluan} +% \blindtext % Dummy text +% \blindtext % Dummy text %------------------------------------------------ -\section{Methods} +\section{Metode} +\include{BAB4/art_metode} +% Maecenas sed ultricies felis. Sed imperdiet dictum arcu a egestas. +% \begin{itemize} +% \item Donec dolor arcu, rutrum id molestie in, viverra sed diam +% \item Curabitur feugiat +% \item turpis sed auctor facilisis +% \item arcu eros accumsan lorem, at posuere mi diam sit amet tortor +% \item Fusce fermentum, mi sit amet euismod rutrum +% \item sem lorem molestie diam, iaculis aliquet sapien tortor non nisi +% \item Pellentesque bibendum pretium aliquet +% \end{itemize} +% \blindtext % Dummy text -Maecenas sed ultricies felis. Sed imperdiet dictum arcu a egestas. -\begin{itemize} -\item Donec dolor arcu, rutrum id molestie in, viverra sed diam -\item Curabitur feugiat -\item turpis sed auctor facilisis -\item arcu eros accumsan lorem, at posuere mi diam sit amet tortor -\item Fusce fermentum, mi sit amet euismod rutrum -\item sem lorem molestie diam, iaculis aliquet sapien tortor non nisi -\item Pellentesque bibendum pretium aliquet -\end{itemize} -\blindtext % Dummy text - -Text requiring further explanation\footnote{Example footnote}. +% Text requiring further explanation\footnote{Example footnote}. %------------------------------------------------ -\section{Results} +\section{Hasil} +\include{BAB5/art_hasil} -\begin{table} -\caption{Example table} -\centering -\begin{tabular}{llr} -\toprule -\multicolumn{2}{c}{Name} \\ -\cmidrule(r){1-2} -First name & Last Name & Grade \\ -\midrule -John & Doe & $7.5$ \\ -Richard & Miles & $2$ \\ -\bottomrule -\end{tabular} -\end{table} +% \begin{table} +% \caption{Example table} +% \centering +% \begin{tabular}{llr} +% \toprule +% \multicolumn{2}{c}{Name} \\ +% \cmidrule(r){1-2} +% First name & Last Name & Grade \\ +% \midrule +% John & Doe & $7.5$ \\ +% Richard & Miles & $2$ \\ +% \bottomrule +% \end{tabular} +% \end{table} -\blindtext % Dummy text +% \blindtext % Dummy text -\begin{equation} -\label{eq:emc} -e = mc^2 -\end{equation} +% \begin{equation} +% \label{eq:emc} +% e = mc^2 +% \end{equation} -\blindtext % Dummy text +% \blindtext % Dummy text %------------------------------------------------ -\section{Discussion} +\section{Diskusi} +\include{BAB5/art_diskusi} -\subsection{Subsection One} +% \subsection{Subsection One} -A statement requiring citation \cite{Figueredo:2009dg}. -\blindtext % Dummy text +% A statement requiring citation \cite{Figueredo:2009dg}. +% \blindtext % Dummy text -\subsection{Subsection Two} +% \subsection{Subsection Two} -\blindtext % Dummy text +% \blindtext % Dummy text %---------------------------------------------------------------------------------------- % REFERENCE LIST %---------------------------------------------------------------------------------------- -\begin{thebibliography}{99} % Bibliography - this is intentionally simple in this template - -\bibitem[Figueredo and Wolf, 2009]{Figueredo:2009dg} -Figueredo, A.~J. and Wolf, P. S.~A. (2009). -\newblock Assortative pairing and life history strategy - a cross-cultural - study. -\newblock {\em Human Nature}, 20:317--330. - -\end{thebibliography} +\renewcommand{\bibname}{\mybibname} +\section{\bibname} +\printbibliography[title=\bibname] %---------------------------------------------------------------------------------------- diff --git a/uithesis.sty b/uithesis.sty index 112e600..87b86b4 100644 --- a/uithesis.sty +++ b/uithesis.sty @@ -24,6 +24,54 @@ % Package %-----------------------------------------------------------------------------% +% +% Digunakan untuk branching documentclass +% +\usepackage{fetchcls} + +\@ifclassloaded{article} +{ + \usepackage[sc]{mathpazo} % Use the Palatino font + \usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs + \linespread{1.05} % Line spacing - Palatino needs more space between lines + \usepackage{microtype} % Slightly tweak font spacing for aesthetics + + \usepackage[english]{babel} % Language hyphenation and typographical rules + + \usepackage[hmarginratio=1:1,top=32mm,columnsep=20pt]{geometry} % Document margins + \usepackage[hang, small,labelfont=bf,up,textfont=it,up]{caption} % Custom captions under/above floats in tables or figures + \usepackage{booktabs} % Horizontal rules in tables + + \usepackage{lettrine} % The lettrine is the first enlarged letter at the beginning of the text + + \usepackage{enumitem} % Customized lists + \setlist[itemize]{noitemsep} % Make itemize lists more compact + + \usepackage{abstract} % Allows abstract customization + \renewcommand{\abstractnamefont}{\normalfont\bfseries} % Set the "Abstract" text to bold + \renewcommand{\abstracttextfont}{\normalfont\small\itshape} % Set the abstract itself to small italic text + + \usepackage{titlesec} % Allows customization of titles + \renewcommand\thesection{\Roman{section}} % Roman numerals for the sections + \renewcommand\thesubsection{\roman{subsection}} % roman numerals for subsections + \titleformat{\section}[block]{\large\scshape\centering}{\thesection.}{1em}{} % Change the look of the section titles + \titleformat{\subsection}[block]{\large}{\thesubsection.}{1em}{} % Change the look of the section titles + + % \usepackage{fancyhdr} % Headers and footers + % \pagestyle{fancy} % All pages have headers and footers + % \fancyhead{} % Blank out the default header + % \fancyfoot{} % Blank out the default footer + % \fancyhead[C]{Running title $\bullet$ May 2016 $\bullet$ Vol. XXI, No. 1} % Custom header text + % \fancyfoot[RO,LE]{\thepage} % Custom footer text + + \usepackage{titling} % Customizing the title section + + % \usepackage{hyperref} % For hyperlinks in the PDF + +} +{ + +} % % From The tocbibind package [author: Peter Wilson, Herries Press]: % The tocbibind package can be used to add document elements like a @@ -94,12 +142,22 @@ % document. The package must be called in the preamble of the document and % specified when called. % -\usepackage[paper=a4paper,headheight=0pt,left=4cm,top=3cm,right=3cm,bottom=3cm]{geometry} +\@ifclassloaded{report} +{ + \usepackage[paper=a4paper,headheight=0pt,left=4cm,top=3cm,right=3cm,bottom=3cm]{geometry} +} % % Digunakan untuk mengatur caption dalam dokumen. % -\usepackage[font=footnotesize,format=plain,labelfont=bf,up,textfont=up]{caption} + +\@ifclassloaded{report} +{ + \usepackage[font=footnotesize,format=plain,labelfont=bf,up,textfont=up]{caption} +} +{ + +} % digunakan untuk membuat sub gambar didalam figure % usepackage dilakukan setelah caption, @@ -150,7 +208,13 @@ % % Digunakan untuk nomor dengan format inline % -\usepackage[inline]{enumitem} +\@ifclassloaded{report} +{ + \usepackage[inline]{enumitem} +} +{ + +} % % Menggunakan biblatex untuk referensi % @@ -159,7 +223,21 @@ % Digunakan untuk menghasilkan tabel pseudocode % \usepackage{xcolor} -\usepackage[linesnumbered,ruled,vlined,algochapter]{algorithm2e} +\@ifclassloaded{report} +{ + \usepackage[linesnumbered,ruled,vlined,algochapter]{algorithm2e} +} +{ + +} + +\@ifclassloaded{article} +{ + \usepackage[linesnumbered,ruled,vlined]{algorithm2e} +} +{ + +} % % Digunakan untuk membuat mind map % @@ -197,7 +275,7 @@ % link page numbers in TOC -\makeatletter +% \makeatletter \def\contentsline#1#2#3#4{% \ifx\\#4\\% \csname l@#1\endcsname{#2}{#3}% @@ -216,24 +294,73 @@ {-3.5ex \@plus -1ex \@minus -.2ex}% {2.3ex \@plus.2ex}% {\large\bfseries}} -\makeatother +% \makeatother + + +% +% Atur header dan footer dalam dokumen. +% +\@ifclassloaded{report} +{ \setcounter{secnumdepth}{3} \setcounter{tocdepth}{3} -% -% Atur header dan footer dalam dokumen. -% -\renewcommand{\headrulewidth}{0.0pt} + \renewcommand{\headrulewidth}{0.0pt} + \fancyhf{} \fancyhf{} + \fancyhf{} + \fancyhf{} + \fancyhf{} + \fancyhead[L]{} \fancyhead[L]{} + \fancyhead[L]{} + \fancyhead[L]{} + \fancyhead[L]{} + \fancyhead[C]{} \fancyhead[C]{} + \fancyhead[C]{} + \fancyhead[C]{} + \fancyhead[C]{} + \fancyhead[R]{\thepage} \fancyhead[R]{\thepage} + \fancyhead[R]{\thepage} + \fancyhead[R]{\thepage} + \fancyhead[R]{\thepage} + \renewcommand{\headrulewidth}{0.0pt} \renewcommand{\headrulewidth}{0.0pt} + \renewcommand{\headrulewidth}{0.0pt} + \renewcommand{\headrulewidth}{0.0pt} + \renewcommand{\headrulewidth}{0.0pt} + \fancyfoot[R]{\footnotesize \bo{ }} \fancyfoot[R]{\footnotesize \bo{ }} + \fancyfoot[R]{\footnotesize \bo{ }} + \fancyfoot[R]{\footnotesize \bo{ }} + \fancyfoot[R]{\footnotesize \bo{ }} + \renewcommand{\footrulewidth}{0.0pt} \renewcommand{\footrulewidth}{0.0pt} -\pagestyle{fancy} + \renewcommand{\footrulewidth}{0.0pt} + \renewcommand{\footrulewidth}{0.0pt} + \renewcommand{\footrulewidth}{0.0pt} + \pagestyle{fancy} +} +{ + +} + +\@ifclassloaded{article} +{ + \pagestyle{fancy} % All pages have headers and footers + \fancyhead{} % Blank out the default header + \fancyfoot{} % Blank out the default footer + \fancyhead[C]{Running title $\bullet$ May 2016 $\bullet$ Vol. XXI, No. 1} % Custom header text + \fancyfoot[RO,LE]{\thepage} % Custom footer tex +} +{ + +} + %-----------------------------------------------------------------------------% @@ -367,7 +494,14 @@ \renewcommand{\listtablename}{Daftar Tabel} % % + +\@ifclassloaded{report} +{ \renewcommand{\chaptername}{BAB} +} +{ + +} % % \renewcommand{\figurename}{\bo{Gambar}}