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
No related branches found
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 ttc2019.benchmark.{Benchmark, BenchmarkInfo, ReportingUtility}
import scala.reflect.io.File import scala.reflect.io.File
...@@ -12,11 +12,19 @@ object MainApp extends App { ...@@ -12,11 +12,19 @@ object MainApp extends App {
val Load = "Load" val Load = "Load"
val Run = "Run" 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 modelPath = sys.env.get("ModelPath")
private val benchmarkInfo = fetchBenchmarkInfo() private val benchmarkInfo = fetchBenchmarkInfo()
println()
if (modelPath.isEmpty) { if (modelPath.isEmpty) {
sys.error("Expected model to convert in the ModelPath environment variable") sys.error("Expected model to convert in the ModelPath environment variable")
} }
...@@ -24,7 +32,7 @@ object MainApp extends App { ...@@ -24,7 +32,7 @@ object MainApp extends App {
modelPath.foreach(modelPath => { modelPath.foreach(modelPath => {
val ttModelFile = File(modelPath) val ttModelFile = File(modelPath)
val bddModelFile = buildBddModelFile(ttModelFile) 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 val benchmarkingService: Benchmark = new Benchmark
var benchmarkDuration: Long = -1 var benchmarkDuration: Long = -1
......
...@@ -33,16 +33,16 @@ object CompleteTTCProcess extends App { ...@@ -33,16 +33,16 @@ object CompleteTTCProcess extends App {
*/ */
def initialize(processConfig: TTCProcessConfiguration): Unit = { def initialize(processConfig: TTCProcessConfiguration): Unit = {
val sync = true val sync = true
bdt = false bdt = processConfig.processMode == ProcessMode.BDT || processConfig.processMode == ProcessMode.BDTU
loader = new TTCLoader loader = new TTCLoader
validator = new Launcher validator = new Launcher
if (sync) { if (sync) {
ctts = new CreateTruthTableSync() ctts = new CreateTruthTableSync()
if (bdt) { if (bdt) {
integrate = BdtSyncIntegration integrate = if (processConfig.processMode == ProcessMode.BDT) BdtSyncIntegration else BdtSyncIntegrationWithoutOrder
writeOut = WriteSyncBdtOutput writeOut = WriteSyncBdtOutput
} else { } else {
integrate = BddSyncIntegration integrate = if (processConfig.processMode == ProcessMode.BDD) BddSyncIntegration else BddSyncIntegrationWithoutOrder
writeOut = WriteSyncBddOutput writeOut = WriteSyncBddOutput
} }
} else { } else {
......
package ttc2019
object ProcessMode extends Enumeration {
type ProcessMode = Value
val BDT, BDTU, BDD, BDDU = Value
}
package ttc2019 package ttc2019
import ttc2019.ProcessMode.ProcessMode
/** The `ProcessConfiguration` contains all necessary information to setup an entire transformation /** The `ProcessConfiguration` contains all necessary information to setup an entire transformation
* workflow as specified by the [[CompleteTTCProcess]]. * workflow as specified by the [[CompleteTTCProcess]].
* *
...@@ -10,5 +12,5 @@ package ttc2019 ...@@ -10,5 +12,5 @@ package ttc2019
* decision diagram should be stored * decision diagram should be stored
* - `ttEcoreName` references the path to the truth table EMF model * - `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