コード例 #1
0
        private static void RunIteration(long[,,] times, int n, int sizeIdx, int iteration, int workloadSize)
        {
            var watch     = new Stopwatch();
            var makeModel = MakeGenerator.GenerateMake(n);
            var startRule = make2Ant.SynchronizationRule <Make2Ant.Model2ModelMainRule>();

            var inputBatchModelContainer  = new InputModelContainer(CopyMakeModel(makeModel));
            var outputBatchModelContainer = new OutputModelContainer(new Model());

            Make2Ant.InputModelContainer  = inputBatchModelContainer;
            Make2Ant.OutputModelContainer = outputBatchModelContainer;

            watch.Start();
            make2Ant.Synchronize(startRule, ref inputBatchModelContainer, ref outputBatchModelContainer, SynchronizationDirection.LeftToRight, ChangePropagationMode.None);
            watch.Stop();
            times[sizeIdx, iteration, 0] = watch.Elapsed.Ticks * 100;

            var inputIncModelContainer  = new InputModelContainer(CopyMakeModel(makeModel));
            var outputIncModelContainer = new OutputModelContainer(new Model());

            Make2Ant.InputModelContainer  = inputBatchModelContainer;
            Make2Ant.OutputModelContainer = outputBatchModelContainer;

            watch.Restart();
            make2Ant.Synchronize(startRule, ref inputIncModelContainer, ref outputIncModelContainer, SynchronizationDirection.LeftToRight, ChangePropagationMode.OneWay);
            watch.Stop();
            times[sizeIdx, iteration, 1] = watch.Elapsed.Ticks * 100;

            var workload = MakeGenerator.GenerateChangeWorkload(makeModel, workloadSize);

            PlayBatchNet(times, sizeIdx, iteration, startRule, watch, ref inputBatchModelContainer, ref outputBatchModelContainer, workload);
            PlayIncremental(times, sizeIdx, iteration, watch, inputIncModelContainer, outputIncModelContainer, workload);
            PlayChangesOnly(times, sizeIdx, iteration, watch, CopyMakeModel(makeModel), workload);

            var inputModelContainer  = new InputModelContainer(CopyMakeModel(makeModel));
            var outputModelContainer = new OutputModelContainer(new Model());

            Make2Ant.InputModelContainer  = inputBatchModelContainer;
            Make2Ant.OutputModelContainer = outputBatchModelContainer;

            CreateModelsForAtlTransformation(n, iteration, workload, startRule, inputModelContainer, outputModelContainer);
        }
コード例 #2
0
ファイル: Make2Ant.cs プロジェクト: georghinkel/atlbenchmark
 public Make2Ant(InputModelContainer inputModelContainer, OutputModelContainer outputModelContainer)
 {
     InputModelContainer  = inputModelContainer;
     OutputModelContainer = outputModelContainer;
 }
コード例 #3
0
        private static void CreateModelsForAtlTransformation(int n, int iteration, List <MakeWorkloadAction> workload, Make2Ant.Model2ModelMainRule startRule, InputModelContainer inputModelContainer, OutputModelContainer outputModelContainer)
        {
            var outputRepository = new ModelRepository();

            Directory.CreateDirectory("makeInputModels");
            Directory.CreateDirectory("makeInputModels\\" + n);
            Directory.CreateDirectory("makeInputModels\\" + n + "\\" + iteration);

            make2Ant.Synchronize(startRule, ref inputModelContainer, ref outputModelContainer, SynchronizationDirection.LeftToRight, ChangePropagationMode.OneWay);

            for (int index = 0; index < workload.Count; index++)
            {
                var item = workload[index];
                item.Perform(inputModelContainer.IN);
                outputRepository.Save(inputModelContainer.IN, "makeInputModels\\" + n + "\\" + iteration + "\\" + "inputModel" + index + ".xmi");
            }
        }
コード例 #4
0
        private static void RerunBatchSynchronization(Make2Ant.Model2ModelMainRule startRule, ref InputModelContainer inputModelContainer, ref OutputModelContainer outputModelContainer)
        {
            outputModelContainer = new OutputModelContainer(new Model());

            make2Ant.Synchronize(startRule, ref inputModelContainer, ref outputModelContainer, SynchronizationDirection.LeftToRight, ChangePropagationMode.None);
        }
コード例 #5
0
        private static void PlayBatchNet(long[,,] times, int sizeIdx, int iteration, Make2Ant.Model2ModelMainRule startRule, Stopwatch watch, ref InputModelContainer inputModelContainer, ref OutputModelContainer outputModelContainer, List <MakeWorkloadAction> workload)
        {
            Make2Ant.InputModelContainer  = inputModelContainer;
            Make2Ant.OutputModelContainer = outputModelContainer;

            watch.Restart();
            foreach (var item in workload)
            {
                item.Perform(inputModelContainer.IN);
                RerunBatchSynchronization(startRule, ref inputModelContainer, ref outputModelContainer);
            }
            watch.Stop();

            times[sizeIdx, iteration, 2] = watch.Elapsed.Ticks * 100;
        }
コード例 #6
0
        private static void PlayIncremental(long[,,] times, int sizeIdx, int iteration, Stopwatch watch, InputModelContainer inputModelContainer, OutputModelContainer outputModelContainer, List <MakeWorkloadAction> workload)
        {
            Make2Ant.InputModelContainer  = inputModelContainer;
            Make2Ant.OutputModelContainer = outputModelContainer;

            watch.Restart();
            foreach (var item in workload)
            {
                item.Perform(inputModelContainer.IN);
            }
            watch.Stop();

            times[sizeIdx, iteration, 3] = watch.Elapsed.Ticks * 100;
        }