Skip to content

Commit

Permalink
Change to transient/inner state exploration finished: tests run
Browse files Browse the repository at this point in the history
correctly
  • Loading branch information
rensink committed Sep 13, 2024
1 parent c79256e commit 68daacf
Show file tree
Hide file tree
Showing 6 changed files with 425 additions and 932 deletions.
10 changes: 5 additions & 5 deletions junit/control/any.gps/system.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Mon Dec 18 16:17:21 CET 2023
#Thu Sep 12 20:43:09 CEST 2024
startGraph=start
useStoredNodeIDs=true
controlProgram=sub1.any
grooveVersion=6.6.5-SNAPSHOT
grammarVersion=3.10
location=C\:\\Eclipse\\workspace-2022-09\\groove\\junit\\control\\any.gps
controlProgram=any
grooveVersion=6.9.0
grammarVersion=3.11
location=C\:\\Groove\\code\\junit\\control\\any.gps
24 changes: 5 additions & 19 deletions src/main/java/nl/utwente/groove/lts/AbstractGraphState.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,12 @@ public boolean setError() {
}

@Override
public boolean setFull() {
public boolean setFull(int absence) {
int oldStatus = this.status;
boolean result = setStatus(Flag.FULL, true);
if (result) {
if (getAbsence() > 0) {
setAbsence(absence);
if (absence > 0) {
setFrame(getActualFrame().onRemove());
}
checkFullConstraints();
Expand All @@ -280,24 +281,9 @@ public boolean setFlag(Flag flag, boolean value) {
return setStatus(flag, value);
}

@Override
public boolean setAbsence(int absence) {
private void setAbsence(int absence) {
assert absence >= 0 : "Negative absence %s not allowed".formatted(absence);
assert !isFull() : "Absence %s cannot be set when state is full".formatted(absence);
int oldStatus = this.status;
int oldAbsence = Status.getAbsence(oldStatus);
assert absence <= oldAbsence : "New absence %s exceeds old value %s"
.formatted(absence, oldAbsence);
boolean result = absence < oldAbsence;
if (result) {
int newStatus = Status.setAbsence(oldStatus, absence);
if (absence == 0) {
newStatus = Flag.PRESENT.set(newStatus);
}
this.status = newStatus;
fireStatus(oldStatus);
}
return result;
this.status = Status.setAbsence(this.status, absence);
}

/**
Expand Down
Loading

0 comments on commit 68daacf

Please sign in to comment.