def generate_parameters params
      @parameters = {}
      @options = {}
      params.each_pair do |param, data|
        if data[:opt]
          # optimise this parameter
          if data[:values] 
            # definition has provided an array of values
            if !data[:values].is_a? Array
              raise TargetLoadError.new("'values' for parameter #{param} is not an array")
            end
            if data[:type] == 'integer'
              data[:values].each do |v|
                raise TypeLoadError.new("'values' for parameter #{param} expected integer") unless v.is_a? Integer
              end
            elsif data[:type] == 'string'
              data[:values].each do |v|
                raise TypeLoadError.new("'values' for parameter #{param} expected string") unless v.is_a? String
              end
            end
            @parameters[param] = data[:values]
          else
            # definition has specified a range
            min, max, step = data[:min], data[:max], data[:step]
            unless min && max
              raise TargetLoadError.new("min and max must be set for parameter #{param}") 
            end
            range = (min..max)
            range = range.step(step) if step
            @parameters[param] = range.to_a
          end
        else
          # present option to user
          @options[param] = data
        end
      end
    end
def generate_parameters params
      @parameters = {}
      @options = {}
      params.each_pair do |param, data|
        if data[:opt]
          # optimise this parameter
          if data[:values] 
            # definition has provided an array of values
            if !data[:values].is_a? Array
              raise TargetLoadError.new("'values' for parameter #{param} is not an array")
            end
            if data[:type] == 'integer'
              data[:values].each do |v|
                raise TypeLoadError.new("'values' for parameter #{param} expected integer") unless v.is_a? Integer
              end
            elsif data[:type] == 'string'
              data[:values].each do |v|
                raise TypeLoadError.new("'values' for parameter #{param} expected string") unless v.is_a? String
              end
            end
            @parameters[param] = data[:values]
          else
            # definition has specified a range
            min, max, step = data[:min], data[:max], data[:step]
            unless min && max
              raise TargetLoadError.new("min and max must be set for parameter #{param}") 
            end
            range = (min..max)
            range = range.step(step) if step
            @parameters[param] = range.to_a
          end
        else
          # present option to user
          @options[param] = data
        end
      end
    end
convert parameter specification to a hash of arrays and ranges