Class IndexBasedModelConverter

    • Constructor Detail

      • IndexBasedModelConverter

        public IndexBasedModelConverter​(InputParameterModel model)
        Creates and initializes a new converter with the given testModel and constraints converter.
        Parameters:
        model - the testModel which is converted. Must not be null
    • Method Detail

      • convertCombination

        public int[] convertCombination​(Combination combination)
        Description copied from interface: ModelConverter
        Converts a Combination object to an integer array representation with the corresponding value number. If the array returned by this method is given into ModelConverter.convertCombination(int[]), a Combination equal to the original one should be returned.
        Specified by:
        convertCombination in interface ModelConverter
        Parameters:
        combination - the combination to be converted. Must not be null
        Returns:
        the corresponding integer array to that it matches the testModel conversion
      • convertCombination

        public Combination convertCombination​(int[] combination)
        Description copied from interface: ModelConverter
        Converts a combinations represented by an integer array into a Combination object with the corresponding parameters and values.
        Specified by:
        convertCombination in interface ModelConverter
        Parameters:
        combination - the combination to be converted. Must not be null
        Returns:
        the corresponding Combination so that it matches the testModel conversion
      • convertParameter

        public int convertParameter​(Parameter parameter)
        Description copied from interface: ModelConverter
        Converts a Parameter object into an equivalent integer representation. If the integer returned by this method is given to ModelConverter.convertParameter(int), the original parameter is returned.
        Specified by:
        convertParameter in interface ModelConverter
        Parameters:
        parameter - the parameter to convert. Needs to be in the original testModel, otherwise success of this method is not guaranteed. Must not be null
        Returns:
        the corresponding integer representation so that it matches the testModel conversion
      • convertParameter

        public Parameter convertParameter​(int parameter)
        Description copied from interface: ModelConverter
        Converts an integer representation back to a Parameter object.
        Specified by:
        convertParameter in interface ModelConverter
        Parameters:
        parameter - the parameter to convert. Needs to be in the original testModel, otherwise success of this method is not guaranteed. Must not be negative
        Returns:
        the corresponding Parameter representation so that it matches the testModel conversion
      • convertValue

        public Value convertValue​(int parameter,
                                  int value)
        Description copied from interface: ModelConverter
        Converts the integer representation of a value into a Value object. The parameter is needed since values are only unique in the context of their parameters. The parameter can be converted with ModelConverter.convertParameter(int).
        Specified by:
        convertValue in interface ModelConverter
        Parameters:
        parameter - the parameter in which the value is located
        value - the value to convert
        Returns:
        the corresponding Value representation so that it matches the testModel conversion
      • convertConstraint

        public Constraint convertConstraint​(TupleList constraint)
        Description copied from interface: ModelConverter
        Converts a TupleList object into a Constraint representation which is equal.
        Specified by:
        convertConstraint in interface ModelConverter
        Parameters:
        constraint - the constraint to convert. Needs to be one in the original testModel, otherwise success of this method is not guaranteed. Must not be null
        Returns:
        the corresponding MethodBasedConstraint representation so that it matches the testModel conversion