From: Natanael Adityasatria Date: Mon, 4 Jan 2016 08:12:49 +0000 (+0100) Subject: Added DSL explanation X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=f72a53452597ec32b8d296c78b5a0061ada5faee;p=des2015.git Added DSL explanation --- diff --git a/marsrover/document/marsrover.bib b/marsrover/document/marsrover.bib index 06bc9f7..34d0e2c 100644 --- a/marsrover/document/marsrover.bib +++ b/marsrover/document/marsrover.bib @@ -28,4 +28,15 @@ author = {LeJOS Team}, month = nov, year = {2015} +} + +@article{van2002domain, + title={Domain-specific language design requires feature descriptions}, + author={Van Deursen, Arie and Klint, Paul}, + journal={CIT. Journal of computing and information technology}, + volume={10}, + number={1}, + pages={1--17}, + year={2002}, + publisher={SRCE-Sveu{\v{c}}ili{\v{s}}ni ra{\v{c}}unski centar} } \ No newline at end of file diff --git a/marsrover/document/preamble.tex b/marsrover/document/preamble.tex index a9af18f..f197fa0 100644 --- a/marsrover/document/preamble.tex +++ b/marsrover/document/preamble.tex @@ -10,6 +10,7 @@ \usepackage{tabu} % For nicer automatic spanning tables \usepackage{float} % For better table and figure placement \usepackage[all]{xypic} % For nice diagrams +\usepackage{listings} % For source code listings \title{Autonomous sequentional mission execution on Mars with a multi-brick \textsc{lego}$^{\small\textcopyright}$ robot.} diff --git a/marsrover/document/robot.tex b/marsrover/document/robot.tex index f6d0323..7257135 100644 --- a/marsrover/document/robot.tex +++ b/marsrover/document/robot.tex @@ -178,6 +178,16 @@ mapping is described in \autoref{tab:mapping}. \end{table} \subsection{Domain Specific Language} +A domain-specific language (DSL) is a programming language or executable specification language that offers, through appropriate notations and abstractions, expressive power focused on, and usually restricted to, a particular problem domain~\cite{van2002domain}. The DSL is designed so that the MarsRover is able to have multiple behaviours and missions. In addition, each of the missions shall have multiple behaviours related to it, it means one registered behaviour can be used in multiple missions. +We implemented the StoppingExpression in the DSL so that every mission have a condition to stop. Once the condition is reached then the mission is accomplished. The behaviour may also have a StoppingExpression in its TakeAction function from Subsumption architecture. The example of the use StoppingExpression in a bahaviour is one behaviour to avoid left object can be activated if the condition (StoppingExpression) of the left touch sensor is pressed. Furthermore, the StoppingCondition can be whether the color which MarsRover are collected, the touch sensor is touched, the light sensor is activated, the distance of the MarsRover with a certain object is calculated, or if it finds one specific color. + +The use of the motors are defined in Action in the DSL. The combination of the motors can be used to represent a certain action, for example below code is used for the action to turn left. + +\begin{lstlisting} +right motor forward +left motor backward +wait 250 ms +\end{lstlisting} \subsection{Code Structure}