Browse Source

prism.StateValues: add switchModel() method

Will be used to efficiently switch the result vectors from embedded DTMC to the original CTMC.



git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@12056 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Joachim Klein 9 years ago
parent
commit
42949bee96
  1. 14
      prism/src/prism/StateValues.java
  2. 6
      prism/src/prism/StateValuesDV.java
  3. 6
      prism/src/prism/StateValuesMTBDD.java
  4. 7
      prism/src/prism/StateValuesVoid.java

14
prism/src/prism/StateValues.java

@ -43,6 +43,20 @@ public interface StateValues extends StateVector
/** Converts to StateValuesMTBDD, destroys (clear) this vector */ /** Converts to StateValuesMTBDD, destroys (clear) this vector */
StateValuesMTBDD convertToStateValuesMTBDD(); StateValuesMTBDD convertToStateValuesMTBDD();
/**
* Switch the underlying model of this StateValues object.
* The new model has to be compatible with the old one,
* i.e., it has to have the same row variables and reachable states.
* <br>
* An example would be to switch between a CTMC and the embedded DTMC,
* i.e., where both models by construction have the same structure and state space.
* <br>
* Note that there are currently <b>no sanity checks</b>, so be careful when
* using this method.
* @param newModel the new model
*/
void switchModel(Model newModel);
/** /**
* Set the elements of this vector by reading them in from a file. * Set the elements of this vector by reading them in from a file.
*/ */

6
prism/src/prism/StateValuesDV.java

@ -123,6 +123,12 @@ public class StateValuesDV implements StateValues
varValues = new int[varList.getNumVars()]; varValues = new int[varList.getNumVars()];
} }
@Override
public void switchModel(Model newModel)
{
setModel(newModel);
}
// CONVERSION METHODS // CONVERSION METHODS
@Override @Override

6
prism/src/prism/StateValuesMTBDD.java

@ -105,6 +105,12 @@ public class StateValuesMTBDD implements StateValues
varValues = new int[varList.getNumVars()]; varValues = new int[varList.getNumVars()];
} }
@Override
public void switchModel(Model newModel)
{
setModel(newModel);
}
// CONVERSION METHODS // CONVERSION METHODS
@Override @Override

7
prism/src/prism/StateValuesVoid.java

@ -29,7 +29,6 @@ package prism;
import java.io.File; import java.io.File;
import parser.ast.RelOp; import parser.ast.RelOp;
import jdd.JDDNode; import jdd.JDDNode;
import jdd.JDDVars; import jdd.JDDVars;
@ -47,6 +46,12 @@ public class StateValuesVoid implements StateValues
this.value = value; this.value = value;
} }
@Override
public void switchModel(Model newModel)
{
// nothing to do...
}
@Override @Override
public int getSize() public int getSize()
{ {

Loading…
Cancel
Save