From 42bdf894f20c3faa3d0d5801dad5fdbe0cf65e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 19 May 2021 22:57:47 +0300 Subject: [PATCH] adjusted size and compactness index --- mj-msc.tex | 35 ++++++++++++++++++++++++++++++++--- wm.sql | 4 ++-- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/mj-msc.tex b/mj-msc.tex index 2f837fc..8f64481 100644 --- a/mj-msc.tex +++ b/mj-msc.tex @@ -458,7 +458,7 @@ bends need to be checked. \subsection{Attributes of a Single Bend} -Compactness Index $cmp$ is "the ratio of the area of the polygon over the +\textsc{Compactness Index} is "the ratio of the area of the polygon over the circle whose circumference length is the same as the length of the circumference of the polygon" \cite{wang1998line}. We assume the area of the circle is meant. Given a bend, its compactness index is calculated as follows: @@ -486,10 +486,39 @@ circle is meant. Given a bend, its compactness index is calculated as follows: \end{enumerate} +Other than that, once this section is implemented, each bend will have a list +of properties, upon which actions later will be performed. + \subsection{Shape of a Bend} +This section introduces \textsc{adjusted size}, which trivially derives from +\textsc{compactness index} $cmp$ and shape's area $A$: + +\[ + adjsize = \frac{0.75 A}{cmp} +\] + +Adjusted size becomes necessary later to compare bends with each other, and +find out similar ones. + \subsection{The Context of a Bend: Isolated and Similar Bends} +To find out whether two bends are similar, they are compared by 3 components: + +\begin{enumerate} + \item \textsc{Adjusted Size} + \item \textsc{Compactness index} + \item Baseline length +\end{enumerate} + +These 3 components represent a point in the 3-dimensional space, and Euclidean +distance $d$ between those is calculated to differentiate between bends $p$ and +$q$: + +\[ + d(p,q) = \sqrt{(adjsize_p - adjsize_q)^2 + (cmp_p - cmp_q)^2 + (baseline_p - baseline_q)^2} +\] + \subsection{Elimination Operator} \subsection{Combination Operator} @@ -524,8 +553,8 @@ We strongly believe in the ability to reproduce the results is critical for any This was tested on Linux Debian 11 with upstream packages only. -\subsection{Algorithm code listings} -\inputminted[fontsize=\small]{postgresql}{wm.sql} +%\subsection{Algorithm code listings} +%\inputminted[fontsize=\small]{postgresql}{wm.sql} \end{appendices} \end{document} diff --git a/wm.sql b/wm.sql index d3b0333..12a5ae9 100644 --- a/wm.sql +++ b/wm.sql @@ -353,8 +353,8 @@ begin -- area of the circle. So here goes: -- 1. get polygon area P. -- 2. get polygon perimeter = u. Pretend it's our circle's circumference. - -- 3. get A (area) of the circle from u: A = (u^2)/(4*pi) - -- 4. divide P by A: cmp = P/A = P/((u^2)*4*pi) = 4*pi*P/u^2 + -- 3. get A (area) of the circle from u: A = u^2/(4pi) + -- 4. divide P by A: cmp = P/A = P/(u^2/(4pi)) = 4pi*P/u^2 res.area = st_area(polygon); res.cmp = fourpi*res.area/(st_perimeter(polygon)^2); if res.cmp > 0 then