Class 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 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 in
        variantDirName - name of the directory in which one variant will be saved in
        resourceAbstraction - 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 generated
        variantDirName - name of the directory in which one variant will be saved in
        resourceAbstraction - 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 interface ScenarioManager
        Parameters:
        idx - specifies the id number of the current variant
        progressMonitor - 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 interface ScenarioManager
        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 interface ScenarioManager
        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
      • 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 interface ScenarioManager