Search in sources :

Example 11 with ProjectStaticData

use of org.evosuite.continuous.project.ProjectStaticData in project evosuite by EvoSuite.

the class ScheduleType method createScheduleForWhenNotEnoughBudget.

/**
 * if there is not enough search budget, then try
 * to target as many CUTs as possible
 * @return
 */
protected List<JobDefinition> createScheduleForWhenNotEnoughBudget() {
    ProjectStaticData data = scheduler.getProjectData();
    int totalBudget = 60 * scheduler.getConfiguration().timeInMinutes * scheduler.getConfiguration().getNumberOfUsableCores();
    List<JobDefinition> jobs = new LinkedList<JobDefinition>();
    // not enough budget
    for (ClassInfo info : data.getClassInfos()) {
        if (!info.isTestable()) {
            continue;
        }
        JobDefinition job = new JobDefinition(60 * scheduler.getConfiguration().minMinutesPerJob, scheduler.getConfiguration().getConstantMemoryPerJob(), info.getClassName(), 0, null, null);
        jobs.add(job);
        totalBudget -= (60 * scheduler.getConfiguration().minMinutesPerJob);
        if (totalBudget <= 0) {
            break;
        }
    }
    return jobs;
}
Also used : ProjectStaticData(org.evosuite.continuous.project.ProjectStaticData) JobDefinition(org.evosuite.continuous.job.JobDefinition) LinkedList(java.util.LinkedList) ClassInfo(org.evosuite.continuous.project.ProjectStaticData.ClassInfo)

Aggregations

ProjectStaticData (org.evosuite.continuous.project.ProjectStaticData)11 ProjectAnalyzer (org.evosuite.continuous.project.ProjectAnalyzer)7 CtgConfiguration (org.evosuite.continuous.CtgConfiguration)6 Test (org.junit.Test)6 JobDefinition (org.evosuite.continuous.job.JobDefinition)5 LinkedList (java.util.LinkedList)4 ClassInfo (org.evosuite.continuous.project.ProjectStaticData.ClassInfo)4 UsingSimpleAndTrivial (com.examples.with.different.packagename.continuous.UsingSimpleAndTrivial)3 MoreBranches (com.examples.with.different.packagename.continuous.MoreBranches)2 NoBranches (com.examples.with.different.packagename.continuous.NoBranches)2 BaseForSeeding (com.examples.with.different.packagename.continuous.BaseForSeeding)1 Simple (com.examples.with.different.packagename.continuous.Simple)1 SomeBranches (com.examples.with.different.packagename.continuous.SomeBranches)1 Trivial (com.examples.with.different.packagename.continuous.Trivial)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 JobExecutor (org.evosuite.continuous.job.JobExecutor)1 JobScheduler (org.evosuite.continuous.job.JobScheduler)1 StorageManager (org.evosuite.continuous.persistency.StorageManager)1