Skip to content
Snippets Groups Projects
Commit 08c85e28 authored by Andrii Zakharchuk's avatar Andrii Zakharchuk Committed by Dimitrii
Browse files

Dynamic parameters in solver genetic

parent b6e62b7c
No related branches found
No related tags found
No related merge requests found
......@@ -63,10 +63,34 @@ public class GeneticMain {
int generations = 200000;
int populationSize = 1000;
if (args.length == 2) {
System.out.println("============ Args: " + args[0] + " and " + args[1]);
logger.debug("============ Args: " + args[0] + " and " + args[1]);
generations = Integer.parseInt(args[0]);
populationSize = Integer.parseInt(args[1]);
System.out.println("============ generations = " + generations + ", populationSize = " + populationSize);
logger.debug("============ generations = " + generations + ", populationSize = " + populationSize);
} else if (args.length == 15){
logger.debug("============ Args: " + String.join("and",args));
generations = Integer.parseInt(args[0]);
populationSize = Integer.parseInt(args[1]);
numTopLevelComponents = Integer.parseInt(args[2]);
avgNumImplSubComponents = Integer.parseInt(args[3]);
implSubComponentStdDerivation = Integer.parseInt(args[4]);
avgNumCompSubComponents = Integer.parseInt(args[5]);
compSubComponentStdDerivation = Integer.parseInt(args[6]);
componentDepth = Integer.parseInt(args[7]);
numImplementations = Integer.parseInt(args[8]);
excessComputeResourceRatio = Double.parseDouble(args[9]);
numRequests = Integer.parseInt(args[10]);
numCpus = Integer.parseInt(args[11]);
seed = Integer.parseInt(args[12]);
timeoutValue = Integer.parseInt(args[13]);
timeoutUnit = args[14];
logger.debug( String.format("============ generations = %d populationSize = %d numTopLevelComponents = %d" +
" avgNumImplSubComponents = %d implSubComponentStdDerivation = %d avgNumCompSubComponents = %d compSubComponentStdDerivation = %d componentDepth = %d" +
" numImplementations = %d excessComputeResourceRatio = %f numRequests = %d numCpus = %d seed = %d timeoutValue = %d timeoutUnit = %s",
generations, populationSize,numTopLevelComponents, avgNumImplSubComponents,
implSubComponentStdDerivation, avgNumCompSubComponents,compSubComponentStdDerivation, componentDepth,numImplementations,
excessComputeResourceRatio,numRequests, numCpus,
seed, timeoutValue,timeoutUnit));
}
ScenarioGenerator generator = new ScenarioGenerator(new ScenarioDescription(numTopLevelComponents,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment