Browse Source

Added dialog when a deterministic loop causes exploration to stop prior to the users expectation.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@216 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Mark Kattenbelt 19 years ago
parent
commit
8d1d7628e8
  1. 30
      prism/src/userinterface/simulator/GUISimulator.java

30
prism/src/userinterface/simulator/GUISimulator.java

@ -457,17 +457,19 @@ public class GUISimulator extends GUIPlugin implements MouseListener, ListSelect
public void a_autoStep(int noSteps) public void a_autoStep(int noSteps)
{ {
try try
{
{
int oldPathSize = engine.getPathSize();
if (displayPathLoops && pathTableModel.isPathLooping()) if (displayPathLoops && pathTableModel.isPathLooping())
{ {
if (questionYesNo("A loop in the path has been detected. Do you wish to disable loop detection and extend the path?") == 0)
if (questionYesNo("The current path contains a deterministic loop. Do you wish to disable the detection of deterministic loops and extend the path anyway?") == 0)
{ {
displayPathLoops = false; displayPathLoops = false;
pathTable.repaint(); pathTable.repaint();
} }
else return; else return;
} }
setComputing(true); setComputing(true);
if(isOldUpdate()) if(isOldUpdate())
@ -487,6 +489,13 @@ public class GUISimulator extends GUIPlugin implements MouseListener, ListSelect
stateLabelList.repaint(); stateLabelList.repaint();
pathFormulaeList.repaint(); pathFormulaeList.repaint();
setComputing(false); setComputing(false);
int newPathSize = engine.getPathSize();
if (displayPathLoops && pathTableModel.isPathLooping() && (newPathSize - oldPathSize) < noSteps)
{
message("Exploration has stopped early because a deterministic loop has been detected.");
}
} }
catch(SimulatorException e) catch(SimulatorException e)
{ {
@ -498,16 +507,18 @@ public class GUISimulator extends GUIPlugin implements MouseListener, ListSelect
public void a_autoStep(double time) public void a_autoStep(double time)
{ {
try try
{
{
double oldPathTime = engine.getTotalPathTime();
if (displayPathLoops && pathTableModel.isPathLooping()) if (displayPathLoops && pathTableModel.isPathLooping())
{ {
if (questionYesNo("A loop in the path has been detected. Do you wish to disable loop detection and extend the path?") == 0)
if (questionYesNo("The current path contains a deterministic loop. Do you wish to disable the detection of deterministic loops and extend the path anyway?") == 0)
{ {
displayPathLoops = false; displayPathLoops = false;
pathTable.repaint(); pathTable.repaint();
} }
else return; else return;
}
}
setComputing(true); setComputing(true);
@ -528,6 +539,13 @@ public class GUISimulator extends GUIPlugin implements MouseListener, ListSelect
stateLabelList.repaint(); stateLabelList.repaint();
pathFormulaeList.repaint(); pathFormulaeList.repaint();
setComputing(false); setComputing(false);
double newPathTime = engine.getTotalPathTime();
if (displayPathLoops && pathTableModel.isPathLooping() && (newPathTime - oldPathTime) < time)
{
message("Exploration has stopped early because a deterministic loop has been detected.");
}
} }
catch(SimulatorException e) catch(SimulatorException e)
{ {

Loading…
Cancel
Save