Class ExperimentRunner
java.lang.Object
org.variantsync.boosting.eval.experiments.ExperimentRunner
- Direct Known Subclasses:
RQRunner
This abstract class serves as a base class for running our experiments.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
ExperimentRunner
(Config config) Constructor for ExperimentRunner class. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
conductExperiment
(VariantGenerationResult variantGenerationResult, int percentage, double standardDeviation) Conducts an experiment using the given variant generation result, percentage, and standard deviation.protected com.google.gson.JsonObject
Creates a JsonObject with properties for the current experiment.protected com.google.gson.JsonObject
createJSONSingleRun
(double[] score) Creates a JSON object representing a single run with the given scores.org.variantsync.boosting.TraceBoosting
initBoosting
(Path variantsDirectory, Map<String, org.variantsync.vevos.simulation.variability.pc.groundtruth.GroundTruth> gtMap, Map<String, Path> configFileMap) Initializes the TraceBoosting with the given parameters.static Config
loadSubjectSpecificConfig
(String splName, Path pathToConfig) Loads a subject-specific configuration based on the given SPL name and path to the configuration file.prepareVariants
(Path splRepoPath, List<org.variantsync.vevos.simulation.variability.SPLCommit> splCommitGTs, int nVariants) Prepares a new set of variants for a given software product line (SPL) repository, based on a list of SPL commits and a specified number of variants.
-
Field Details
-
config
-
configPath
-
ex_repeat
protected int ex_repeat -
percentages
protected int[] percentages
-
-
Constructor Details
-
ExperimentRunner
Constructor for ExperimentRunner class. Initializes ExperimentRunner object with the provided Config object.- Parameters:
config
- Config object containing experiment parameters
-
-
Method Details
-
loadSubjectSpecificConfig
Loads a subject-specific configuration based on the given SPL name and path to the configuration file.- Parameters:
splName
- the SPL name for which the configuration is being loadedpathToConfig
- the path to the configuration file- Returns:
- a Config object representing the loaded configuration
-
prepareVariants
public VariantGenerationResult prepareVariants(Path splRepoPath, List<org.variantsync.vevos.simulation.variability.SPLCommit> splCommitGTs, int nVariants) throws IOException Prepares a new set of variants for a given software product line (SPL) repository, based on a list of SPL commits and a specified number of variants.- Parameters:
splRepoPath
- the path to the SPL repositorysplCommitGTs
- the list of SPL commits with ground truthsnVariants
- the number of variants to generate- Returns:
- a VariantGenerationResult object containing the generated variants, ground truths, and configuration files
- Throws:
IOException
- if an I/O error occurs
-
conductExperiment
public double[] conductExperiment(VariantGenerationResult variantGenerationResult, int percentage, double standardDeviation) Conducts an experiment using the given variant generation result, percentage, and standard deviation.- Parameters:
variantGenerationResult
- The result of the variant generation processpercentage
- The percentage of the experiment to be conductedstandardDeviation
- The standard deviation of the experiment- Returns:
- An array of double values representing the results of the experiment
-
initBoosting
public org.variantsync.boosting.TraceBoosting initBoosting(Path variantsDirectory, Map<String, org.variantsync.vevos.simulation.variability.pc.groundtruth.GroundTruth> gtMap, Map<String, Path> configFileMap) Initializes the TraceBoosting with the given parameters.- Parameters:
variantsDirectory
- the directory containing the variant filesgtMap
- a map of variant IDs to their corresponding ground truth objectsconfigFileMap
- a map of configuration file names to their corresponding paths- Returns:
- a TraceBoosting object initialized with the provided parameters
-
createJSONProperties
protected com.google.gson.JsonObject createJSONProperties()Creates a JsonObject with properties for the current experiment.- Returns:
- JsonObject - a JsonObject containing the properties for the current experiment
-
createJSONSingleRun
protected com.google.gson.JsonObject createJSONSingleRun(double[] score) Creates a JSON object representing a single run with the given scores.- Parameters:
score
- an array of double values representing the accuracy, precision, recall, f1-score, and time of the run- Returns:
- a JsonObject containing the scores for accuracy, precision, recall, f1-score, and time
-