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

[RSYNC] Document different processing modes

parent 7c534f9a
No related branches found
No related tags found
No related merge requests found
......@@ -9,10 +9,9 @@ import ttc2019.worksync._
import ttc2019.worksum._
import ttc2019.metamodels.create.Launcher
/**
* The `CompleteTTCProcess` executes the entire transformation workflow. Its methods are inspired
* by the different phases that the benchmark is expecting.
*/
/** The `CompleteTTCProcess` executes the entire transformation workflow. Its methods are inspired
* by the different phases that the benchmark is expecting.
*/
object CompleteTTCProcess extends App {
SynchronizationCompartment combine RsumCompartment
......@@ -26,11 +25,10 @@ object CompleteTTCProcess extends App {
var processConfig: TTCProcessConfiguration = _
var bdt: Boolean = _
/**
* Performs necessary setup instructions such as loading the ecore meta-model.
*
* @param processConfig contains the necessary file locations
*/
/** Performs necessary setup instructions such as loading the ecore meta-model.
*
* @param processConfig contains the necessary file locations
*/
def initialize(processConfig: TTCProcessConfiguration): Unit = {
val sync = true
bdt = processConfig.processMode == ProcessMode.BDT || processConfig.processMode == ProcessMode.BDTU
......@@ -54,41 +52,35 @@ object CompleteTTCProcess extends App {
saver = loader.javaOptimizedTTJavaEcore(processConfig.ttEcoreName, processConfig.ttFileName)
}
/**
* Loads the truth table.
*/
/** Loads the truth table.
*/
def load(): Unit = loader.createTruthTableRSYNCInstance(saver, ctts)
/**
* Transforms the truth table instance to a binary decision diagram.
*/
/** Transforms the truth table instance to a binary decision diagram.
*/
def run(): Unit = SynchronizationCompartment.integrateNewModel(integrate)
/**
* Shows all created TT and BDD elements '''after transformation'''.
*/
/** Shows all created TT and BDD elements '''after transformation'''.
*/
def printModelElements(): Unit = ModelElementLists.printFromPackage("sync.bdd.BDD")
/**
* Persists the BDD in the File system (according to the
* [[TTCProcessConfiguration process configuration]] specified during
* [[initialize() initialization]] '''after transformation'''.
*/
/** Persists the BDD in the File system (according to the
* [[TTCProcessConfiguration process configuration]] specified during
* [[initialize() initialization]] '''after transformation'''.
*/
def writeBdd(): Unit = writeOut.generateEverything(processConfig.bddFileName)
/**
* Checks, whether the generated BDD and the original TT work as expected (after
* transformation!).
*/
/** Checks, whether the generated BDD and the original TT work as expected (after
* transformation!).
*/
def validateModelEquality(): Unit = validator.launch(processConfig.ttFileName, processConfig.bddFileName)
/**
* Runs the entire transformation process at once.
*
* That is initialization, loading and running as the core part, as well as printing the model,
* writing the generated BDD and validating as extensions of the minimal workflow will be
* executed.
*/
/** Runs the entire transformation process at once.
*
* That is initialization, loading and running as the core part, as well as printing the model,
* writing the generated BDD and validating as extensions of the minimal workflow will be
* executed.
*/
def executeEntireProcess(processConfig: TTCProcessConfiguration): Unit = {
initialize(processConfig)
load()
......@@ -99,7 +91,7 @@ object CompleteTTCProcess extends App {
}
override def main(args: Array[String]): Unit = {
val processConfig = TTCProcessConfiguration(ttFileName = "TT.ttmodel", bddFileName = "Generated.bddmodel")
val processConfig = TTCProcessConfiguration(ttFileName = "TT.ttmodel", bddFileName = "Generated.bddmodel", processMode = ProcessMode.BDT)
executeEntireProcess(processConfig)
}
......
package ttc2019
/** The `ProcessMode` describes the strategy that should be used in order to create the equivalent
* binary decision tree or binary decision diagram.
*/
object ProcessMode extends Enumeration {
type ProcessMode = Value
val BDT, BDTU, BDD, BDDU = Value
/** A default binary decision tree should be generated.
*/
val BDT,
/** A binary decision tree should be generated but the input ports may be visited in any
* order.
*/
BDTU,
/** A binary decision diagram should be generated.
*/
BDD,
/** A binary decision diagram should be generated and the input ports may be visited in any
* order.
*/
BDDU = Value
}
......@@ -11,6 +11,7 @@ import ttc2019.ProcessMode.ProcessMode
* - `bddFileName` references the name (i.e. path) of the file where the generated binary
* decision diagram should be stored
* - `ttEcoreName` references the path to the truth table EMF model
* - `processMode` sets the strategy to use for generating the binary decision tree / diagram
*/
case class TTCProcessConfiguration(ttFileName: String, bddFileName: String, ttEcoreName: String = "TT.ecore", processMode: ProcessMode)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment