Skip to content

Commit

Permalink
Fixed transitive reduction parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
delas committed Mar 11, 2022
1 parent b4e9555 commit edfca01
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions src/main/java/beamline/miners/dcr/DFGBasedMiner.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ public class DFGBasedMiner extends StreamMiningAlgorithm<XTrace, DcrModel> {
private StreamMiner streamMiner;
private UnionRelationSet unionRelationSet;
private Integer relationsThreshold = 10;
private String[] transReductionList = new String[] { "Condition", "Response" };
private RELATION[] transReductionList = new RELATION[] { RELATION.CONDITION, RELATION.RESPONSE };

private String[] dcrPatternList = new String[] { "Condition", "Response", "Exclude", "Include" };
private RELATION[] dcrConstraintList = new RELATION[] { RELATION.CONDITION, RELATION.RESPONSE, RELATION.EXCLUDE,
RELATION.INCLUDE };
private RELATION[] dcrConstraintList = new RELATION[] { RELATION.CONDITION, RELATION.RESPONSE, RELATION.EXCLUDE, RELATION.INCLUDE };
private Set<String> postorderTraversal;

public DFGBasedMiner() {
Expand Down Expand Up @@ -74,7 +73,7 @@ public void setStreamMinerType(StreamMiner type) {
this.streamMiner = type;
}

public void setTransitiveReductionList(String[] transReductionList) {
public void setTransitiveReductionList(RELATION... transReductionList) {
this.transReductionList = transReductionList;
}

Expand All @@ -86,8 +85,13 @@ public void setDcrConstraintsForVisualization(RELATION... dcrConstraintList) {
this.dcrConstraintList = dcrConstraintList;
}

public void configureSlidingWindowStrategy(String[] dcrPatternList, int maxTraceSize, int maxTraces,
String[] transitiveReductionList, int relationsThreshold, RELATION[] dcrConstraints)
public void configureSlidingWindowStrategy(
String[] dcrPatternList,
int maxTraceSize,
int maxTraces,
RELATION[] transitiveReductionList,
int relationsThreshold,
RELATION[] dcrConstraints)
throws PatternUnknownException {
setDcrPatternsForMining(dcrPatternList);
setStreamMinerType(new SlidingWindowStreamMiner(maxTraceSize, maxTraces));
Expand All @@ -96,8 +100,11 @@ public void configureSlidingWindowStrategy(String[] dcrPatternList, int maxTrace
setDcrConstraintsForVisualization(dcrConstraints);
}

public void configureUnlimitedMemoryStrategy(String[] dcrPatternList, String[] transitiveReductionList,
int relationsThreshold, RELATION[] dcrConstraints) throws PatternUnknownException {
public void configureUnlimitedMemoryStrategy(
String[] dcrPatternList,
RELATION[] transitiveReductionList,
int relationsThreshold,
RELATION[] dcrConstraints) throws PatternUnknownException {
setDcrPatternsForMining(dcrPatternList);
setStreamMinerType(new UnlimitedStreamMiner());
setTransitiveReductionList(transitiveReductionList);
Expand Down Expand Up @@ -126,9 +133,7 @@ public DcrModel convert(ExtendedDFG dfg) throws IllegalAccessException, Instanti
}

TransitiveReduction transitiveReduction = new TransitiveReduction();

for (String transReduce : transReductionList) {
RELATION enumPattern = RELATION.valueOf(transReduce.toUpperCase());
for (RELATION enumPattern : transReductionList) {
transitiveReduction.reduce(unionRelationSet, enumPattern);
}

Expand Down

0 comments on commit edfca01

Please sign in to comment.