def run_for_output(raw_output, threads, allresults)
      # check output files exist
      output_files = {}
      @target.output.each_pair do |key, glob|
        files = Dir[glob]
        size = files.reduce(1) { |sum, f| sum * File.size(f)}
        if files.empty? || size==0
          error = "output files for #{key} matching #{glob} do not exist" +
                  " or are empty"
          raise ObjectiveHandlerError, error
        end
        output_files[key] = files.map { |f| File.expand_path(f) }
      end

      # run all objectives for output
      results = {}
      @objectives.each_pair do |name, objective|
        results[name] = self.run_objective(objective, name, raw_output,
                                           output_files, threads)
      end

      if allresults
        return { :results => results,
                 :reduced => self.dimension_reduce(results) }
      else
        results.each_value do |value|
          return value.kind_of?(Hash) ? value[:result] : value
        end
      end
    end
def run_for_output(raw_output, threads, allresults)
      # check output files exist
      output_files = {}
      @target.output.each_pair do |key, glob|
        files = Dir[glob]
        size = files.reduce(1) { |sum, f| sum * File.size(f)}
        if files.empty? || size==0
          error = "output files for #{key} matching #{glob} do not exist" +
                  " or are empty"
          raise ObjectiveHandlerError, error
        end
        output_files[key] = files.map { |f| File.expand_path(f) }
      end

      # run all objectives for output
      results = {}
      @objectives.each_pair do |name, objective|
        results[name] = self.run_objective(objective, name, raw_output,
                                           output_files, threads)
      end

      if allresults
        return { :results => results,
                 :reduced => self.dimension_reduce(results) }
      else
        results.each_value do |value|
          return value.kind_of?(Hash) ? value[:result] : value
        end
      end
    end
Run all objectives functions for +:output+.