Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the worsening model generation #17

Merged
merged 57 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
a7b5b57
Fix some dependencies
danieledipompeo Feb 5, 2020
74c7a8f
fix dependencies
danieledipompeo Apr 30, 2020
cf6acf6
Change hierarchy between RSolution and Solution
danieledipompeo May 1, 2020
e03a5c0
Update threshold in EVL module
danieledipompeo May 26, 2020
40d031f
Add EPSILON support for performance antipatterns detection
danieledipompeo May 28, 2020
1df8856
update .gitignore
danieledipompeo May 28, 2020
4b3a30d
Merge branch 'dev-updateThr-epsilon' into DEV
danieledipompeo May 28, 2020
32a71d6
add `RemoveClonedAEI` action
danieledipompeo May 29, 2020
befc62c
update logicalSpecification metamodel
danieledipompeo May 29, 2020
b55a181
update generated logical specification code
danieledipompeo May 29, 2020
3ab4617
Add remove clones refactoring action
danieledipompeo May 29, 2020
325eba1
Merge branch 'dev-logicalSpecification' into DEV
danieledipompeo May 29, 2020
2f4361b
clean up the code
danieledipompeo May 29, 2020
2d99bc1
Merge branch 'dev-logicalSpecification' into dev-addRemoveCloneAction
danieledipompeo May 29, 2020
4381847
Fix remove asserts (#14)
danieledipompeo May 30, 2020
e713954
Merge branch 'dev-addRemoveCloneAction' of github.com:SEALABQualityGr…
danieledipompeo May 30, 2020
90ea9eb
Merge branch 'dev-addRemoveCloneAction' into DEV
danieledipompeo Jun 5, 2020
09e1e8c
add easier-core project file
danieledipompeo Jun 5, 2020
eb08dbe
add new ValSpec parse
danieledipompeo Jun 6, 2020
c3bca13
remove println from epsilon files
danieledipompeo Jun 10, 2020
46395c5
fix csv header issue
danieledipompeo Jun 10, 2020
6371811
WIP on genereting worse models
danieledipompeo Jun 10, 2020
2f4b24d
add worsen to the config file
danieledipompeo Jun 10, 2020
f46eb46
some fixes on epsilon-helper
danieledipompeo Jun 15, 2020
2775fd8
minor changes on aemilia refactoring actions
danieledipompeo Jun 15, 2020
243809d
clean up duplicated code
danieledipompeo Jun 15, 2020
bc1615b
update exception management
danieledipompeo Jun 15, 2020
9e529e2
update exception management
danieledipompeo Jun 16, 2020
1a974b4
add support to epsilon
danieledipompeo Jun 16, 2020
99d45df
add support to generate worse models
danieledipompeo Jun 16, 2020
217df1f
mnor changes
danieledipompeo Jun 16, 2020
fdaf255
Change on metamodel
danieledipompeo Jun 16, 2020
6425559
Merge branch 'dev-logicalSpecification' into devFOLImpl
danieledipompeo Jun 16, 2020
0446914
update gitignore
danieledipompeo Jun 16, 2020
bf0e3c9
clean maneger code
danieledipompeo Jun 16, 2020
be4b8b5
fix merge with logicalSpecification branch
danieledipompeo Jun 16, 2020
178236a
fix metamodel
danieledipompeo Jun 16, 2020
24854cc
update genmodel
danieledipompeo Jun 16, 2020
6f86fdf
Merge branch 'dev-logicalSpecification' into devFOLImpl
danieledipompeo Jun 16, 2020
9359449
update and fix generated code
danieledipompeo Jun 16, 2020
363fd14
update genmodel file
danieledipompeo Jun 16, 2020
51aeb1e
Remove duplicated code
danieledipompeo Jun 16, 2020
5ca2f2f
optimize imports and fix utils path
danieledipompeo Jun 16, 2020
85aec1e
fix initialization of source folder
danieledipompeo Jun 16, 2020
ef2b950
update maven dependencies
danieledipompeo Jun 17, 2020
73e9a60
add an input aemilia model
danieledipompeo Jun 18, 2020
3ad17e9
update the `worse model`
danieledipompeo Jun 18, 2020
0b8cb1e
add the progress bar
danieledipompeo Jun 18, 2020
cb1f3b0
minor changes to refactoring operator
danieledipompeo Jun 18, 2020
25151b2
some fixes on AemiliaRSolution
danieledipompeo Jun 18, 2020
9fe6028
fix `instance of` if/else branches
danieledipompeo Jun 18, 2020
ec19a51
minor changes
danieledipompeo Jun 18, 2020
656275f
minor changes
danieledipompeo Jun 18, 2020
f6a8db3
update and add `.classpath`
danieledipompeo Jun 18, 2020
6331551
update `confing.ini` and remove no longer used file
danieledipompeo Jun 18, 2020
f424547
update pom dependencies
danieledipompeo Jun 18, 2020
089e277
a minor change to aemilia controller
danieledipompeo Jun 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix initialization of source folder
  • Loading branch information
danieledipompeo committed Jun 16, 2020
commit 85aec1eee1ac7328cd85a9309f75812e29e00887
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import java.util.Map.Entry;
import java.util.Set;
import java.util.logging.FileHandler;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.apache.commons.io.FilenameUtils;
import org.uma.jmetal.algorithm.Algorithm;
Expand Down Expand Up @@ -57,6 +59,7 @@
import it.univaq.disim.sealab.metaheuristic.managers.aemilia.AemiliaMetamodelManager;
import it.univaq.disim.sealab.metaheuristic.utils.Configurator;
import it.univaq.disim.sealab.metaheuristic.utils.EasierLogger;
import it.univaq.disim.sealab.metaheuristic.utils.FileUtils;
import it.univaq.disim.sealab.twoeagles_bridge.TwoEaglesBridge;
import it.univaq.disim.sealab.metaheuristic.utils.AemiliaFileUtils;
import it.univaq.disim.sealab.metaheuristic.utils.ThresholdUtils;
Expand Down Expand Up @@ -106,7 +109,7 @@ public AemiliaController(final Configurator config) {
configurator = config;

configurator.getTmpFolder().toFile().mkdirs();

METAMODEL_PATH = configurator.getMetamodelPath();

// Instantiates evolutionary operators
Expand Down Expand Up @@ -163,6 +166,7 @@ private void generateSourceFiles(final Path source) {
final Path sourceValPath = source.resolve("model.val");
final Path sourceModelPath = source.resolve("model.mmaemilia");
final Path sourceOCLPath = source.resolve("ocl/detectionSingleValuePA.ocl");
final Path sourceEVLPath = source.resolve("aemilia-pas-checker.evl");

if (!Files.exists(sourceModelPath) && Files.exists(sourceAemPath)) {
new TwoEaglesBridge().aemiliaModelGeneration(sourceAemPath, sourceModelPath);
Expand Down Expand Up @@ -201,6 +205,28 @@ private void generateSourceFiles(final Path source) {
}
}

if (!Files.exists(sourceEVLPath)) {
try {
// copy the EVL template into the solution folder
org.apache.commons.io.FileUtils.copyFile(configurator.getEVLTemplate().toFile(),
sourceEVLPath.toFile());
// fix paths in the copied EVL file
FileUtils.fillTemplateKeywords(configurator.getEVLTemplate(), sourceEVLPath,
Stream.of(
new Object[][] { { "basepath", configurator.getEVLTemplate().getParent().toString() } })
.collect(Collectors.toMap(data -> (String) data[0], data -> (String) data[1])));

//copy the threshold file into the source folder
ThresholdUtils.uptodateSingleValueThresholds(source, sourceModelPath, sourceValPath, (AemiliaMetamodelManager) metamodelManager,
this);

EasierLogger.logger_.info("The EVL Template File has been filled and copied");
} catch (IOException e) {
System.err.println("Error in copying the evl template file to the source folder.");
e.printStackTrace();
}
}

// Renaming of generated files by M2T transformation
File folder = source.toFile();
File[] listOfFiles = folder.listFiles();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import "/home/peo/git/sealab/easier/easier-epsilon/src/main/resources/evl/library/action_process.eol";
import "/home/peo/git/sealab/easier/easier-epsilon/src/main/resources/evl/library/action.eol";
import "/home/peo/git/sealab/easier/easier-epsilon/src/main/resources/evl/library/archi_elem_instance.eol";
import "/home/peo/git/sealab/easier/easier-epsilon/src/main/resources/evl/library/architectural_interaction.eol";
import "/home/peo/git/sealab/easier/easier-epsilon/src/main/resources/evl/library/attachment.eol";
import "/home/peo/git/sealab/easier/easier-epsilon/src/main/resources/evl/library/const_init.eol";
import "/home/peo/git/sealab/easier/easier-epsilon/src/main/resources/evl/library/elem_type.eol";
import "/home/peo/git/sealab/easier/easier-epsilon/src/main/resources/evl/library/HELPER.eol";
import "/home/peo/git/sealab/easier/easier-epsilon/src/main/resources/evl/library/metric_functions.eol";
import "thresholds.eol";


/*********************************************************************************************
* *
* Pipe and Filter *
* Antipattern Detection and Validation *
* reviewed *
*********************************************************************************************/


context ArchitecturalInteraction {
critique PaF {
check: not (self.isServiceExpOrInf() and
self.checkOpResDemand(th_maxOpResDemand()) and
self.F_T(th_SthReq()))
message : "PaF on: " + self.name
fix {
title : "Clone"
do {
self.cloneArchiElemInstance();
}
}
fix {
title : "Delete clone"
do {
self.deleteDuplicatedArchiElemInstance();
}
}
fix {
title : " Change a const"
do {
self.changeConstant();
}
}
}
critique EP {
check: not (self.isServiceExpOrInf() and
self.unbalancedOpResDemand(th_maxOpResDemand().first(), th_minOpResDemand().first()) and
self.F_RT(th_SrtReq()))
}
}
Loading