Class LCSGenerator

java.lang.Object
org.ddolib.examples.layered.lcs.LCSGenerator

public class LCSGenerator extends Object
Contains method to generate instances of the LCS.
  • Method Details

    • generateRandomInstance

      public static void generateRandomInstance(String fileName, int nbString, int nbChar, int minStrLength, int maxStrLength, long seed) throws IOException
      Generates and saves a random instance of the LCS.
      Parameters:
      fileName - the file to save the instance
      nbString - how many strings to generate
      nbChar - how many characters can be used to generate the string
      minStrLength - the inclusive minimal size of the generated strings
      maxStrLength - the exclusive maximal size of the generated strings
      seed - the seed of the random number generator
      Throws:
      IOException - if something goes wrong while writing the file
    • main

      public static void main(String[] args) throws IOException
      Entry point that generates a default random LCS instance and writes it to a file under data/LCS/.
      Parameters:
      args - command-line arguments (not used)
      Throws:
      IOException - if the generated instance file cannot be written