private List<TuningJobDefinition> getJobsForParamSuggestion() {
    // Todo: [Important] Change the logic. This is very rigid. Ideally you should look at the param set ids in the saved state,
    // todo: [continuation] if their fitness is computed, pso can generate new params for the job
    logger.info("Checking which jobs need new parameter suggestion");
    List<TuningJobDefinition> jobsForParamSuggestion = new ArrayList<TuningJobDefinition>();

    List<JobSuggestedParamSet> pendingParamSetList = JobSuggestedParamSet.find.select("*")
        .fetch(JobSuggestedParamSet.TABLE.jobDefinition, "*")
        .where()
        .or(Expr.or(Expr.eq(JobSuggestedParamSet.TABLE.paramSetState, JobSuggestedParamSet.ParamSetStatus.CREATED),
            Expr.eq(JobSuggestedParamSet.TABLE.paramSetState, JobSuggestedParamSet.ParamSetStatus.SENT)),
            Expr.eq(JobSuggestedParamSet.TABLE.paramSetState, JobSuggestedParamSet.ParamSetStatus.EXECUTED))
        .eq(JobSuggestedParamSet.TABLE.isParamSetDefault, 0)
        .eq(JobSuggestedParamSet.TABLE.isParamSetBest, 0).findList();

    List<JobDefinition> pendingParamJobList = new ArrayList<JobDefinition>();
    for (JobSuggestedParamSet pendingParamSet : pendingParamSetList) {
      if (!pendingParamJobList.contains(pendingParamSet.jobDefinition)) {
        pendingParamJobList.add(pendingParamSet.jobDefinition);
      }
    }

    List<TuningJobDefinition> tuningJobDefinitionList = TuningJobDefinition.find.select("*")
        .fetch(TuningJobDefinition.TABLE.job, "*")
        .where()
        .eq(TuningJobDefinition.TABLE.tuningEnabled, 1)
        .findList();

    if (tuningJobDefinitionList.size() == 0) {
      logger.error("No auto-tuning enabled jobs found");
    }

    for (TuningJobDefinition tuningJobDefinition : tuningJobDefinitionList) {
      if (!pendingParamJobList.contains(tuningJobDefinition.job)) {
        logger.info("New parameter suggestion needed for job: " + tuningJobDefinition.job.jobName);
        jobsForParamSuggestion.add(tuningJobDefinition);
      }
    }
    logger.info("Number of job(s) which need new parameter suggestion: " + jobsForParamSuggestion.size());
    return jobsForParamSuggestion;
  }
Fetches the list to job which need new parameter suggestion
@return Job list
app/com/linkedin/drelephant/tuning/ParamGenerator.java