Skip to content

Commit

Permalink
support not having a por
Browse files Browse the repository at this point in the history
  • Loading branch information
yanntm committed May 3, 2024
1 parent 3a20832 commit 2f5a149
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public RandomExplorer(ISparsePetriNet sr) {
private int[] computeEnabled(SparseIntArray state) {
return wu.computeEnabled(state);
}

public ISparsePetriNet getNet() {
return wu.getNet();
}

public int[] runGuidedReachabilityDetection(long nbSteps, SparseIntArray parikhori, SparseIntArray porori,
List<Expression> exprs, List<Integer> repr, int timeout, boolean max) {
Expand All @@ -37,7 +41,8 @@ public int[] runGuidedReachabilityDetection(long nbSteps, SparseIntArray parikho
Map<Integer, List<Integer>> repSet = InvariantCalculator.computeMap(repr);
SparseIntArray parikh = InvariantCalculator.transformParikh(parikhori, repSet);
parikhori = parikh.clone();
int[] por = InvariantCalculator.transformParikh(porori, repSet).toArray(wu.getNet().getTransitionCount());
int[] por = null;
if (porori != null) por = InvariantCalculator.transformParikh(porori, repSet).toArray(wu.getNet().getTransitionCount());

long time = System.currentTimeMillis();
SparseIntArray state = wu.getInitial();
Expand All @@ -55,6 +60,9 @@ public int[] runGuidedReachabilityDetection(long nbSteps, SparseIntArray parikho

// mode : 0 = RAND, 1 = MAX, 2 = MIN
int mode = 0;
if (porori == null) {
mode = 1;
}

if (list[0] == 0) {
if (DEBUG >= 1) {
Expand Down Expand Up @@ -93,6 +101,9 @@ public int[] runGuidedReachabilityDetection(long nbSteps, SparseIntArray parikho
list = initlist.clone();
parikh = parikhori.clone();
mode = (mode + 1) % 4;
if (porori == null && mode == 0) {
mode++;
}
continue;
}

Expand Down

0 comments on commit 2f5a149

Please sign in to comment.