Beispiel #1
0
        private static void RunIteration(long[,,] times, int n, int sizeIdx, int iteration, int workloadSize)
        {
            var watch         = new Stopwatch();
            var familiesModel = FamiliesGenerator.GenerateFamilies(n);
            var startRule     = families2Persons.SynchronizationRule <Families2Persons.Model2ModelMainRule>();

            var inputBatchModelContainer  = new InputModelContainer(CopyFamilyModel(familiesModel));
            var outputBatchModelContainer = new OutputModelContainer(new Model());

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

            var inputIncModelContainer  = new InputModelContainer(CopyFamilyModel(familiesModel));
            var outputIncModelContainer = new OutputModelContainer(new Model());

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

            var workload = FamiliesGenerator.GenerateChangeWorkload(familiesModel, workloadSize);

            PlayBatchNet(times, sizeIdx, iteration, startRule, watch, ref inputBatchModelContainer, ref outputBatchModelContainer, workload);
            PlayIncremental(times, sizeIdx, iteration, watch, inputIncModelContainer, workload);
            PlayChangesOnly(times, sizeIdx, iteration, watch, CopyFamilyModel(familiesModel), workload);

            var inputModelContainer  = new InputModelContainer(CopyFamilyModel(familiesModel));
            var outputModelContainer = new OutputModelContainer(new Model());

            CreateModelsForAtlTransformation(n, iteration, workload, startRule, inputModelContainer, outputModelContainer);
        }
Beispiel #2
0
        public void PortV3Suceeds()
        {
            //absolute path is needed for the execution from a junit test
            var absolutePathInputModel1 = "PortV3\\SampleInput.xmi";

            //load input models
            var repository  = new ModelRepository();
            var inputModel1 = repository.Resolve(absolutePathInputModel1);

            if (inputModel1 == null)
            {
                throw new FileNotFoundException("One of the Input Models was not found");
            }

            var inputModelContainer  = new InputModelContainer(inputModel1);
            var outputModelContainer = new OutputModelContainer();

            var direction          = SynchronizationDirection.LeftToRight;
            var changePropagartion = ChangePropagationMode.OneWay;
            var transformation     = new PortV3Namespace.PortV3();

            PortV3Namespace.PortV3.InputModelContainer = inputModelContainer;

            var context = transformation.Synchronize(transformation.SynchronizationRule <PortV3Namespace.PortV3.Model2ModelMainRule>(), ref inputModelContainer, ref outputModelContainer, direction, changePropagartion);
        }
        private static void PlayBatchNet(long[,,] times, int n, int sizeIdx, int iteration, Make2Ant.Model2ModelMainRule startRule, Stopwatch watch, ref InputModelContainer inputModelContainer, ref OutputModelContainer outputModelContainer, List <MakeWorkloadAction> workload)
        {
            var outputRepository = new ModelRepository();

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

            Make2Ant.InputModelContainer  = inputModelContainer;
            Make2Ant.OutputModelContainer = outputModelContainer;

            watch.Restart();
            for (int index = 0; index < workload.Count; index++)
            {
                var item = workload[index];
                item.Perform(inputModelContainer.IN);

                outputModelContainer = new OutputModelContainer(new Model());
                RerunBatchSynchronization(startRule, ref inputModelContainer, ref outputModelContainer);
                var tempRepo = new ModelRepository();
                tempRepo.Resolve("makeInputModelsSync\\" + n + "\\" + iteration + "\\" + "outputModel" + index + ".xmi");
                outputRepository.Save(outputModelContainer.OUT, "makeOutputModelsBatchSync\\" + n + "\\" + iteration + "\\" + "outputModel" + index + ".xmi");
            }
            watch.Stop();

            Directory.Delete("makeOutputModelsBatchSync", true);

            times[sizeIdx, iteration, 2] = watch.Elapsed.Ticks * 100;
        }
        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);

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

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

            Make2Ant.InputModelContainer  = inputBatchModelContainer;
            Make2Ant.OutputModelContainer = outputBatchModelContainer;
        }
Beispiel #5
0
        private static void CreateModelsForAtlTransformation(int n, int iteration, List <FamilyWorkloadAction> workload, Families2Persons.Model2ModelMainRule startRule, InputModelContainer inputModelContainer, OutputModelContainer outputModelContainer)
        {
            var outputRepository = new ModelRepository();

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

            families2Persons.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, "familyInputModels\\" + n + "\\" + iteration + "\\" + "inputModel" + index + ".xmi");
            }
        }
Beispiel #6
0
        private static void RerunBatchSynchronization(Families2Persons.Model2ModelMainRule startRule, ref InputModelContainer inputModelContainer, ref OutputModelContainer outputModelContainer)
        {
            outputModelContainer = new OutputModelContainer(new Model());

            families2Persons.Synchronize(startRule, ref inputModelContainer, ref outputModelContainer, SynchronizationDirection.LeftToRight, ChangePropagationMode.None);
        }
Beispiel #7
0
        private static void PlayBatchNet(long[,,] times, int sizeIdx, int iteration, Families2Persons.Model2ModelMainRule startRule, Stopwatch watch, ref InputModelContainer inputModelContainer, ref OutputModelContainer outputModelContainer, List <FamilyWorkloadAction> workload)
        {
            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;
        }
 private static void RerunBatchSynchronization(Make2Ant.Model2ModelMainRule startRule, ref InputModelContainer inputModelContainer, ref OutputModelContainer outputModelContainer)
 {
     make2Ant.Synchronize(startRule, ref inputModelContainer, ref outputModelContainer, SynchronizationDirection.LeftToRight, ChangePropagationMode.None);
 }
        private static void PlayIncremental(long[,,] times, int n, int sizeIdx, int iteration, Stopwatch watch, InputModelContainer inputModelContainer, OutputModelContainer outputModelContainer, List <MakeWorkloadAction> workload)
        {
            var outputRepository = new ModelRepository();

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

            Make2Ant.InputModelContainer  = inputModelContainer;
            Make2Ant.OutputModelContainer = outputModelContainer;

            watch.Restart();
            for (int index = 0; index < workload.Count; index++)
            {
                var item = workload[index];
                item.Perform(inputModelContainer.IN);
                var tempRepo = new ModelRepository();
                tempRepo.Resolve("makeInputModelsSync\\" + n + "\\" + iteration + "\\" + "inputModel" + index + ".xmi");
                outputRepository.Save(outputModelContainer.OUT, "makeOutputModelsIncSync\\" + n + "\\" + iteration + "\\" + "outputModel" + index + ".xmi");
            }

            watch.Stop();

            Directory.Delete("makeOutputModelsIncSync", true);

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