\documentclass[cropmarks,frame,english]{idamasterthesis}

% for the outer frame
%\usepackage[a4,frame,center,info]{crop}

% For managing/defining colors
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}

% For selecting input encoding, font packages and language
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage{lmodern}%
\usepackage{ucs}
\usepackage[T1]{fontenc}
\selectlanguage{english}

% For raw text/code inputs
\usepackage{listings}
% Default settings for all languages
\lstset{numbers=left, frame=L,breaklines=true}
% My own language styles
\lstdefinestyle{matlab_script}{language=Matlab,
	keywordstyle=\bfseries\color{green!40!black},
    identifierstyle=\color{blue},
    commentstyle=\itshape\color{purple!40!black}
}
\lstdefinestyle{c++_script}{language=C++,
	basicstyle=\ttfamily,
    keywordstyle=\color{blue}\ttfamily,
    identifierstyle=\color{BlueViolet},
    stringstyle=\color{Fuchsia}\ttfamily,
    commentstyle=\color{green}\ttfamily,
    morecomment=[l][\color{magenta}]{\#},
    emph={int,char,double,float,unsigned,string},
    emphstyle={\color{blue}}
}


% fix for URL references
\usepackage[hyphens]{url}
\usepackage[colorlinks=true,urlcolor=blue,linkcolor=black,citecolor=black,filecolor=black]{hyperref}
\hypersetup{breaklinks=true}
\urlstyle{same}
\Urlmuskip=0mu plus 1mu\relax

% for importing pdfs
\usepackage{pdfpages}

% reference handling
\usepackage[nottoc]{tocbibind}
\usepackage[square,comma,numbers]{natbib}
% basically the same options as in natbib include
% works for regular bib as well + more specific control.
\bibpunct{[}{]}{;}{n}{,}{,}

% for bib when using other languages than english
%\usepackage[fixlanguage]{babelbib}
%\selectbiblanguage{swedish}

% glossary
\usepackage[nomain,acronym,toc]{glossaries}
 
% Generate the glossary
\makeglossaries
\usepackage[xindy]{imakeidx}
\makeindex
% Load my .tex file with the glossary entries
\loadglsentries{glossary}

% Appendices
\usepackage[toc,page]{appendix}

% Layout handling
\usepackage{chngpage}
\usepackage{fancyhdr}
\usepackage{amsfonts}
\usepackage{float}

% For importing graphics
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}

% for using frames and other cool stuff on \includegraphic
\usepackage[export]{adjustbox}
\usepackage[section]{placeins}

% Math
\usepackage{amsmath}
\usepackage{mathcomp}

% Chemistry
\usepackage[version=3]{mhchem}

% fix for chapter layout
\usepackage{titlesec}
\titleformat{\chapter}{\normalfont\huge}{\thechapter.}{20pt}{\huge\bf}

% fix fancyhdr warning
\setlength{\headheight}{12.38004pt}

% fancyhdr settings
\renewcommand{\sectionmark}[1]{\leftmark{\thesection.\ #1}}
\renewcommand{\chaptermark}[1]{\rightmark{\thechapter.\ #1}}
\fancyhf{}
\fancyhead[RE]{\leftmark}
\fancyhead[LO]{\rightmark}
\fancyfoot[C]{\thepage}

% For rotating pictures
\usepackage{wrapfig}
\usepackage{lscape}
\usepackage{rotating}
\usepackage{epstopdf}

% for drawing graphs
\usepackage{tikz}
\usepackage{verbatim}
% select libraries within tikz
\usetikzlibrary{shapes,arrows}

% default arrows
\tikzset{
    %Define standard arrow tip
    >=stealth',
    %Define style for boxes
    punkt/.style={
           rectangle,
           rounded corners,
           draw=black, very thick,
           text width=6.5em,
           minimum height=2em,
           text centered},
    % Define arrow style
    pil/.style={
           ->,
           thick,
           shorten <=2pt,
           shorten >=2pt,}
}

% Picture of stack-able discs
\tikzset{
  pics/.cd,
  disc/.style = {
    code = {
      \fill [white] ellipse [x radius = 2, y radius = 2/3];
      \path [left color = black!50, right color = black!50,
        middle color = black!25] 
        (-2+.05,-1.1) arc (180:360:2-.05 and 2/3-.05*2/3) -- cycle;
      \path [top color = black!25, bottom color = white] 
        (0,.05*2/3) ellipse [x radius = 2-.05, y radius = 2/3-.05*2/3];
      \path [left color = black!25, right color = black!25,
        middle color = white] (-2,0) -- (-2,-1) arc (180:360:2 and 2/3)
        -- (2,0) arc (360:180:2 and 2/3);
      \foreach \r in {225,315}
        \foreach \i [evaluate = {\s=30;}] in {0,2,...,30}
          \fill [black, fill opacity = 1/50] 
            (0,0) -- (\r+\s-\i:2 and 2/3) -- ++(0,-1) 
            arc (\r+\s-\i:\r-\s+\i:2 and 2/3) -- ++(0,1) -- cycle;
      \foreach \r in {45,135}
        \foreach \i [evaluate = {\s=30;}] in {0,2,...,30}
          \fill [black, fill opacity = 1/50] 
            (0,0) -- (\r+\s-\i:2 and 2/3) 
            arc (\r+\s-\i:\r-\s+\i:2 and 2/3)  -- cycle;
    }
  },
  disc bottom/.style = {
    code = {
      \foreach \i in {0,2,...,30}
        \fill [black, fill opacity = 1/60] (0,-1.1)
          ellipse [x radius = 2+\i/40, y radius = 2/3+\i/60];
      \path pic {disc};
    }
  }
}


% General document commands
\title{exjobb}
\author{Rasmus Holm}
\selectlanguage{english}

% Document specific commands
\titleenglish{Energy-Efficient Mobile Communication with Cached Signal Maps}
\examiner{Simin Nadjm-Tehrani}
\supervisor{Ekhiotz Jon Vergara Alonso}
\degreesubject{Computer Engineering}
\keywords{energy consumption, signal map, RSSI, energy estimation}

% \publicationmonth{PUBMONTH}
% \publicationyear{PUBYEAR}
% \isbn{ISBN}
% \thesisnumber{THESISNUMBER}
% \thesisyearnumber{THESISYEARNUMBER}
% \abstract{ABSTRACT}
% \dateofpublication{DATEOFPUBLICATION}
% \supportedby{SUPPORTEDBY}

% \division{DIVISION}
% \divisionshort{DIVISIONSHORT}
\titlebibpage{Energy-Efficient Mobile Communication with Cached Signal Maps}

% \degreetype{teknologie}
% \presentationplace{PRESENTATIONPLACE}
% \presentationhouse{PRESENTATIONHOUSE}
% \presentationdate{PRESENTATIONDATE}
% \presentationtime{PRESENTATIONTIME}
% \degreesubject{DEGREESUBJECT}
% \degreesubjectswedish{DEGREESUBJECTSWEDISH}
% \facultyexaminername{OPPONENT NAME}
% \facultyexaminertitle{OPPONENT TITEL}
% \facultyexamineraddress{OPPONENT ADDRESS}
% \thesisurl{http://XXX}
% \departmentseries{DEPARTMENTSERIES No. XXX}
\abstract{
In the last decade the development of mobile devices has grown massively and with an increasing amount of mobile applications. Most of these applications rely on data exchanges between the mobile device and a service provider. Data communication over cellular networks is expensive for the mobile device, especially when the received signal strength (\gls{rss}) is low. This thesis focuses on generating a signal map for third generation cellular communication (\gls{3g}) which can be stored locally at the mobile device, and can be used for avoiding transmission in bad signal strength areas.
}

\begin{document}

\makeintropages

\include{chapter_1/introduction}
\include{chapter_2/background}
\include{constructing_a_signal_map/init}
\include{energy_estimation/init}
\include{presentation_visualization/init}
\include{evaluation/init}
\include{closing/init}

% Set the format of the bibliography entries
\bibliographystyle{IEEEtranN}
% load my .bib files
\bibliography{references,signal_map,algorithm,energy_estimation,background,presentation_visualization}

% set appendix headers
\renewcommand{\chaptermark}[1]{\markright{appendix\ \thechapter.\ #1}}
\fancyhf{}
\fancyhead[RE]{\MakeUppercase{\rightmark}}
\fancyhead[LO]{\MakeUppercase{\rightmark}}
\fancyfoot[C]{\thepage}

\include{appendices/list}

\end{document}