Class CakeInstance


  • public class CakeInstance
    extends Object
    Main starter class for ProCAKE. It is used to initially load model, similarity model and case data.
    • Method Detail

      • withReuseDataClassReferencesAtRestart

        public CakeInstance withReuseDataClassReferencesAtRestart​(boolean flag)

        withReuseDataClassReferencesAtRestart.

        Parameters:
        flag - a boolean
        Returns:
        a CakeInstance object
      • isRunning

        public static boolean isRunning()
        Check whether an instance of ProCAKE has been started already.
        Returns:
        true if ProCAKE is already running
      • addSimModel

        public static boolean addSimModel​(String simModel)
        Add Similarity Model to List.
        Parameters:
        simModel - is to be added.
        Returns:
        true if Model could be added, false if ProCAKE isn't running.
      • extendModel

        public static void extendModel​(String pathModel,
                                       String modelName)
        Adds a file containing a model definition (model.xml) to the existing loaded model. This method can be handy if the model information has to be complemented during runtime.
        Parameters:
        pathModel - the path to the file to load
        modelName - the name of the model to extend. null refers to the default model
      • extendModel

        public static void extendModel​(InputStream streamModel,
                                       String modelName)
        Adds an input stream containing a model definition (model.xml) to the existing loaded model. This method can be handy if the model information has to be complemented during runtime.
        Parameters:
        streamModel - the stream containing the file to load
        modelName - the name of the model to extend. null refers to the default model
      • extendSimilarityModel

        public static void extendSimilarityModel​(String pathSimModel,
                                                 String modelName)
        Adds a file containing a similarity model definition (sim.xml) to the existing loaded similarity model. This method can be handy if the similarity model information has to be complemented during runtime.
        Parameters:
        pathSimModel - the path to the file to load
        modelName - the name of the model to extend. null refers to the default model
      • extendSimilarityModel

        public static void extendSimilarityModel​(InputStream streamSimModel,
                                                 String modelName)
        Adds an input stream containing a similarity model definition (sim.xml) to the existing loaded similarity model. This method can be handy if the similarity model information has to be complemented during runtime.
        Parameters:
        streamSimModel - the path to the file to load
        modelName - the name of the model to extend. null refers to the default model
      • addSimilarityModel

        public static void addSimilarityModel​(String path,
                                              String name)
        Initializes and builds the similarity model with the given name. The data is loaded from the file at the given path.
        Parameters:
        path - the similarity model file to load
        name - the name of the similarity model
      • initDefaultDependencyModel

        public static DependencyModel initDefaultDependencyModel​(String dependencyModelPath,
                                                                 WriteableObjectPool casebase)
        Method, that initializes the dependency model from an XML file.
        Parameters:
        dependencyModelPath - The path of the xml file of the dependency model.
        casebase - The casebase, between whose cases the dependencies exists.
        Returns:
        The initialized dependency model.
      • getDependencyModel

        public static DependencyModel getDependencyModel()
        Method, that returns the dependency model. If the model wasn't initialized yet, null will be returned.
        Returns:
        The dependency model.
      • validateSimModel

        public static void validateSimModel​(Model model,
                                            SimilarityModel simModel)
        Validates the similarity model by checking if a defined class from the data model has a respective measure in the similarity model.
        Parameters:
        model - the model to check
        simModel - the similarity model to check