Browse Source

Fixes in PathDisplayer classes.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@5395 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 14 years ago
parent
commit
2a2bdf6220
  1. 31
      prism/src/simulator/PathDisplayer.java
  2. 4
      prism/src/simulator/PathToGraph.java

31
prism/src/simulator/PathDisplayer.java

@ -43,6 +43,9 @@ public abstract class PathDisplayer
/** If we are displaying snapshots, when is the next one due? */
protected double nextTime = 0.0;
/** Should we show changes in state only, or all steps? (not for snapshot mode) */
protected boolean showChangesOnly = true;
/** Indices of variables to show (null = all) */
protected List<Integer> varsToShow = null;
@ -68,14 +71,13 @@ public abstract class PathDisplayer
}
/**
* Set (indices of) vars to show values of (null = all).
* Should we show changes in state only, or all steps? (not for snapshot mode)
*/
public void setVarsToShow(List<Integer> varsToShow)
public boolean getShowChangesOnly()
{
// Take a copy of var index list
this.varsToShow = varsToShow == null ? null : new ArrayList<Integer>(varsToShow);
return showChangesOnly;
}
/**
* Should we display rewards?
*/
@ -83,7 +85,7 @@ public abstract class PathDisplayer
{
return showRewards;
}
// Setters for config
/**
@ -103,6 +105,23 @@ public abstract class PathDisplayer
this.snapshotTimeStep = timeStep;
}
/**
* Set whether we show changes in state only, or all steps (not for snapshot mode).
*/
public void setShowChangesOnly(boolean showChangesOnly)
{
this.showChangesOnly = showChangesOnly;
}
/**
* Set (indices of) vars to show values of (null = all).
*/
public void setVarsToShow(List<Integer> varsToShow)
{
// Take a copy of var index list
this.varsToShow = varsToShow == null ? null : new ArrayList<Integer>(varsToShow);
}
/**
* Set whether we we display rewards.
*/

4
prism/src/simulator/PathToGraph.java

@ -92,13 +92,13 @@ public class PathToGraph extends PathDisplayer
@Override
public void displayStep(double timeSpent, double timeCumul, Object action, double[] transitionRewards, State newState, double[] newStateRewards)
{
displayState(timeCumul, newState, false);
displayState(timeCumul, newState, !showChangesOnly);
}
@Override
public void displaySnapshot(double timeCumul, State newState, double[] newStateRewards)
{
displayState(timeCumul, newState, false);
displayState(timeCumul, newState, true);
}
private void displayState(double time, State state, boolean force)

Loading…
Cancel
Save