Skip to content

Commit

Permalink
add inputCodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Laxraa committed Sep 9, 2023
1 parent d4e6e32 commit e344ced
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import java.io.IOException;
import java.util.Map;

import edu.kit.kastel.mcse.ardoco.core.models.ArCoTLModelProviderAgent;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -14,7 +16,6 @@
import edu.kit.kastel.mcse.ardoco.core.connectiongenerator.ConnectionGenerator;
import edu.kit.kastel.mcse.ardoco.core.execution.ArDoCo;
import edu.kit.kastel.mcse.ardoco.core.inconsistency.InconsistencyChecker;
import edu.kit.kastel.mcse.ardoco.core.models.ModelProviderAgent;
import edu.kit.kastel.mcse.ardoco.core.recommendationgenerator.RecommendationGenerator;
import edu.kit.kastel.mcse.ardoco.core.text.providers.TextPreprocessingAgent;
import edu.kit.kastel.mcse.ardoco.core.textextraction.TextExtraction;
Expand All @@ -26,10 +27,10 @@ public ArDoCoForInconsistencyDetection(String projectName) {
super(projectName);
}

public void setUp(File inputText, File inputModelArchitecture, ArchitectureModelType inputArchitectureModelType, Map<String, String> additionalConfigs,
public void setUp(File inputText, File inputModelArchitecture, ArchitectureModelType inputArchitectureModelType, File inputCode, Map<String, String> additionalConfigs,
File outputDir) {
try {
definePipeline(inputText, inputModelArchitecture, inputArchitectureModelType, additionalConfigs);
definePipeline(inputText, inputModelArchitecture, inputArchitectureModelType, inputCode, additionalConfigs);
} catch (IOException e) {
logger.error("Problem in initialising pipeline when loading data (IOException)", e.getCause());
isSetUp = false;
Expand All @@ -40,8 +41,8 @@ public void setUp(File inputText, File inputModelArchitecture, ArchitectureModel
}

public void setUp(String inputTextLocation, String inputArchitectureModelLocation, ArchitectureModelType architectureModelType,
Map<String, String> additionalConfigs, String outputDirectory) {
setUp(new File(inputTextLocation), new File(inputArchitectureModelLocation), architectureModelType, additionalConfigs, new File(outputDirectory));
String inputCodeLocation, Map<String, String> additionalConfigs, String outputDirectory) {
setUp(new File(inputTextLocation), new File(inputArchitectureModelLocation), architectureModelType, new File(inputCodeLocation), additionalConfigs, new File(outputDirectory));
}

/**
Expand All @@ -53,7 +54,7 @@ public void setUp(String inputTextLocation, String inputArchitectureModelLocatio
* @param additionalConfigs the additional configs
* @throws IOException When one of the input files cannot be accessed/loaded
*/
private void definePipeline(File inputText, File inputArchitectureModel, ArchitectureModelType architectureModelType, Map<String, String> additionalConfigs)
private void definePipeline(File inputText, File inputArchitectureModel, ArchitectureModelType architectureModelType, File inputCode, Map<String, String> additionalConfigs)
throws IOException {
ArDoCo arDoCo = getArDoCo();
var dataRepository = arDoCo.getDataRepository();
Expand All @@ -64,7 +65,7 @@ private void definePipeline(File inputText, File inputArchitectureModel, Archite
DataRepositoryHelper.putInputText(dataRepository, text);

arDoCo.addPipelineStep(TextPreprocessingAgent.get(additionalConfigs, dataRepository));
arDoCo.addPipelineStep(ModelProviderAgent.get(inputArchitectureModel, architectureModelType, dataRepository));
arDoCo.addPipelineStep(ArCoTLModelProviderAgent.get(inputArchitectureModel, architectureModelType, inputCode, additionalConfigs, dataRepository));
arDoCo.addPipelineStep(TextExtraction.get(additionalConfigs, dataRepository));
arDoCo.addPipelineStep(RecommendationGenerator.get(additionalConfigs, dataRepository));
arDoCo.addPipelineStep(ConnectionGenerator.get(additionalConfigs, dataRepository));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import java.io.IOException;
import java.util.Map;

import edu.kit.kastel.mcse.ardoco.core.models.ArCoTLModelProviderAgent;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -14,7 +16,6 @@
import edu.kit.kastel.mcse.ardoco.core.connectiongenerator.ConnectionGenerator;
import edu.kit.kastel.mcse.ardoco.core.execution.ArDoCo;
import edu.kit.kastel.mcse.ardoco.core.inconsistency.InconsistencyChecker;
import edu.kit.kastel.mcse.ardoco.core.models.ModelProviderAgent;
import edu.kit.kastel.mcse.ardoco.core.recommendationgenerator.RecommendationGenerator;
import edu.kit.kastel.mcse.ardoco.core.text.providers.TextPreprocessingAgent;
import edu.kit.kastel.mcse.ardoco.core.textextraction.TextExtraction;
Expand All @@ -31,9 +32,9 @@ public ArDoCoForLiSSA(String projectName) {
}

public void setUp(File diagramDirectory, File inputText, File inputModelArchitecture, ArchitectureModelType inputArchitectureModelType,
Map<String, String> additionalConfigs, File outputDir) {
File inputCode, Map<String, String> additionalConfigs, File outputDir) {
try {
definePipeline(diagramDirectory, inputText, inputModelArchitecture, inputArchitectureModelType, additionalConfigs);
definePipeline(diagramDirectory, inputText, inputModelArchitecture, inputArchitectureModelType, inputCode, additionalConfigs);
} catch (IOException e) {
logger.error("Problem in initialising pipeline when loading data (IOException)", e.getCause());
isSetUp = false;
Expand All @@ -44,9 +45,9 @@ public void setUp(File diagramDirectory, File inputText, File inputModelArchitec
}

public void setUp(String diagramDirectory, String inputTextLocation, String inputArchitectureModelLocation, ArchitectureModelType architectureModelType,
Map<String, String> additionalConfigs, String outputDirectory) {
setUp(new File(diagramDirectory), new File(inputTextLocation), new File(inputArchitectureModelLocation), architectureModelType, additionalConfigs,
new File(outputDirectory));
String inputCodeLocation, Map<String, String> additionalConfigs, String outputDirectory) {
setUp(new File(diagramDirectory), new File(inputTextLocation), new File(inputArchitectureModelLocation), architectureModelType, new File(inputCodeLocation),
additionalConfigs, new File(outputDirectory));
}

/**
Expand All @@ -60,7 +61,7 @@ public void setUp(String diagramDirectory, String inputTextLocation, String inpu
* @throws IOException When one of the input files cannot be accessed/loaded
*/
private void definePipeline(File diagramDirectory, File inputText, File inputArchitectureModel, ArchitectureModelType architectureModelType,
Map<String, String> additionalConfigs) throws IOException {
File inputCode, Map<String, String> additionalConfigs) throws IOException {
ArDoCo arDoCo = getArDoCo();
var dataRepository = arDoCo.getDataRepository();
var text = CommonUtilities.readInputText(inputText);
Expand All @@ -72,7 +73,7 @@ private void definePipeline(File diagramDirectory, File inputText, File inputArc

arDoCo.addPipelineStep(DiagramRecognition.get(additionalConfigs, dataRepository));
arDoCo.addPipelineStep(TextPreprocessingAgent.get(additionalConfigs, dataRepository));
arDoCo.addPipelineStep(ModelProviderAgent.get(inputArchitectureModel, architectureModelType, dataRepository));
arDoCo.addPipelineStep(ArCoTLModelProviderAgent.get(inputArchitectureModel, architectureModelType, inputCode, additionalConfigs, dataRepository));
arDoCo.addPipelineStep(TextExtraction.get(additionalConfigs, dataRepository));
arDoCo.addPipelineStep(RecommendationGenerator.get(additionalConfigs, dataRepository));
arDoCo.addPipelineStep(ConnectionGenerator.get(additionalConfigs, dataRepository));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import edu.kit.kastel.mcse.ardoco.core.connectiongenerator.ConnectionGenerator;
import edu.kit.kastel.mcse.ardoco.core.execution.runner.ArDoCoRunner;
import edu.kit.kastel.mcse.ardoco.core.models.ArCoTLModelProviderAgent;
import edu.kit.kastel.mcse.ardoco.core.models.ModelProviderAgent;
import edu.kit.kastel.mcse.ardoco.core.recommendationgenerator.RecommendationGenerator;
import edu.kit.kastel.mcse.ardoco.core.text.providers.TextPreprocessingAgent;
import edu.kit.kastel.mcse.ardoco.core.textextraction.TextExtraction;
Expand Down Expand Up @@ -54,7 +53,7 @@ private void definePipeline(File inputText, File inputArchitectureModel, Archite
DataRepositoryHelper.putInputText(dataRepository, text);

arDoCo.addPipelineStep(TextPreprocessingAgent.get(additionalConfigs, dataRepository));
arDoCo.addPipelineStep(ModelProviderAgent.get(inputArchitectureModel, architectureModelType, dataRepository));
arDoCo.addPipelineStep(ArCoTLModelProviderAgent.get(inputArchitectureModel, architectureModelType, inputCode, additionalConfigs, dataRepository));

arDoCo.addPipelineStep(TextExtraction.get(additionalConfigs, dataRepository));
arDoCo.addPipelineStep(RecommendationGenerator.get(additionalConfigs, dataRepository));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import java.io.IOException;
import java.util.Map;

import edu.kit.kastel.mcse.ardoco.core.models.ArCoTLModelProviderAgent;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -13,7 +15,6 @@
import edu.kit.kastel.mcse.ardoco.core.common.util.DataRepositoryHelper;
import edu.kit.kastel.mcse.ardoco.core.connectiongenerator.ConnectionGenerator;
import edu.kit.kastel.mcse.ardoco.core.execution.runner.ArDoCoRunner;
import edu.kit.kastel.mcse.ardoco.core.models.ModelProviderAgent;
import edu.kit.kastel.mcse.ardoco.core.recommendationgenerator.RecommendationGenerator;
import edu.kit.kastel.mcse.ardoco.core.text.providers.TextPreprocessingAgent;
import edu.kit.kastel.mcse.ardoco.core.textextraction.TextExtraction;
Expand All @@ -25,10 +26,10 @@ public ArDoCoForSadSamTraceabilityLinkRecovery(String projectName) {
super(projectName);
}

public void setUp(File inputText, File inputArchitectureModel, ArchitectureModelType architectureModelType, Map<String, String> additionalConfigs,
public void setUp(File inputText, File inputArchitectureModel, ArchitectureModelType architectureModelType, File inputCode, Map<String, String> additionalConfigs,
File outputDir) {
try {
definePipeline(inputText, inputArchitectureModel, architectureModelType, additionalConfigs);
definePipeline(inputText, inputArchitectureModel, architectureModelType, inputCode, additionalConfigs);
} catch (IOException e) {
logger.error("Problem in initialising pipeline when loading data (IOException)", e.getCause());
isSetUp = false;
Expand All @@ -38,12 +39,12 @@ public void setUp(File inputText, File inputArchitectureModel, ArchitectureModel
isSetUp = true;
}

public void setUp(String inputTextLocation, String inputArchitectureModelLocation, ArchitectureModelType architectureModelType,
public void setUp(String inputTextLocation, String inputArchitectureModelLocation, ArchitectureModelType architectureModelType, String inputCodeLocation,
Map<String, String> additionalConfigs, String outputDirectory) {
setUp(new File(inputTextLocation), new File(inputArchitectureModelLocation), architectureModelType, additionalConfigs, new File(outputDirectory));
setUp(new File(inputTextLocation), new File(inputArchitectureModelLocation), architectureModelType, new File(inputCodeLocation), additionalConfigs, new File(outputDirectory));
}

private void definePipeline(File inputText, File inputArchitectureModel, ArchitectureModelType architectureModelType, Map<String, String> additionalConfigs)
private void definePipeline(File inputText, File inputArchitectureModel, ArchitectureModelType architectureModelType, File inputCode, Map<String, String> additionalConfigs)
throws IOException {
var dataRepository = this.getArDoCo().getDataRepository();
var text = CommonUtilities.readInputText(inputText);
Expand All @@ -53,7 +54,7 @@ private void definePipeline(File inputText, File inputArchitectureModel, Archite
DataRepositoryHelper.putInputText(dataRepository, text);

this.getArDoCo().addPipelineStep(TextPreprocessingAgent.get(additionalConfigs, dataRepository));
this.getArDoCo().addPipelineStep(ModelProviderAgent.get(inputArchitectureModel, architectureModelType, dataRepository));
this.getArDoCo().addPipelineStep(ArCoTLModelProviderAgent.get(inputArchitectureModel, architectureModelType, inputCode, additionalConfigs, dataRepository));

this.getArDoCo().addPipelineStep(TextExtraction.get(additionalConfigs, dataRepository));
this.getArDoCo().addPipelineStep(RecommendationGenerator.get(additionalConfigs, dataRepository));
Expand Down

0 comments on commit e344ced

Please sign in to comment.