Class ConcreteScenarioManager
- java.lang.Object
-
- org.palladiosimulator.pcm.uncertainty.variation.UncertaintyVariationModel.gen.pcm.ConcreteScenarioManager
-
- All Implemented Interfaces:
ScenarioManager
public class ConcreteScenarioManager extends Object implements ScenarioManager
ConcreteScenarioManager realizes the management of the scenarios generated from the pcm through the uncertainty variation model.
-
-
Constructor Summary
Constructors Constructor Description ConcreteScenarioManager(URI modelBaseUri, String sourceDirName, String resultDirName, String variantDirName, ResourceAbstraction resourceAbstraction)
ConstructorConcreteScenarioManager(URI modelBaseUri, String sourceDirName, URI resultUri, String variantDirName, ResourceAbstraction resourceAbstraction)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createCurrVariant(int idx, IProgressMonitor progressMonitor)
generates variant i from the base models by copying the files into configuration_i subdirectory of the scenario folder of the current project.URI
getCurrVariantUri()
returns the uri of the current variant generated by the function createCurrVariant.Map<String,List<EObject>>
loadCurrVariantModels()
loads and returns the different pcm models that must be varied of the current variant.void
register(List<String> knownVariingModelTypes)
registers the known varying model types of the pcm for later loading.void
reportsVariationPoints(Statespace statespace, IProgressMonitor progressMonitor)
writes the different variation points into the reportsvoid
reportVariation(StatespaceIterator it, IProgressMonitor progressMonitor)
writes the current state of the statespace iterator into the reportsvoid
storeCurrVariantModels(Map<String,List<EObject>> models)
store the pcm models that were loaded with the function loadCurrVariantModels.
-
-
-
Constructor Detail
-
ConcreteScenarioManager
public ConcreteScenarioManager(URI modelBaseUri, String sourceDirName, String resultDirName, String variantDirName, ResourceAbstraction resourceAbstraction) throws CoreException
Constructor- Parameters:
modelBaseUri
- specifies the uniform resource identifier (uri) which points to the folder in which the uncertainty variation model is contained. The uri must be of the platform type. The pcm base models will be searched in the sourceDir sub-directory of the uri and the scenarios will be generated under the ../resultDir sub-directory of the uri.sourceDirName
- name of the directory in which the model templates for the variants will be searched in.resultDirName
- name of the directory in which the all variants will be saved invariantDirName
- name of the directory in which one variant will be saved inresourceAbstraction
- the abstraction layer for the models loading and storing mechanism- Throws:
CoreException
- if result directory can not be created in the case it does not exist
-
ConcreteScenarioManager
public ConcreteScenarioManager(URI modelBaseUri, String sourceDirName, URI resultUri, String variantDirName, ResourceAbstraction resourceAbstraction) throws CoreException
Constructor- Parameters:
modelBaseUri
- specifies the uniform resource identifier (uri) which points to the folder in which the uncertainty variation model is contained. The uri must be of the platform type. The pcm base models will be searched in the sourceDir sub-directory of the uri.sourceDirName
- name of the directory in which the model templates for the variants will be searched in.resultUri
- specifies the uniform resource identifier (uri) which points to the folder in which which the scenarios will be generatedvariantDirName
- name of the directory in which one variant will be saved inresourceAbstraction
- the abstraction layer for the models loading and storing mechanism- Throws:
CoreException
- if result directory can not be created in the case it does not exist
-
-
Method Detail
-
createCurrVariant
public void createCurrVariant(int idx, IProgressMonitor progressMonitor) throws CoreException
generates variant i from the base models by copying the files into configuration_i subdirectory of the scenario folder of the current project.- Specified by:
createCurrVariant
in interfaceScenarioManager
- Parameters:
idx
- specifies the id number of the current variantprogressMonitor
- progress monitor for status reporting- Throws:
CoreException
- if existing configuration cannot be deleted or new configuration cannot be generated
-
register
public void register(List<String> knownVariingModelTypes)
registers the known varying model types of the pcm for later loading.- Specified by:
register
in interfaceScenarioManager
- Parameters:
knownVariingModelTypes
- specifies a list with the names of the known model that should be varied.
-
loadCurrVariantModels
public Map<String,List<EObject>> loadCurrVariantModels() throws CoreException
loads and returns the different pcm models that must be varied of the current variant. This function requires a single call of the function register and a call of the function createCurrVariant.- Specified by:
loadCurrVariantModels
in interfaceScenarioManager
- Returns:
- a map between model type as string and loaded models of this type
- Throws:
CoreException
- if the result directory or its content can not be reached
-
storeCurrVariantModels
public void storeCurrVariantModels(Map<String,List<EObject>> models) throws IOException
store the pcm models that were loaded with the function loadCurrVariantModels.- Specified by:
storeCurrVariantModels
in interfaceScenarioManager
- Parameters:
models
- specifies the models that shall be stored- Throws:
IOException
- if writing of one of the models fails
-
getCurrVariantUri
public URI getCurrVariantUri()
returns the uri of the current variant generated by the function createCurrVariant. return the platform uri to the current variant.- Specified by:
getCurrVariantUri
in interfaceScenarioManager
-
reportsVariationPoints
public void reportsVariationPoints(Statespace statespace, IProgressMonitor progressMonitor) throws CoreException
writes the different variation points into the reports- Specified by:
reportsVariationPoints
in interfaceScenarioManager
- Parameters:
statespace
- the statespace to reportprogressMonitor
- progress monitor for status reporting- Throws:
CoreException
- if the writing into the report fails
-
reportVariation
public void reportVariation(StatespaceIterator it, IProgressMonitor progressMonitor) throws CoreException
writes the current state of the statespace iterator into the reports- Specified by:
reportVariation
in interfaceScenarioManager
- Parameters:
it
- the StatespaceIterator to reportprogressMonitor
- progress monitor for status reporting- Throws:
CoreException
- if the writing into the report fails
-
-