Browse Source

Add hasTransitionRewards() method to explicit Reward interface.

Currently, the main use is to determinie whether a MDPRewards has
any transition rewards.


git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@10579 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Joachim Klein 10 years ago
parent
commit
eeddcf9039
  1. 7
      prism/src/explicit/rewards/MCRewardsFromMDPRewards.java
  2. 3
      prism/src/explicit/rewards/MDPRewards.java
  3. 6
      prism/src/explicit/rewards/MDPRewardsSimple.java
  4. 3
      prism/src/explicit/rewards/Rewards.java
  5. 7
      prism/src/explicit/rewards/StateRewards.java

7
prism/src/explicit/rewards/MCRewardsFromMDPRewards.java

@ -64,4 +64,11 @@ public class MCRewardsFromMDPRewards implements MCRewards
{
throw new UnsupportedOperationException();
}
@Override
public boolean hasTransitionRewards()
{
// only state rewards
return false;
}
}

3
prism/src/explicit/rewards/MDPRewards.java

@ -46,4 +46,7 @@ public interface MDPRewards extends Rewards
@Override
public MDPRewards liftFromModel(Product<? extends Model> product);
/** Returns true if this reward structure has transition rewards */
public boolean hasTransitionRewards();
}

6
prism/src/explicit/rewards/MDPRewardsSimple.java

@ -216,4 +216,10 @@ public class MDPRewardsSimple implements MDPRewards
{
return "st: " + this.stateRewards + "; tr:" + this.transRewards;
}
@Override
public boolean hasTransitionRewards()
{
return transRewards != null;
}
}

3
prism/src/explicit/rewards/Rewards.java

@ -40,4 +40,7 @@ public interface Rewards
* model that is a product of the one that this reward structure is defined over.
*/
public Rewards liftFromModel(Product<? extends Model> product);
/** Returns true if this reward structure has transition rewards */
public boolean hasTransitionRewards();
}

7
prism/src/explicit/rewards/StateRewards.java

@ -64,4 +64,11 @@ public abstract class StateRewards implements MCRewards, MDPRewards, STPGRewards
* Perform a deep copy.
*/
public abstract StateRewards deepCopy();
@Override
public boolean hasTransitionRewards()
{
// only state rewards
return false;
}
}
Loading…
Cancel
Save