Browse Source

Fixed a bug where if you use the simulator with a model with a subset of variables of the models you previously used the simulator with, then it doesn't have an obscure crash. (For instance going from phil4 to phil3).

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@165 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Mark Kattenbelt 20 years ago
parent
commit
79cdbd3252
  1. 25
      prism/src/userinterface/simulator/GUISimulator.java

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

@ -341,21 +341,28 @@ public class GUISimulator extends GUIPlugin implements MouseListener, ListSelect
boolean match = true; boolean match = true;
int i, n; int i, n;
n = defaultInitialState.getNumValues(); n = defaultInitialState.getNumValues();
for(i = 0; i < n; i++)
if (lastInitialState.getNumValues() != defaultInitialState.getNumValues())
{ {
if(!lastInitialState.contains(defaultInitialState.getName(i)))
{
match = false;
break;
}
else
match = false;
}
else
{
for(i = 0; i < n; i++)
{ {
int index = lastInitialState.getIndexOf(defaultInitialState.getName(i));
if(lastInitialState.getType(index) != defaultInitialState.getType(i))
if(!lastInitialState.contains(defaultInitialState.getName(i)))
{ {
match = false; match = false;
break; break;
} }
else
{
int index = lastInitialState.getIndexOf(defaultInitialState.getName(i));
if(lastInitialState.getType(index) != defaultInitialState.getType(i))
{
match = false;
break;
}
}
} }
} }
if(!match) // if there's a problem, just use the default if(!match) // if there's a problem, just use the default

Loading…
Cancel
Save