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,8 +9,7 @@ import ttc2019.worksync._ ...@@ -9,8 +9,7 @@ import ttc2019.worksync._
import ttc2019.worksum._ import ttc2019.worksum._
import ttc2019.metamodels.create.Launcher import ttc2019.metamodels.create.Launcher
/** /** The `CompleteTTCProcess` executes the entire transformation workflow. Its methods are inspired
* The `CompleteTTCProcess` executes the entire transformation workflow. Its methods are inspired
* by the different phases that the benchmark is expecting. * by the different phases that the benchmark is expecting.
*/ */
object CompleteTTCProcess extends App { object CompleteTTCProcess extends App {
...@@ -26,8 +25,7 @@ object CompleteTTCProcess extends App { ...@@ -26,8 +25,7 @@ object CompleteTTCProcess extends App {
var processConfig: TTCProcessConfiguration = _ var processConfig: TTCProcessConfiguration = _
var bdt: Boolean = _ var bdt: Boolean = _
/** /** Performs necessary setup instructions such as loading the ecore meta-model.
* Performs necessary setup instructions such as loading the ecore meta-model.
* *
* @param processConfig contains the necessary file locations * @param processConfig contains the necessary file locations
*/ */
...@@ -54,36 +52,30 @@ object CompleteTTCProcess extends App { ...@@ -54,36 +52,30 @@ object CompleteTTCProcess extends App {
saver = loader.javaOptimizedTTJavaEcore(processConfig.ttEcoreName, processConfig.ttFileName) saver = loader.javaOptimizedTTJavaEcore(processConfig.ttEcoreName, processConfig.ttFileName)
} }
/** /** Loads the truth table.
* Loads the truth table.
*/ */
def load(): Unit = loader.createTruthTableRSYNCInstance(saver, ctts) 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) 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") def printModelElements(): Unit = ModelElementLists.printFromPackage("sync.bdd.BDD")
/** /** Persists the BDD in the File system (according to the
* Persists the BDD in the File system (according to the
* [[TTCProcessConfiguration process configuration]] specified during * [[TTCProcessConfiguration process configuration]] specified during
* [[initialize() initialization]] '''after transformation'''. * [[initialize() initialization]] '''after transformation'''.
*/ */
def writeBdd(): Unit = writeOut.generateEverything(processConfig.bddFileName) def writeBdd(): Unit = writeOut.generateEverything(processConfig.bddFileName)
/** /** Checks, whether the generated BDD and the original TT work as expected (after
* Checks, whether the generated BDD and the original TT work as expected (after
* transformation!). * transformation!).
*/ */
def validateModelEquality(): Unit = validator.launch(processConfig.ttFileName, processConfig.bddFileName) def validateModelEquality(): Unit = validator.launch(processConfig.ttFileName, processConfig.bddFileName)
/** /** Runs the entire transformation process at once.
* Runs the entire transformation process at once.
* *
* That is initialization, loading and running as the core part, as well as printing the model, * 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 * writing the generated BDD and validating as extensions of the minimal workflow will be
...@@ -99,7 +91,7 @@ object CompleteTTCProcess extends App { ...@@ -99,7 +91,7 @@ object CompleteTTCProcess extends App {
} }
override def main(args: Array[String]): Unit = { 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) executeEntireProcess(processConfig)
} }
......
package ttc2019 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 { object ProcessMode extends Enumeration {
type ProcessMode = Value 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 ...@@ -11,6 +11,7 @@ import ttc2019.ProcessMode.ProcessMode
* - `bddFileName` references the name (i.e. path) of the file where the generated binary * - `bddFileName` references the name (i.e. path) of the file where the generated binary
* 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
* - `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) 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