2architecture.tex 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. \section{Assumptions}\label{sec:assumptions}
  2. The following assumptions are made for the implementation of the node placement algorithm:
  3. \begin{itemize}
  4. \item There are no hyperedges.
  5. \item There are no port constraints.
  6. \item There are no labels.
  7. \item There are no cross-hierarchy edges.
  8. \item No edges over multiple layers (the previous phases should have added dummy nodes).
  9. \end{itemize}
  10. \section{Input File Format}\label{sec:inputFileFormat}
  11. The input to \appname is a JSON file.
  12. An example is displayed in figure~\ref{fig:json-example}.
  13. The structure is as follows:
  14. \begin{itemize}
  15. \item The object in the JSON file is a node.
  16. \item A node has the attributes that are displayed in table~\ref{table:node-attributes}.
  17. \item An edge has the attributes that are displayed in table~\ref{table:edge-attributes}.
  18. \end{itemize}
  19. For parsing the JSON file the JSON-java library~\cite{leary_json-java:_2018} is used.
  20. The classes for reading and writing those JSON files are displayed in figure~\ref{fig:io}.
  21. The internal representation of graphs is further explained in the section~\ref{sec:model}.
  22. \begin{figure}[tp]
  23. \centering
  24. \includegraphics[width=\linewidth]{img/IO.pdf}
  25. \caption{Class diagram of the IO package, containing utilities for reading and writing graphs.}
  26. \label{fig:io}
  27. \end{figure}
  28. \centering
  29. \begin{longtable}{|p{1.8cm}|p{2cm}|p{1.8cm}|p{8.5cm}|}
  30. \hline
  31. Attribute & Type & Optional & Explanation \\\hline\hline
  32. name & string & yes & If not omitted, this must be unique for a given parent node. \\\hline
  33. width & integer & yes & The minimum width of the node.
  34. The node can be wider if it contains other nodes that need more space. \\\hline
  35. height & integer & yes & The minimum height of the node.
  36. The node can be higher if it contains other nodes that need more space. \\\hline
  37. layers & list of lists of nodes & yes & The layers of nodes inside this node (Hierarchy). \\\hline
  38. edges & list of edges & yes & The edges between nodes whose parent node is this node. \\\hline
  39. \caption{Node Attributes}
  40. \label{table:node-attributes}
  41. \end{longtable}
  42. \begin{longtable}{|p{1.8cm}|p{2cm}|p{1.8cm}|p{8.5cm}|}
  43. \hline
  44. Attribute & Type & Optional & Explanation \\\hline\hline
  45. source & string & no & The name of the source of this edge.
  46. Must be a node with the same parent node as the node specified by the \enquote{target} attribute. \\\hline
  47. target & string & no & The name of the target of this edge.
  48. Must be a node with the same parent node as the node specified by the \enquote{source} attribute. \\\hline
  49. \caption{Edge Attributes}
  50. \label{table:edge-attributes}
  51. \end{longtable}
  52. \raggedright
  53. %\begin{figure}[tp]
  54. % \centering
  55. % \includegraphics[width=0.9\textwidth]{img/json.png}
  56. % \caption[Input file format]{Input file format illustrated as a HERM diagram}
  57. % \label{fig:iff}
  58. %\end{figure}
  59. \begin{figure}
  60. \begin{lstinputlisting}[language=json,emph={}]{img/graph.json}
  61. \end{lstinputlisting}
  62. \caption[Example Input File]{Example Input file that is understood by \appname.}
  63. \label{fig:json-example}
  64. \end{figure}
  65. \section{Internal graph representation, \enquote{Model}}\label{sec:model}
  66. One feature that is important to us, is to be able to work with hierarchical graphs (cf. chapter~\ref{ch:progress}).
  67. \section{TODO: More Class Diagrams}\label{sec:classDiagrams}
  68. \TODO{maybe even into appendix}