UnCoVer (Using Coverability for Verification)
|
A scenario is a subprogram using a set of input parameters to execute some algorithms, producing desired output. More...
#include <Scenario.h>
Public Member Functions | |
virtual | ~Scenario () |
The destructor of the current Scenario. | |
void | initialize (vector< string > ¶ms) |
Initializes the current Scenario with the given vector of parameters. More... | |
virtual void | run ()=0 |
Executes the scenario. More... | |
string | getName () const |
Returns the name of this Scenario, which is a string beginning with 'scn_'. More... | |
bool | isInitialized () const |
Check whether the Scenario was already initialized or not. More... | |
string | getScenarioDesciption () const |
Returns a full description of the given Scenario. More... | |
Protected Member Functions | |
Scenario (string name, string desciptor, vector< string > const &alternateNames=vector< string >()) | |
Generates an uninitialized Scenario with the given name and call descriptor. More... | |
virtual void | initialize (unordered_map< string, string > ¶meters)=0 |
Initializes the scenario with the given mapping, where the keys are parameter names. More... | |
void | addParameter (string paramName, string description, bool mandatory=true) |
Defined a new input parameter with the name 'paramName' the description 'description'. More... | |
void | addSynonymFor (string original, string synonym) |
Stores that the parameter 'original' is also meant if 'synonym' was given as parameter. More... | |
void | checkInitializationAndThrow () const |
Check if the Scenario was initialized and throws a RunException if it was not. More... | |
Protected Attributes | |
const string | scenarioName |
A unique name of this scenario starting with "scn_". | |
const vector< string > | alternateNames |
A vector containing all names for this Scenario, beyond scenarioName. | |
const string | scenarioDescriptor |
Contains a description of how a call of this scenario may look like. More... | |
Private Attributes | |
vector< string > | parameterNames |
Contains the names of all parameters of the Scenario. More... | |
unordered_map< string, pair < string, bool > > | parameterDescriptor |
Stores detailed description of every parameter of this Scenario and whether the parameter is mandatory or not. | |
unordered_map< string, string > | synonyms |
Stores all synonyms for parameters. | |
bool | wasInitialized |
Stores whether the Scenario was initialized or not. | |
A scenario is a subprogram using a set of input parameters to execute some algorithms, producing desired output.
Input, output and used algorithms are scenario dependent. Scenarios are usually started from the user and may have arbitrary long execution times.
|
protected |
Generates an uninitialized Scenario with the given name and call descriptor.
name | the name of the current scenario |
desciptor | the call descriptor of the current scenario |
alternateNames | a list of all synonyms for this scenario |
|
protected |
Defined a new input parameter with the name 'paramName' the description 'description'.
The boolean specifies whether the parameter is mandatory or not. The order in which the parameters are defined using this method also specifies the order in which the parameters are expected if this scenario is called without parameter names, i.e. if the i-th input has only a value and no name, the name given at the i-th call of this method is used.
paramName | a unique name for this parameter |
description | a description of the defines parameter (for documentary purposes) |
mandatory | true if and only if the parameter should be mandatory |
|
protected |
Stores that the parameter 'original' is also meant if 'synonym' was given as parameter.
Using a defined parameter as 'synonym' will lead to undefined behavior.
original | an already defined parameter name |
synonym | a name which will from now on be handled as if 'original' was given |
|
protected |
Check if the Scenario was initialized and throws a RunException if it was not.
string getName | ( | ) | const |
string getScenarioDesciption | ( | ) | const |
void initialize | ( | vector< string > & | params | ) |
Initializes the current Scenario with the given vector of parameters.
Each element of 'params' must be of the form 'key=value' and 'key' has to be a defined parameter of the scenario.
params | a key-value vector of the scenario parameters |
|
protectedpure virtual |
Initializes the scenario with the given mapping, where the keys are parameter names.
May throw a uncover::basic_types::InitialisationException if parameters are invalid.
parameters | a mapping containing parameter names as keys and their values |
Implemented in BackwardAnalysisScenario, LEQCheckScenario, GXLtoPicConverter, GTXLtoLatexConverter, LeaderElectionRuleCreater, XMLTestScenario, BackwardStepTest, MatcherScenario, and RulePreparerTest.
bool isInitialized | ( | ) | const |
|
pure virtual |
Executes the scenario.
The scenario has to be fully initialized before calling this function.
Implemented in BackwardAnalysisScenario, LEQCheckScenario, GXLtoPicConverter, GTXLtoLatexConverter, LeaderElectionRuleCreater, XMLTestScenario, BackwardStepTest, MatcherScenario, and RulePreparerTest.
|
private |
Contains the names of all parameters of the Scenario.
The position of each name specifies the name of nameless parameter (if the name of the ith is not given, the name is parameterNames[i]).
|
protected |
Contains a description of how a call of this scenario may look like.
This does not include detailed description of the parameters.