Package org.ddolib.examples.layered.lcs
Class LCSGenerator
java.lang.Object
org.ddolib.examples.layered.lcs.LCSGenerator
Contains method to generate instances of the LCS.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidgenerateRandomInstance(String fileName, int nbString, int nbChar, int minStrLength, int maxStrLength, long seed) Generates and saves a random instance of the LCS.static voidEntry point that generates a default random LCS instance and writes it to a file underdata/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 instancenbString- how many strings to generatenbChar- how many characters can be used to generate the stringminStrLength- the inclusive minimal size of the generated stringsmaxStrLength- the exclusive maximal size of the generated stringsseed- the seed of the random number generator- Throws:
IOException- if something goes wrong while writing the file
-
main
Entry point that generates a default random LCS instance and writes it to a file underdata/LCS/.- Parameters:
args- command-line arguments (not used)- Throws:
IOException- if the generated instance file cannot be written
-