Browse Source

Enforce no end components when we want to compute a scheduler from a minmax equation system

tempestpy_adaptions
TimQu 7 years ago
parent
commit
1396de3c5f
  1. 5
      src/storm/solver/IterativeMinMaxLinearEquationSolver.cpp
  2. 15
      src/storm/solver/LpMinMaxLinearEquationSolver.cpp
  3. 2
      src/storm/solver/LpMinMaxLinearEquationSolver.h

5
src/storm/solver/IterativeMinMaxLinearEquationSolver.cpp

@ -255,6 +255,11 @@ namespace storm {
// Start by copying the requirements of the linear equation solver.
MinMaxLinearEquationSolverRequirements requirements(this->linearEquationSolverFactory->getRequirements());
// In case we perform value iteration and need to retrieve a scheduler, end components are forbidden
if (this->getSettings().getSolutionMethod() == IterativeMinMaxLinearEquationSolverSettings<ValueType>::SolutionMethod::ValueIteration && isTrackSchedulerSet()) {
requirements.requireNoEndComponents();
}
// Guide requirements by whether or not we force soundness.
if (this->getSettings().getForceSoundness()) {
// Only add requirements for value iteration here as the policy iteration requirements are indifferent

15
src/storm/solver/LpMinMaxLinearEquationSolver.cpp

@ -108,6 +108,21 @@ namespace storm {
StandardMinMaxLinearEquationSolver<ValueType>::clearCache();
}
template<typename ValueType>
MinMaxLinearEquationSolverRequirements LpMinMaxLinearEquationSolver<ValueType>::getRequirements(EquationSystemType const& equationSystemType, boost::optional<storm::solver::OptimizationDirection> const& direction) const {
MinMaxLinearEquationSolverRequirements requirements;
// In case we need to retrieve a scheduler, end components are forbidden
if (isTrackSchedulerSet()) {
requirements.requireNoEndComponents();
}
return requirements;
}
template<typename ValueType>
LpMinMaxLinearEquationSolverFactory<ValueType>::LpMinMaxLinearEquationSolverFactory(bool trackScheduler) : StandardMinMaxLinearEquationSolverFactory<ValueType>(MinMaxMethodSelection::LinearProgramming, trackScheduler), lpSolverFactory(std::make_unique<storm::utility::solver::LpSolverFactory<ValueType>>()) {
// Intentionally left empty

2
src/storm/solver/LpMinMaxLinearEquationSolver.h

@ -18,6 +18,8 @@ namespace storm {
virtual void clearCache() const override;
virtual MinMaxLinearEquationSolverRequirements getRequirements(EquationSystemType const& equationSystemType, boost::optional<storm::solver::OptimizationDirection> const& direction = boost::none) const override;
private:
std::unique_ptr<storm::utility::solver::LpSolverFactory<ValueType>> lpSolverFactory;
};

Loading…
Cancel
Save