Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mbe-tools
TTool
Commits
e014db24
Commit
e014db24
authored
8 years ago
by
Ludovic Apvrille
Browse files
Options
Downloads
Patches
Plain Diff
adding deadlock and reacha info
parent
0e90ecbf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/avatartranslator/modelchecker/AvatarModelChecker.java
+19
-0
19 additions, 0 deletions
src/avatartranslator/modelchecker/AvatarModelChecker.java
src/ui/window/JDialogAvatarModelChecker.java
+27
-1
27 additions, 1 deletion
src/ui/window/JDialogAvatarModelChecker.java
with
46 additions
and
1 deletion
src/avatartranslator/modelchecker/AvatarModelChecker.java
+
19
−
0
View file @
e014db24
...
...
@@ -87,6 +87,9 @@ public class AvatarModelChecker implements Runnable, myutil.Graph {
private
ArrayList
<
SpecificationReachability
>
reachabilities
;
private
int
nbOfRemainingReachabilities
;
// Dealocks
private
int
nbOfDeadlocks
;
public
AvatarModelChecker
(
AvatarSpecification
_spec
)
{
spec
=
_spec
;
ignoreEmptyTransitions
=
true
;
...
...
@@ -177,6 +180,17 @@ public class AvatarModelChecker implements Runnable, myutil.Graph {
return
nbOfRemainingReachabilities
;
}
public
int
getNbOfReachabilities
()
{
if
(
reachabilities
==
null
)
{
return
-
1
;
}
return
reachabilities
.
size
()
-
nbOfRemainingReachabilities
;
}
public
int
getNbOfDeadlocks
()
{
return
nbOfDeadlocks
;
}
public
void
setComputeRG
(
boolean
_rg
)
{
computeRG
=
_rg
;
}
...
...
@@ -185,6 +199,7 @@ public class AvatarModelChecker implements Runnable, myutil.Graph {
public
void
startModelChecking
()
{
stoppedBeforeEnd
=
false
;
stateID
=
0
;
nbOfDeadlocks
=
0
;
// Remove timers, composite states, randoms
TraceManager
.
addDev
(
"Reworking Avatar specification"
);
...
...
@@ -454,6 +469,10 @@ public class AvatarModelChecker implements Runnable, myutil.Graph {
}
}
if
(
transitions
.
size
()
==
0
)
{
nbOfDeadlocks
++;
}
//TraceManager.addDev("Possible transitions 4:" + transitions.size());
// For each realizable transition
// Make it, reset clock of the involved blocks to 0, increase clockmin/clockhmax of each block
...
...
This diff is collapsed.
Click to expand it.
src/ui/window/JDialogAvatarModelChecker.java
+
27
−
1
View file @
e014db24
...
...
@@ -116,7 +116,7 @@ public class JDialogAvatarModelChecker extends javax.swing.JDialog implements Ac
protected
JScrollPane
jsp
;
// Information
protected
JLabel
nbOfStates
,
nbOfLinks
,
nbOfPendingStates
,
elapsedTime
,
nbOfStatesPerSecond
,
info
;
protected
JLabel
nbOfStates
,
nbOfLinks
,
nbOfPendingStates
,
elapsedTime
,
nbOfStatesPerSecond
,
nbOfDeadlocks
,
nbOfReachabilities
,
info
;
private
Thread
t
;
...
...
@@ -270,6 +270,19 @@ public class JDialogAvatarModelChecker extends javax.swing.JDialog implements Ac
nbOfLinks
=
new
JLabel
(
"-"
);
jpinfo
.
add
(
nbOfLinks
,
c02
);
c02
.
gridwidth
=
1
;
jpinfo
.
add
(
new
JLabel
(
"Reachability found:"
),
c02
);
//c02.gridwidth = GridBagConstraints.REMAINDER; //end row
nbOfReachabilities
=
new
JLabel
(
"-"
);
jpinfo
.
add
(
nbOfReachabilities
,
c02
);
c02
.
gridwidth
=
1
;
jpinfo
.
add
(
new
JLabel
(
"Nb of deadlock states:"
),
c02
);
c02
.
gridwidth
=
GridBagConstraints
.
REMAINDER
;
//end row
nbOfDeadlocks
=
new
JLabel
(
"-"
);
jpinfo
.
add
(
nbOfDeadlocks
,
c02
);
c02
.
gridwidth
=
1
;
jpinfo
.
add
(
new
JLabel
(
"Nb of pending states:"
),
c02
);
//c02.gridwidth = GridBagConstraints.REMAINDER; //end row
...
...
@@ -516,6 +529,17 @@ public class JDialogAvatarModelChecker extends javax.swing.JDialog implements Ac
int
nbOfStatess
=
amc
.
getNbOfStates
();
nbOfStates
.
setText
(
""
+
nbOfStatess
);
nbOfLinks
.
setText
(
""
+
amc
.
getNbOfLinks
());
// Reachability and deadlocks
int
nb
=
amc
.
getNbOfReachabilities
();
if
(
nb
==
-
1
)
{
//nbOfReachabilities.setText("-");
}
else
{
nbOfReachabilities
.
setText
(
""
+
nb
);
}
nbOfDeadlocks
.
setText
(
""
+
amc
.
getNbOfDeadlocks
());
nbOfPendingStates
.
setText
(
""
+
amc
.
getNbOfPendingStates
());
Date
d
;
previousDate
=
new
Date
();
...
...
@@ -541,6 +565,8 @@ public class JDialogAvatarModelChecker extends javax.swing.JDialog implements Ac
nbOfStatesPerSecond
.
setText
(
""
+
1000
*
diff
/
duration
);
updateInfo
();
//}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment