|
@ -56,6 +56,9 @@ namespace storm { |
|
|
|
|
|
|
|
|
template <typename ValueType> |
|
|
template <typename ValueType> |
|
|
void ConstraintCollector<ValueType>::process(storm::models::sparse::Model<ValueType> const& model) { |
|
|
void ConstraintCollector<ValueType>::process(storm::models::sparse::Model<ValueType> const& model) { |
|
|
|
|
|
|
|
|
|
|
|
if (model.getType() != storm::models::ModelType::Ctmc) { |
|
|
|
|
|
|
|
|
for(uint_fast64_t action = 0; action < model.getTransitionMatrix().getRowCount(); ++action) { |
|
|
for(uint_fast64_t action = 0; action < model.getTransitionMatrix().getRowCount(); ++action) { |
|
|
ValueType sum = storm::utility::zero<ValueType>(); |
|
|
ValueType sum = storm::utility::zero<ValueType>(); |
|
|
|
|
|
|
|
@ -98,6 +101,26 @@ namespace storm { |
|
|
wellformedConstraintSet.emplace((sum.nominator() - sum.denominator()).polynomialWithCoefficient(), storm::CompareRelation::EQ); |
|
|
wellformedConstraintSet.emplace((sum.nominator() - sum.denominator()).polynomialWithCoefficient(), storm::CompareRelation::EQ); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
for (auto const& transition : model.getTransitionMatrix()) { |
|
|
|
|
|
if(!transition.getValue().isConstant()) { |
|
|
|
|
|
if (transition.getValue().denominator().isConstant()) { |
|
|
|
|
|
assert(transition.getValue().denominator().constantPart() != 0); |
|
|
|
|
|
if (transition.getValue().denominator().constantPart() > 0) { |
|
|
|
|
|
wellformedConstraintSet.emplace(transition.getValue().nominator().polynomialWithCoefficient(), storm::CompareRelation::GEQ); |
|
|
|
|
|
} else if (transition.getValue().denominator().constantPart() < 0) { |
|
|
|
|
|
wellformedConstraintSet.emplace(transition.getValue().nominator().polynomialWithCoefficient(), storm::CompareRelation::LEQ); |
|
|
|
|
|
} else { |
|
|
|
|
|
assert(false); // Should fail before.
|
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
wellformedConstraintSet.emplace(transition.getValue().denominator().polynomialWithCoefficient(), storm::CompareRelation::NEQ); |
|
|
|
|
|
wellformedConstraintSet.emplace(carl::FormulaType::ITE, typename ConstraintType<ValueType>::val(transition.getValue().denominator().polynomialWithCoefficient(), storm::CompareRelation::GREATER), typename ConstraintType<ValueType>::val(transition.getValue().nominator().polynomialWithCoefficient(), storm::CompareRelation::GEQ), typename ConstraintType<ValueType>::val(transition.getValue().nominator().polynomialWithCoefficient(), storm::CompareRelation::LEQ)); |
|
|
|
|
|
} |
|
|
|
|
|
graphPreservingConstraintSet.emplace(transition.getValue().nominator().polynomialWithCoefficient(), storm::CompareRelation::NEQ); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (model.getType() == storm::models::ModelType::Ctmc) { |
|
|
if (model.getType() == storm::models::ModelType::Ctmc) { |
|
|
auto const& exitRateVector = static_cast<storm::models::sparse::Ctmc<ValueType> const&>(model).getExitRateVector(); |
|
|
auto const& exitRateVector = static_cast<storm::models::sparse::Ctmc<ValueType> const&>(model).getExitRateVector(); |
|
|