Class MatlabScriptCreator

java.lang.Object
hlcd.testing.matlabChecker.MatlabScriptCreator

public class MatlabScriptCreator extends Object
Creates the main Matlab script to run all the file(s) generated based on the number of run specified in the Tester classes. This script will load and execute each file with the .m extension in the same directory it is written in. There is a condition in the Matlab script to skip the script itself.
 //minimal example to execute this class:
 public static void main(String[] args) {
     System.out.println("Running MatlabScriptCreator...");
     String title = "A temporary test";
     byte minK = 1;
     byte maxK = 2;
     byte minN = 3;
     byte maxN = 4;
     long runs = 5;
     long iterations = 6;
     String path = Paths.DEFAULT_PATH;
     String newDirectoryName = "Test";
     String scriptName = "TempTest";
     String extension = ".m";
     TesterParameters tp = new TesterParameters(
         title, minK, maxK, minN, maxN, runs, iterations,
         path, newDirectoryName, scriptName, extension
     );
     DirectoryCreator dc = new DirectoryCreator(path, newDirectoryName);
     dc.createDirectory();
     MatlabScriptCreator msm = new MatlabScriptCreator(tp, dc);
     Benchmarker.beep();
     System.out.println("MatlabScriptCreator completed.");
 }
Since:
1.8
Version:
1.0 (February 15th, 2022)
Author:
Maysara Al Jumaily
See Also:
MatlabDeterminantTester, MatlabMatrixTester
  • Constructor Details

    • MatlabScriptCreator

      public MatlabScriptCreator(TesterParameters tp)
      Ensures to create a new directory based on the options given in the TesterParameters specified. In the case where the directory already exists, it will be deleted first and then created again.
      Parameters:
      tp - the parameters of the tester options
    • MatlabScriptCreator

      public MatlabScriptCreator(TesterParameters tp, DirectoryCreator dc)
      Ensures to create a new directory based on the options given in the TesterParameters specified. In the case where the directory already exists, it will be deleted first and then created again.
      Parameters:
      dc - the directory creator object to ensure the files are stored in the appropriate place
      tp - the parameters of the tester options