\section{Use cases}

\subsection{The format of use cases}
Each use case begins with an introductory description. After this there are \textit{Starting conditions}, \textit{Ending conditions} and \textit{Error conditions} listed.
% A lengthy description of the actions involved concludes the use case. ??
Some of these cases are divided into subcases. The subcases contain the information that differs from the definition of the supercase.

\subsection{Defining a model}
The user defines a model that contains necessary information for calculating statistical probabilities, with or without the spatial dimension. The specifics of what the model may contain are described in requirements M2-M7 and M10-M11.

The model is stored in a text file, using a model definition language which will be defined in the design phase.

\subsubsection{Creating a new model}

\begin{tabular}[]{l p{10cm}}
\textbf{Starting conditions:} & None \\
\textbf{Ending conditions:} & A new valid model has been created.\\
\textbf{Error conditions:} & If the model is invalid, there will be consequences in the simulation. This use case does not check for the validity. \\
\end{tabular}

\subsubsection{Modifying an existing model}

\begin{tabular}[]{l p{10cm}}
\textbf{Starting conditions:} & A valid existing model is present \\
\textbf{Ending conditions:} & A different valid model has been created. \\
\textbf{Error conditions:} & If the model is invalid, there will be consequences in the simulation. This use case does not check for the validity. \\
\end{tabular}


%	-k�ytt�j� valitsee aiemmin m��ritellyn mallin ja muokkaa sit�.
%	-Lis��/poistaa muuttujan/riippuvuuden.
	
\subsection{Defining simulation parameters}
%The user chooses which initial values to apply for variables of a simulation run with a chosen model, how many iterations there will be (possibly for all the variables or in total), burn-in length, thinning factor, proposed distributions for the variables and/or variable update strategies. All of these, except the initial values, have defaults that are used in case that their corresponding parameter values are not set.

The user defines some of the simulation parameters defined in requirements S1-S12. Some of these, except the initial values, have defaults that are used in case that their corresponding parameter values are not set.

% Anni: Paitsi ettei kaikilla ole, esim. alkuarvoja ei tarvitse generoida itse, jos niit� ei ole annettu. t. Marja

\

\begin{tabular}[]{l p{10cm}}
\textbf{Starting conditions:} & A valid model has been chosen for simulation. \\
\textbf{Ending conditions:} & The simulation parameters are set. The simulation can be run with these parameters. \\
\textbf{Error conditions:} &  If parameters set incorrectly, problems may arise during the simulation. 
%Parameters not set are taken from default values.
\\
\end{tabular}


%k�ytt�j� m��ritt�� jotain simulaatioteknisi� parametreja.
%	-Iteraatioiden lkm (jokaiselle muuttujalle/ yht. P�ivitysten lkm)
%	-sis��najokierrosten m��r�
%	-ohennus (erikseen muuttujille)
%	-ehdotusjakaumat
%	-p�ivitysstrategiat
%	-parametreille alkuarvot



\subsection{Running the simulation}
The user has specified a model to the program, the parameters for the simulation and a file for output. The program starts the simulation with these parameters. The program reports on the progress of the run on-screen, while the actual values of the simulated parameters are directed to the files specified.

\begin{tabular}[]{l p{10cm}}
\textbf{Starting conditions:} & A model with either default simulation parameters or set simulation parameters is present. Files to direct the output to have been given. \\
\textbf{Ending conditions:} & The simulation is run. Output is produced to the given files. \\
\textbf{Error conditions:} & Invalid model or simulation parameters can cause inconsistent results or error messages.
%Inability to read or write to the files will cause failure of completion.
If the program is not able to read or write to a file, it will prompt the user for another file. \\
\end{tabular}

%k�ytt�j� antaa mallin, ohjelman parametrit ja tulostetiedoston (esim. tyhj�) ohjelmalle ja %ohjelma alkaa k�sitell� sit�.
%Ohjelma tulostaa ruudulle tietoja laskennan edistymisest�. 
%	-k�ytt�j� m��ritt�� tulostettavat muuttujat
%-mit� ohjelma tulostaa? Tulostettavat valitut muuttujat, kuinka usein?
