
\documentclass[letterpaper, 10pt, oneside, draft]{article}

%include the usecases package
\usepackage{usecases}

\begin{document}

%Sometimes it is a good idea to put domain objects in \texttt{}
%The template and the descriptions are based on the book Applying UML and Patterns: 
%An Introduction to Object-Oriented Analysis and Design and Iterative Development
%(3rd Edition) by Craig Larman.
\begin{usecase}

\addtitle{Use Case 1.1}{Add RateConstant} 

%Scope: the system under design
%\addfield{Scope:}{System-wide}

%Level: "user-goal" or "subfunction"
%\addfield{Level:}{User-goal}

%Primary Actor: Calls on the system to deliver its services.
\addfield{Primary Actor:}{End-User}

%Preconditions: What must be true on start and worth telling the reader?
%\addfield{Preconditions:}{}
%when multiple
\additemizedfield{Preconditions:}{
	\item An instance of MarkovModel is initialized 
	\item A RateConstant is initialized with valid parameters and stored in a smart\_ptr 
} 

%Postconditions: What must be true on successful completion and worth telling the reader
%\addfield{Postconditions:}{}
%when multiple
\additemizedfield{Postconditions:}{
	\item The RateConstant is added to MarkovModel's map\_of\_rates with its name as the key 
	\item MarkovModel is set to unvalidated
}

%Main Success Scenario: A typical, unconditional happy path scenario of success.
\addscenario{Main Success Scenario:}{
	\item The user calls MarkovModel's method addRateConstant() with a smart\_ptr to the initialized RateConstant as the only arguement 
	\item MarkovModel searches map\_of\_rates for a RateConstant with the same key value as the RateConstant to be added; none exist 
	\item The RateConstant is added to map\_of\_rates with its name as the key 
	}

%Extensions: Alternate scenarios of success or failure.
\addscenario{Extensions:}{
	\item[2a.] A RateConstant with the same name exists in map\_of\_rates:
		\begin{enumerate}
		\item[1.] System throws a runtime exception notifying the user that the RateConstant already exists 
		\item[2.] map\_of\_rates is unmodified 
		\end{enumerate}
}

%Miscellaneous: Such as open issues/questions
%\addfield{Open Issues:}{}

\end{usecase}

\pagebreak
\begin{usecase}

\addtitle{Use Case 1.2}{Add State} 

%Scope: the system under design
%\addfield{Scope:}{System-wide}

%Level: "user-goal" or "subfunction"
%\addfield{Level:}{User-goal}

%Primary Actor: Calls on the system to deliver its services.
\addfield{Primary Actor:}{End-User}

%Preconditions: What must be true on start and worth telling the reader?
%\addfield{Preconditions:}{}
%when multiple
\additemizedfield{Preconditions:}{
	\item An instance of MarkovModel is initialized 
	\item A State is initialized with valid parameters and stored in a smart\_ptr 
} 

%Postconditions: What must be true on successful completion and worth telling the reader
%\addfield{Postconditions:}{}
%when multiple
\additemizedfield{Postconditions:}{
	\item The State is added to MarkovModel's map\_of\_states with its name as the key 
	\item MarkovModel is set to unvalidated
}

%Main Success Scenario: A typical, unconditional happy path scenario of success.
\addscenario{Main Success Scenario:}{
	\item The user calls MarkovModel's method addState() with a smart\_ptr to the initialized State as the only arguement 
	\item MarkovModel searches map\_of\_states for a State with the same key value as the State to be added; none exist 
	\item The State is added to map\_of\_states with its name as the key 
	}

%Extensions: Alternate scenarios of success or failure.
\addscenario{Extensions:}{
	\item[2a.] A State with the same name exists in map\_of\_states:
		\begin{enumerate}
		\item[1.] System throws a runtime exception notifying the user that the State already exists 
		\item[2.] map\_of\_states is unmodified 
		\end{enumerate}
}

%Miscellaneous: Such as open issues/questions
%\addfield{Open Issues:}{}

\end{usecase}

\pagebreak
\begin{usecase}

\addtitle{Use Case 1.3}{Add Connection} 

%Scope: the system under design
%\addfield{Scope:}{System-wide}

%Level: "user-goal" or "subfunction"
%\addfield{Level:}{User-goal}

%Primary Actor: Calls on the system to deliver its services.
\addfield{Primary Actor:}{End-User}

%Preconditions: What must be true on start and worth telling the reader?
%\addfield{Preconditions:}{}
%when multiple
\additemizedfield{Preconditions:}{
	\item An instance of MarkovModel is initialized 
	\item A Connection is initialized with valid parameters and stored in a smart\_ptr 
} 

%Postconditions: What must be true on successful completion and worth telling the reader
%\addfield{Postconditions:}{}
%when multiple
\additemizedfield{Postconditions:}{
	\item The Connection is added to MarkovModel's vector of connections
	\item MarkovModel is set to unvalidated
}

%Main Success Scenario: A typical, unconditional happy path scenario of success.
\addscenario{Main Success Scenario:}{
	\item The user calls MarkovModel's method addConnection() with a smart\_ptr to the initialized Connection as the only arguement
	\item MarkovModel searches the vector of connections for a Connection between the same States as the Connection to be added; none exist  
	\item The Connection is added to the vector of connections
	}

%Extensions: Alternate scenarios of success or failure.
\addscenario{Extensions:}{
	\item[2a.] A Connection between the same States exists in the vector of connections
		\begin{enumerate}
		\item[1.] System throws a runtime exception notifying the user that the two States in the Connection have already been connected 
		\item[2.] The vector of connections is unmodified 
		\end{enumerate}
}

%Miscellaneous: Such as open issues/questions
%\addfield{Open Issues:}{}

\end{usecase}



\pagebreak
\begin{usecase}

\addtitle{Use Case 1.4}{Set initial State} 

%Scope: the system under design
%\addfield{Scope:}{System-wide}

%Level: "user-goal" or "subfunction"
%\addfield{Level:}{User-goal}

%Primary Actor: Calls on the system to deliver its services.
\addfield{Primary Actor:}{End-User}

%Preconditions: What must be true on start and worth telling the reader?
%\addfield{Preconditions:}{}
%when multiple
\additemizedfield{Preconditions:}{
	\item An instance of MarkovModel is initialized 
} 

%Postconditions: What must be true on successful completion and worth telling the reader
%\addfield{Postconditions:}{}
%when multiple
\additemizedfield{Postconditions:}{
	\item MarkovModel's initial State is set to the specified value
	\item MarkovModel is set to unvalidated
}

%Main Success Scenario: A typical, unconditional happy path scenario of success.
\addscenario{Main Success Scenario:}{
	\item The user calls MarkovModel's method setInitialState() with the name of the State as the only argument
	\item MarkovModel checks if the initial State already been set; it has not
	\item The initial State is set to the specified value
	}

%Extensions: Alternate scenarios of success or failure.
\addscenario{Extensions:}{
	\item[2a.] The initial State has already been set
		\begin{enumerate}
		\item[1.] System throws a runtime exception notifying the user that the initial State has already been set
		\item[2.] The initial State is unmodified
		\end{enumerate}
}

%Miscellaneous: Such as open issues/questions
%\addfield{Open Issues:}{}

\end{usecase}

\pagebreak
\begin{usecase}

\addtitle{Use Case 1.5}{Validate MarkovModel} 

%Scope: the system under design
%\addfield{Scope:}{System-wide}

%Level: "user-goal" or "subfunction"
%\addfield{Level:}{User-goal}

%Primary Actor: Calls on the system to deliver its services.
\addfield{Primary Actor:}{End-User}

%Preconditions: What must be true on start and worth telling the reader?
%\addfield{Preconditions:}{}
%when multiple
\additemizedfield{Preconditions:}{
	\item An instance of MarkovModel is initialized 
} 

%Postconditions: What must be true on successful completion and worth telling the reader
%\addfield{Postconditions:}{}
%when multiple
\additemizedfield{Postconditions:}{
	\item The user is notified that the MarkovModel is correct
	\item MarkovModel's validation flag is set to true
	\item The states in the map\_of\_states are assigned unique indices
	\item The State which was defined as initial State has its inital\_state flag set
}

%Main Success Scenario: A typical, unconditional happy path scenario of success.
\addscenario{Main Success Scenario:}{
	\item The user calls MarkovModel's method validate() with a smart\_ptr to a valid StateOfTheWorld instance as the only arguement
	\item The system confirms that at least one Connection has been defined
	\item The system confirms that every State referenced in the vector of connections has a corresponding entry in the map\_of\_states
	\item The system confirms that every RateConstant referenced in the vector of connections has a corresponding entry in the map\_of\_rates
	\item The system confirms that the initial State has been defined
	\item For every LigandGatedRateConstant in the map\_of\_rates, the system confirms that the Concentration has been declared
	\item The system confirms that no model errors have been found in during validation process
	\item The system sets the validation flag to true
	\item The system sets the state indices in every State in the map\_of\_states
	\item The system sets the initial\_state flag on the initial State
	\item The system returns the validation results to the user with a success result, no errors, and no warnings
	}

%Extensions: Alternate scenarios of success or failure.
\addscenario{Extensions:}{
	\item[2a.] No connections have been defined
		\begin{enumerate}
		\item[1.] The system sets the validation error flag
		\item[2.] The system saves a no Connections error message in the vector of error messages
		\item[3.] The system resumes at step 3
		\end{enumerate}
	\item[3a.] A State referenced in the vector of connections does not exist in the map\_of\_states
		\begin{enumerate}
		\item[1.] The system sets the validation error flag
		\item[2.] The system saves a State not defined error message in the vector of error messages
		\item[3.] The system resumes at step 4
		\end{enumerate}
	\item[4a.] A RateConstant referenced in the vector of connections does not exist in the map\_of\_rates
		\begin{enumerate}
		\item[1.] The system sets the validation error flag
		\item[2.] The system saves a RateConstant not defined error message in the vector of error messages
		\item[3.] The system resumes at step 5
		\end{enumerate}
	\item[5a.] The initial State has not beed defined
		\begin{enumerate}
		\item[1.] The system sets the validation error flag
		\item[2.] The system saves an initial State not defined error message in the vector of error messages
		\item[3.] The system resumes at step 6
		\end{enumerate}
	\item[6a.] The pointer to the StateOfTheWorld is NULL
		\begin{enumerate}
		\item[1.] The system sets the validation error flag
		\item[2.] The system saves a StateOfTheWorldIsNull error message in the vector of error messages
		\item[3.] The system returns the validation results to the user
		\end{enumerate}
	\item[6b.] A Concentration referenced by a LigandGatedRateConstant has not beed defined
		\begin{enumerate}
		\item[1.] The system sets the validation error flag
		\item[2.] The system saves a Concentration not defined error message in the vector of error messages
		\item[3.] The system returns the validation results to the user
		\end{enumerate}
	\item[7a.] The system has detected errors during the validation process
		\begin{enumerate}
		\item[1.] The system returns the validation results to the user
		\end{enumerate}
}

%Miscellaneous: Such as open issues/questions
%\addfield{Open Issues:}{}

\end{usecase}

\end{document}

