Class IvmlElementIdentifier

java.lang.Object
net.ssehub.easy.instantiation.rt.core.model.confModel.AbstractVariableIdentifier<IvmlElementIdentifier.ObservableTuple>
eu.qualimaster.easy.extension.internal.IvmlElementIdentifier
All Implemented Interfaces:
PipelineVisitor.IVariableMapper

public class IvmlElementIdentifier extends net.ssehub.easy.instantiation.rt.core.model.confModel.AbstractVariableIdentifier<IvmlElementIdentifier.ObservableTuple> implements PipelineVisitor.IVariableMapper
Uses IvmlElements and IObservables to identify temporary value mappings.
Author:
El-Sharkawy
  • Field Details

    • MAIN_PROJECT_ID

      private static final String MAIN_PROJECT_ID
      See Also:
    • PROFILING_PIPELINES

      private static final Set<String> PROFILING_PIPELINES
    • pipelines

      private List<net.ssehub.easy.varModel.confModel.IDecisionVariable> pipelines
    • pipelineInfos

      private Map<String,PipelineContentsContainer> pipelineInfos
    • cachedIDSegments

      private Map<String,List<String>> cachedIDSegments
    • varMapping

      private Map<net.ssehub.easy.varModel.confModel.IDecisionVariable,net.ssehub.easy.varModel.confModel.IDecisionVariable> varMapping
  • Constructor Details

    • IvmlElementIdentifier

      public IvmlElementIdentifier(net.ssehub.easy.varModel.confModel.Configuration config)
      Sole constructor for this class.
      Parameters:
      config - The used configuration, needed to perform queries.
  • Method Details

    • map

      public void map(net.ssehub.easy.varModel.confModel.IDecisionVariable original, net.ssehub.easy.varModel.confModel.IDecisionVariable copy)
      Description copied from interface: PipelineVisitor.IVariableMapper
      Maps original and copied variables.
      Specified by:
      map in interface PipelineVisitor.IVariableMapper
      Parameters:
      original - the original variable
      copy - the copied variable
    • getPipelineInfos

      private PipelineContentsContainer getPipelineInfos(String pipName)
      Returns the collected mappings for elements of the specified pipeline.
      Parameters:
      pipName - The configured name of the pipeline.
      Returns:
      A container containing all elements + mapped elements.
    • variableToID

      protected String variableToID(IvmlElementIdentifier.ObservableTuple variable)
      Specified by:
      variableToID in class net.ssehub.easy.instantiation.rt.core.model.confModel.AbstractVariableIdentifier<IvmlElementIdentifier.ObservableTuple>
    • isNestedVariable

      protected boolean isNestedVariable(String id)
      Specified by:
      isNestedVariable in class net.ssehub.easy.instantiation.rt.core.model.confModel.AbstractVariableIdentifier<IvmlElementIdentifier.ObservableTuple>
    • getIDIterator

      protected Iterator<String> getIDIterator(String observableID)
      Specified by:
      getIDIterator in class net.ssehub.easy.instantiation.rt.core.model.confModel.AbstractVariableIdentifier<IvmlElementIdentifier.ObservableTuple>
    • splitID

      private List<String> splitID(String id)
      Splits a given ID into segments for iteration through the element parts. Will also use a cached to minimize String operations.
      Parameters:
      id - The ID to split into individual segments.
      Returns:
      An list of the split elements.
    • fillSegmentList

      private void fillSegmentList(PipelineContentsContainer.MappedInstanceType type, String[] arraySegments, List<String> segments)
      Part of splitID(String) to fill the list for mapped runtime variable instances.
      Parameters:
      type - The type of mapped variable
      arraySegments - The already split ID for an variable
      segments - The empty list to fill via side effect
    • iDecisionVariableToID

      protected String iDecisionVariableToID(net.ssehub.easy.varModel.confModel.IDecisionVariable variable)
      Specified by:
      iDecisionVariableToID in class net.ssehub.easy.instantiation.rt.core.model.confModel.AbstractVariableIdentifier<IvmlElementIdentifier.ObservableTuple>
    • mapValue

      protected Object mapValue(String id, Object oValue)
      Overrides:
      mapValue in class net.ssehub.easy.instantiation.rt.core.model.confModel.AbstractVariableIdentifier<IvmlElementIdentifier.ObservableTuple>
    • mapVariable

      protected net.ssehub.easy.varModel.confModel.IDecisionVariable mapVariable(net.ssehub.easy.varModel.confModel.IDecisionVariable variable)
      Overrides:
      mapVariable in class net.ssehub.easy.instantiation.rt.core.model.confModel.AbstractVariableIdentifier<IvmlElementIdentifier.ObservableTuple>
    • toIVMLValue

      protected net.ssehub.easy.varModel.model.values.Value toIVMLValue(net.ssehub.easy.varModel.confModel.IDecisionVariable trgVariable, Object oValue) throws net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException
      Specified by:
      toIVMLValue in class net.ssehub.easy.instantiation.rt.core.model.confModel.AbstractVariableIdentifier<IvmlElementIdentifier.ObservableTuple>
      Throws:
      net.ssehub.easy.varModel.model.values.ValueDoesNotMatchTypeException
    • assignValue

      protected void assignValue(net.ssehub.easy.varModel.confModel.IDecisionVariable variable, net.ssehub.easy.varModel.model.values.Value value) throws net.ssehub.easy.varModel.confModel.ConfigurationException
      Overrides:
      assignValue in class net.ssehub.easy.instantiation.rt.core.model.confModel.AbstractVariableIdentifier<IvmlElementIdentifier.ObservableTuple>
      Throws:
      net.ssehub.easy.varModel.confModel.ConfigurationException
    • getAssignmentState

      protected net.ssehub.easy.varModel.confModel.AssignmentState getAssignmentState()
      Overrides:
      getAssignmentState in class net.ssehub.easy.instantiation.rt.core.model.confModel.AbstractVariableIdentifier<IvmlElementIdentifier.ObservableTuple>
    • setValueForAvailableAlgorithms

      private void setValueForAvailableAlgorithms(net.ssehub.easy.varModel.model.values.Value value, net.ssehub.easy.varModel.confModel.IDecisionVariable familyElement, String slot) throws net.ssehub.easy.varModel.confModel.ConfigurationException
      Sets the specified value to all available algorithms of the given family element.
      Parameters:
      value - The value to set.
      familyElement - A family element of a pipeline.
      slot - The slot to configure with the given value.
      Throws:
      net.ssehub.easy.varModel.confModel.ConfigurationException - in case that the types of the variable declaration and value do not comply