Skip to content
Snippets Groups Projects
Verified Commit 7c534f9a authored by Rico Bergmann's avatar Rico Bergmann
Browse files

[RSYNC] Support multiple integration strategies

parent 293b3887
Branches
No related tags found
No related merge requests found
import ttc2019.{CompleteTTCProcess, MetricMeasurement, TTCProcessConfiguration}
import ttc2019.{CompleteTTCProcess, MetricMeasurement, ProcessMode, TTCProcessConfiguration}
import ttc2019.benchmark.{Benchmark, BenchmarkInfo, ReportingUtility}
import scala.reflect.io.File
......@@ -12,11 +12,19 @@ object MainApp extends App {
val Load = "Load"
val Run = "Run"
var processMode = ProcessMode.BDT
if (args.length >= 1) {
args.apply(1) match {
case "bdt" => processMode = ProcessMode.BDT
case "bdd" => processMode = ProcessMode.BDD
case "bdt-u" => processMode = ProcessMode.BDTU
case "bdd-u" => processMode = ProcessMode.BDDU
}
}
private val modelPath = sys.env.get("ModelPath")
private val benchmarkInfo = fetchBenchmarkInfo()
println()
if (modelPath.isEmpty) {
sys.error("Expected model to convert in the ModelPath environment variable")
}
......@@ -24,7 +32,7 @@ object MainApp extends App {
modelPath.foreach(modelPath => {
val ttModelFile = File(modelPath)
val bddModelFile = buildBddModelFile(ttModelFile)
val processConfig = TTCProcessConfiguration(ttFileName = modelPath, bddFileName = bddModelFile.jfile.getCanonicalPath)
val processConfig = TTCProcessConfiguration(ttFileName = modelPath, bddFileName = bddModelFile.jfile.getCanonicalPath, processMode = processMode)
val benchmarkingService: Benchmark = new Benchmark
var benchmarkDuration: Long = -1
......
......@@ -33,16 +33,16 @@ object CompleteTTCProcess extends App {
*/
def initialize(processConfig: TTCProcessConfiguration): Unit = {
val sync = true
bdt = false
bdt = processConfig.processMode == ProcessMode.BDT || processConfig.processMode == ProcessMode.BDTU
loader = new TTCLoader
validator = new Launcher
if (sync) {
ctts = new CreateTruthTableSync()
if (bdt) {
integrate = BdtSyncIntegration
integrate = if (processConfig.processMode == ProcessMode.BDT) BdtSyncIntegration else BdtSyncIntegrationWithoutOrder
writeOut = WriteSyncBdtOutput
} else {
integrate = BddSyncIntegration
integrate = if (processConfig.processMode == ProcessMode.BDD) BddSyncIntegration else BddSyncIntegrationWithoutOrder
writeOut = WriteSyncBddOutput
}
} else {
......
package ttc2019
object ProcessMode extends Enumeration {
type ProcessMode = Value
val BDT, BDTU, BDD, BDDU = Value
}
package ttc2019
import ttc2019.ProcessMode.ProcessMode
/** The `ProcessConfiguration` contains all necessary information to setup an entire transformation
* workflow as specified by the [[CompleteTTCProcess]].
*
......@@ -10,5 +12,5 @@ package ttc2019
* decision diagram should be stored
* - `ttEcoreName` references the path to the truth table EMF model
*/
case class TTCProcessConfiguration(ttFileName: String, bddFileName: String, ttEcoreName: String = "TT.ecore")
case class TTCProcessConfiguration(ttFileName: String, bddFileName: String, ttEcoreName: String = "TT.ecore", processMode: ProcessMode)
[build]
default=cd ../RSync && sbt compile
skipTests=cd ../RSync && sbt compile
[run]
cmd=cd ../RSync && sbt --error run bdd-u
[build]
default=cd ../RSync && sbt compile
skipTests=cd ../RSync && sbt compile
[run]
cmd=cd ../RSync && sbt --error run bdd
[build]
default=cd ../RSync && sbt compile
skipTests=cd ../RSync && sbt compile
[run]
cmd=cd ../RSync && sbt --error run bdt-u
[build]
default=cd ../RSync && sbt compile
skipTests=cd ../RSync && sbt compile
[run]
cmd=cd ../RSync && sbt --error run bdt
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment