Class ConfigurationInitializer

java.lang.Object
eu.qualimaster.easy.extension.internal.ConfigurationInitializer

public class ConfigurationInitializer extends Object
Configuration initialization utility functions. [map into VIL]
Author:
Holger Eichelberger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static void
    addVariableMapping(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String fieldName, eu.qualimaster.coordination.RuntimeVariableMapping result)
    Adds the variable mapping for var on field fieldName to result.
    static eu.qualimaster.coordination.RuntimeVariableMapping
    createVariableMapping(net.ssehub.easy.varModel.confModel.Configuration config, eu.qualimaster.coordination.RuntimeVariableMapping result)
    Creates a runtime variable mapping for configuration.
    static void
    initializeConfiguration(net.ssehub.easy.varModel.confModel.Configuration config, String newVariablePrefix, boolean initActual, eu.qualimaster.coordination.RuntimeVariableMapping mapping)
    Initializes a QM model with runtime instances.
    static void
    initializeConfiguration(net.ssehub.easy.varModel.confModel.Configuration config, String newVariablePrefix, eu.qualimaster.coordination.RuntimeVariableMapping mapping)
    Initializes a QM model with runtime instances.
    private static String[]
    select(boolean initActual, String available, String actual)
    Selects from the given available and actual name, whether both or only available shall be returned.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ConfigurationInitializer

      public ConfigurationInitializer()
  • Method Details

    • initializeConfiguration

      public static void initializeConfiguration(net.ssehub.easy.varModel.confModel.Configuration config, String newVariablePrefix, eu.qualimaster.coordination.RuntimeVariableMapping mapping) throws net.ssehub.easy.instantiation.core.model.common.VilException
      Initializes a QM model with runtime instances. [preliminary, separate concerns] Actual instances are initialized by default.
      Parameters:
      config - the configuration
      newVariablePrefix - the prefix for the new variables
      mapping - optional runtime mapping to be updated (may be null)
      Throws:
      net.ssehub.easy.instantiation.core.model.common.VilException - in case that initialization fails
    • initializeConfiguration

      public static void initializeConfiguration(net.ssehub.easy.varModel.confModel.Configuration config, String newVariablePrefix, boolean initActual, eu.qualimaster.coordination.RuntimeVariableMapping mapping) throws net.ssehub.easy.instantiation.core.model.common.VilException
      Initializes a QM model with runtime instances. [preliminary, separate concerns]
      Parameters:
      config - the configuration
      newVariablePrefix - the prefix for the new variables
      initActual - whether actual instance shall be initialized by default
      mapping - optional runtime mapping to be updated (may be null)
      Throws:
      net.ssehub.easy.instantiation.core.model.common.VilException - in case that initialization fails
    • select

      private static String[] select(boolean initActual, String available, String actual)
      Selects from the given available and actual name, whether both or only available shall be returned.
      Parameters:
      initActual - include or exclude actual
      available - the name of the available collection slot
      actual - the name of the actual slot
      Returns:
      the selected slot names
    • createVariableMapping

      public static eu.qualimaster.coordination.RuntimeVariableMapping createVariableMapping(net.ssehub.easy.varModel.confModel.Configuration config, eu.qualimaster.coordination.RuntimeVariableMapping result) throws net.ssehub.easy.varModel.model.ModelQueryException
      Creates a runtime variable mapping for configuration.
      Parameters:
      config - the configuration
      result - the runtime configuration mapping to modify (a new one is created if null)
      Returns:
      the runtime variable mapping
      Throws:
      net.ssehub.easy.varModel.model.ModelQueryException - in case of problems accessing model elements
    • addVariableMapping

      private static void addVariableMapping(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String fieldName, eu.qualimaster.coordination.RuntimeVariableMapping result)
      Adds the variable mapping for var on field fieldName to result.
      Parameters:
      var - the variable to analyze
      fieldName - the field name to analyze
      result - the mapping to be modified as a side effect