Skip to content

Commit

Permalink
Debugging problem with algorithm generation
Browse files Browse the repository at this point in the history
  • Loading branch information
SimplisticCode committed Dec 11, 2023
1 parent e87285f commit 5c319fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion maestro/src/main/java/org/intocps/maestro/cli/SigverCmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,16 @@ class GenerateAlgorithmCmd implements Callable<Integer> {

@Override
public Integer call() throws Exception {
System.out.println("Generating algorithm from scenario or multi-model");
Path filePath = file.toPath();
MasterModel masterModel;
if (FilenameUtils.getExtension(filePath.toString()).equals("conf")) {
System.out.println("Generating algorithm from scenario");
String scenario = Files.readString(filePath);
masterModel = MasterModelMapper.Companion.scenarioToMasterModel(scenario);
} else if (FilenameUtils.getExtension(filePath.toString()).equals("json")) {
ExtendedMultiModel multiModel = (new ObjectMapper()).readValue(file, ExtendedMultiModel.class);
System.out.println("Generating algorithm from multi-model");
ExtendedMultiModel multiModel = (new ObjectMapper()).readValue(file, ExtendedMultiModel.class);
masterModel = MasterModelMapper.Companion.multiModelToMasterModel(multiModel, 3);
} else {
return -1;
Expand Down

0 comments on commit 5c319fc

Please sign in to comment.