Class ExperimentRunner

java.lang.Object
org.variantsync.boosting.eval.experiments.ExperimentRunner
Direct Known Subclasses:
RQRunner

public abstract class ExperimentRunner extends Object
This abstract class serves as a base class for running our experiments.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Config
     
    protected String
     
    protected int
     
    protected int[]
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor for ExperimentRunner class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • config

      protected Config config
    • configPath

      protected String configPath
    • ex_repeat

      protected int ex_repeat
    • percentages

      protected int[] percentages
  • Constructor Details

    • ExperimentRunner

      protected ExperimentRunner(Config config)
      Constructor for ExperimentRunner class. Initializes ExperimentRunner object with the provided Config object.
      Parameters:
      config - Config object containing experiment parameters
  • Method Details

    • loadSubjectSpecificConfig

      public static Config loadSubjectSpecificConfig(String splName, Path pathToConfig)
      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 loaded
      pathToConfig - 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 repository
      splCommitGTs - the list of SPL commits with ground truths
      nVariants - 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 process
      percentage - The percentage of the experiment to be conducted
      standardDeviation - 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 files
      gtMap - a map of variant IDs to their corresponding ground truth objects
      configFileMap - 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