Commit f634f3d6 authored by Nicola Gatto's avatar Nicola Gatto
Browse files

Adapt reward generator interface

parent 38a8fac5
Pipeline #160464 failed with stages
......@@ -20,6 +20,7 @@ import de.monticore.lang.monticar.generator.FileContent;
import de.monticore.lang.monticar.generator.cpp.GeneratorCPP;
import de.monticore.lang.monticar.generator.pythonwrapper.GeneratorPythonWrapperStandaloneApi;
import de.monticore.lang.monticar.generator.pythonwrapper.symbolservices.data.ComponentPortInformation;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
import de.se_rwth.commons.logging.Log;
import java.io.File;
......@@ -165,8 +166,11 @@ public class CNNTrain2Gluon extends CNNTrainGenerator {
setRootProjectModelsDir(modelsDirPath.toString());
}
EMAComponentInstanceSymbol emaSymbol = rewardFunctionSourceGenerator.generate(getRootProjectModelsDir().get(),
rewardFunctionRootModel, rewardFunctionOutputPath);
final TaggingResolver taggingResolver
= rewardFunctionSourceGenerator.createTaggingResolver(getRootProjectModelsDir().get());
final EMAComponentInstanceSymbol emaSymbol
= rewardFunctionSourceGenerator.resolveSymbol(taggingResolver, rewardFunctionRootModel);
rewardFunctionSourceGenerator.generate(emaSymbol, taggingResolver, rewardFunctionOutputPath);
fixArmadilloEmamGenerationOfFile(Paths.get(rewardFunctionOutputPath, String.join("_", fullNameOfComponent) + ".h"));
String pythonWrapperOutputPath = Paths.get(rewardFunctionOutputPath, "pylib").toString();
......
package de.monticore.lang.monticar.cnnarch.gluongenerator.reinforcement;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
/**
*
*/
public interface RewardFunctionSourceGenerator {
EMAComponentInstanceSymbol generate(String modelPath, String qualifiedName, String targetPath);
TaggingResolver createTaggingResolver(String modelPath);
EMAComponentInstanceSymbol resolveSymbol(TaggingResolver taggingResolver, String rootModel);
void generate(String modelPath, String rootModel, String targetPath);
void generate(EMAComponentInstanceSymbol componentInstanceSymbol, TaggingResolver taggingResolver, String targetPath);
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment