|  | @ -264,7 +264,7 @@ namespace storm { | 
		
	
		
			
				|  |  |         } |  |  |         } | 
		
	
		
			
				|  |  |          |  |  |          | 
		
	
		
			
				|  |  |         boost::any FormulaToJaniJson::visit(storm::logic::LongRunAverageOperatorFormula const& f, boost::any const& data) const { |  |  |         boost::any FormulaToJaniJson::visit(storm::logic::LongRunAverageOperatorFormula const& f, boost::any const& data) const { | 
		
	
		
			
				|  |  |              modernjson::json opDecl; |  |  |  | 
		
	
		
			
				|  |  |  |  |  |             modernjson::json opDecl; | 
		
	
		
			
				|  |  |             if(f.hasBound()) { |  |  |             if(f.hasBound()) { | 
		
	
		
			
				|  |  |                 auto bound = f.getBound(); |  |  |                 auto bound = f.getBound(); | 
		
	
		
			
				|  |  |                 opDecl["op"] = comparisonTypeToJani(bound.comparisonType); |  |  |                 opDecl["op"] = comparisonTypeToJani(bound.comparisonType); | 
		
	
	
		
			
				|  | @ -288,7 +288,6 @@ namespace storm { | 
		
	
		
			
				|  |  |                 } |  |  |                 } | 
		
	
		
			
				|  |  |             } |  |  |             } | 
		
	
		
			
				|  |  |             return opDecl; |  |  |             return opDecl; | 
		
	
		
			
				|  |  | 
 |  |  |  | 
		
	
		
			
				|  |  |         } |  |  |         } | 
		
	
		
			
				|  |  |          |  |  |          | 
		
	
		
			
				|  |  |         boost::any FormulaToJaniJson::visit(storm::logic::LongRunAverageRewardFormula const&, boost::any const&) const { |  |  |         boost::any FormulaToJaniJson::visit(storm::logic::LongRunAverageRewardFormula const&, boost::any const&) const { | 
		
	
	
		
			
				|  | @ -369,52 +368,73 @@ namespace storm { | 
		
	
		
			
				|  |  |         boost::any FormulaToJaniJson::visit(storm::logic::RewardOperatorFormula const& f, boost::any const& data) const { |  |  |         boost::any FormulaToJaniJson::visit(storm::logic::RewardOperatorFormula const& f, boost::any const& data) const { | 
		
	
		
			
				|  |  |             modernjson::json opDecl; |  |  |             modernjson::json opDecl; | 
		
	
		
			
				|  |  |             std::vector<std::string> accvec; |  |  |             std::vector<std::string> accvec; | 
		
	
		
			
				|  |  |             if(model.isDiscreteTimeModel()) { |  |  |  | 
		
	
		
			
				|  |  |  |  |  |             std::string instantName; | 
		
	
		
			
				|  |  |  |  |  |             if (model.isDiscreteTimeModel()) { | 
		
	
		
			
				|  |  |                 accvec.push_back("steps"); |  |  |                 accvec.push_back("steps"); | 
		
	
		
			
				|  |  |  |  |  |                 instantName = "step-instant"; | 
		
	
		
			
				|  |  |             } else { |  |  |             } else { | 
		
	
		
			
				|  |  |                 accvec.push_back("time"); |  |  |                 accvec.push_back("time"); | 
		
	
		
			
				|  |  |  |  |  |                 instantName = "time-instant"; | 
		
	
		
			
				|  |  |  |  |  |             } | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |  |             std::string rewardModelName; | 
		
	
		
			
				|  |  |  |  |  |             if (f.hasRewardModelName()) { | 
		
	
		
			
				|  |  |  |  |  |                 rewardModelName = f.getRewardModelName(); | 
		
	
		
			
				|  |  |  |  |  |             } else { | 
		
	
		
			
				|  |  |  |  |  |                 if (model.getGlobalVariables().getNumberOfRealTransientVariables() == 1) { | 
		
	
		
			
				|  |  |  |  |  |                     for (auto const& variable : model.getGlobalVariables().getRealVariables()) { | 
		
	
		
			
				|  |  |  |  |  |                         if (variable.isTransient()) { | 
		
	
		
			
				|  |  |  |  |  |                             rewardModelName = variable.getName(); | 
		
	
		
			
				|  |  |  |  |  |                             STORM_LOG_WARN("Reward model name was not given, assuming the only global real transient variable '" << rewardModelName << "' to measure the reward."); | 
		
	
		
			
				|  |  |  |  |  |                             break; | 
		
	
		
			
				|  |  |  |  |  |                         } | 
		
	
		
			
				|  |  |  |  |  |                     } | 
		
	
		
			
				|  |  |  |  |  |                 } | 
		
	
		
			
				|  |  |             } |  |  |             } | 
		
	
		
			
				|  |  |  |  |  |             STORM_LOG_THROW(!rewardModelName.empty(), storm::exceptions::NotSupportedException, "Reward name has to be specified for Jani-conversion"); | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  |             if(f.hasBound()) { |  |  |             if(f.hasBound()) { | 
		
	
		
			
				|  |  |                 auto bound = f.getBound(); |  |  |                 auto bound = f.getBound(); | 
		
	
		
			
				|  |  |                 opDecl["op"] = comparisonTypeToJani(bound.comparisonType); |  |  |                 opDecl["op"] = comparisonTypeToJani(bound.comparisonType); | 
		
	
		
			
				|  |  |                 if(f.hasOptimalityType()) { |  |  |                 if(f.hasOptimalityType()) { | 
		
	
		
			
				|  |  |                     opDecl["left"]["op"] = f.getOptimalityType() == storm::solver::OptimizationDirection::Minimize ? "Emin" : "Emax"; |  |  |                     opDecl["left"]["op"] = f.getOptimalityType() == storm::solver::OptimizationDirection::Minimize ? "Emin" : "Emax"; | 
		
	
		
			
				|  |  |                     opDecl["left"]["reach"] = boost::any_cast<modernjson::json>(f.getSubformula().asEventuallyFormula().getSubformula().accept(*this, data)); |  |  |  | 
		
	
		
			
				|  |  |                 } else { |  |  |                 } else { | 
		
	
		
			
				|  |  |                     opDecl["left"]["op"] = (bound.comparisonType == storm::logic::ComparisonType::Less || bound.comparisonType == storm::logic::ComparisonType::LessEqual) ? "Emax" : "Emin"; |  |  |                     opDecl["left"]["op"] = (bound.comparisonType == storm::logic::ComparisonType::Less || bound.comparisonType == storm::logic::ComparisonType::LessEqual) ? "Emax" : "Emin"; | 
		
	
		
			
				|  |  |  |  |  |                 } | 
		
	
		
			
				|  |  |  |  |  |                 if (f.getSubformula().isEventuallyFormula()) { | 
		
	
		
			
				|  |  |                     opDecl["left"]["reach"] = boost::any_cast<modernjson::json>(f.getSubformula().asEventuallyFormula().getSubformula().accept(*this, data)); |  |  |                     opDecl["left"]["reach"] = boost::any_cast<modernjson::json>(f.getSubformula().asEventuallyFormula().getSubformula().accept(*this, data)); | 
		
	
		
			
				|  |  |  |  |  |                 } else if (f.getSubformula().isCumulativeRewardFormula()) { | 
		
	
		
			
				|  |  |  |  |  |                     opDecl["left"][instantName] = buildExpression(f.getSubformula().asCumulativeRewardFormula().getBound(), model.getConstants(), model.getGlobalVariables()); | 
		
	
		
			
				|  |  |  |  |  |                 } else if (f.getSubformula().isInstantaneousRewardFormula()) { | 
		
	
		
			
				|  |  |  |  |  |                     opDecl["left"][instantName] = buildExpression(f.getSubformula().asInstantaneousRewardFormula().getBound(), model.getConstants(), model.getGlobalVariables()); | 
		
	
		
			
				|  |  |                 } |  |  |                 } | 
		
	
		
			
				|  |  |                 STORM_LOG_THROW(f.hasRewardModelName(), storm::exceptions::NotSupportedException, "Reward name has to be specified for Jani-conversion"); |  |  |                 STORM_LOG_THROW(f.hasRewardModelName(), storm::exceptions::NotSupportedException, "Reward name has to be specified for Jani-conversion"); | 
		
	
		
			
				|  |  |                 opDecl["left"]["exp"] = f.getRewardModelName(); |  |  |  | 
		
	
		
			
				|  |  |                 opDecl["left"]["accumulate"] = modernjson::json(accvec); |  |  |  | 
		
	
		
			
				|  |  |  |  |  |                 opDecl["left"]["exp"] = rewardModelName; | 
		
	
		
			
				|  |  |  |  |  |                 if (f.getSubformula().isReachabilityRewardFormula() || f.getSubformula().isCumulativeRewardFormula()) { | 
		
	
		
			
				|  |  |  |  |  |                     opDecl["left"]["accumulate"] = modernjson::json(accvec); | 
		
	
		
			
				|  |  |  |  |  |                 } | 
		
	
		
			
				|  |  |                 opDecl["right"] = buildExpression(bound.threshold, model.getConstants(), model.getGlobalVariables()); |  |  |                 opDecl["right"] = buildExpression(bound.threshold, model.getConstants(), model.getGlobalVariables()); | 
		
	
		
			
				|  |  |             } else { |  |  |             } else { | 
		
	
		
			
				|  |  |                 if(f.hasOptimalityType()) { |  |  |  | 
		
	
		
			
				|  |  |  |  |  |                 if (f.hasOptimalityType()) { | 
		
	
		
			
				|  |  |                     opDecl["op"] = f.getOptimalityType() == storm::solver::OptimizationDirection::Minimize ? "Emin" : "Emax"; |  |  |                     opDecl["op"] = f.getOptimalityType() == storm::solver::OptimizationDirection::Minimize ? "Emin" : "Emax"; | 
		
	
		
			
				|  |  |                     opDecl["reach"] = boost::any_cast<modernjson::json>(f.getSubformula().asEventuallyFormula().getSubformula().accept(*this, data)); |  |  |  | 
		
	
		
			
				|  |  |                      |  |  |                      | 
		
	
		
			
				|  |  |                 } else { |  |  |                 } else { | 
		
	
		
			
				|  |  |                     // TODO add checks
 |  |  |                     // TODO add checks
 | 
		
	
		
			
				|  |  |                     opDecl["op"] = "Emin"; |  |  |                     opDecl["op"] = "Emin"; | 
		
	
		
			
				|  |  |                     opDecl["reach"] = boost::any_cast<modernjson::json>(f.getSubformula().asEventuallyFormula().getSubformula().accept(*this, data)); |  |  |  | 
		
	
		
			
				|  |  |                 } |  |  |                 } | 
		
	
		
			
				|  |  |                 std::string rewardModelName; |  |  |  | 
		
	
		
			
				|  |  |                 if (f.hasRewardModelName()) { |  |  |  | 
		
	
		
			
				|  |  |                     rewardModelName = f.getRewardModelName(); |  |  |  | 
		
	
		
			
				|  |  |                 } else { |  |  |  | 
		
	
		
			
				|  |  |                     if (model.getGlobalVariables().getNumberOfRealTransientVariables() == 1) { |  |  |  | 
		
	
		
			
				|  |  |                         for (auto const& variable : model.getGlobalVariables().getRealVariables()) { |  |  |  | 
		
	
		
			
				|  |  |                             if (variable.isTransient()) { |  |  |  | 
		
	
		
			
				|  |  |                                 rewardModelName = variable.getName(); |  |  |  | 
		
	
		
			
				|  |  |                                 STORM_LOG_WARN("Reward model name was not given, assuming the only global real transient variable '" << rewardModelName << "' to measure the reward."); |  |  |  | 
		
	
		
			
				|  |  |                                 break; |  |  |  | 
		
	
		
			
				|  |  |                             } |  |  |  | 
		
	
		
			
				|  |  |                         } |  |  |  | 
		
	
		
			
				|  |  |                     } |  |  |  | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |  |                 if (f.getSubformula().isEventuallyFormula()) { | 
		
	
		
			
				|  |  |  |  |  |                     opDecl["left"]["reach"] = boost::any_cast<modernjson::json>(f.getSubformula().asEventuallyFormula().getSubformula().accept(*this, data)); | 
		
	
		
			
				|  |  |  |  |  |                 } else if (f.getSubformula().isCumulativeRewardFormula()) { | 
		
	
		
			
				|  |  |  |  |  |                     opDecl["left"][instantName] = buildExpression(f.getSubformula().asCumulativeRewardFormula().getBound(), model.getConstants(), model.getGlobalVariables()); | 
		
	
		
			
				|  |  |  |  |  |                 } else if (f.getSubformula().isInstantaneousRewardFormula()) { | 
		
	
		
			
				|  |  |  |  |  |                     opDecl["left"][instantName] = buildExpression(f.getSubformula().asInstantaneousRewardFormula().getBound(), model.getConstants(), model.getGlobalVariables()); | 
		
	
		
			
				|  |  |                 } |  |  |                 } | 
		
	
		
			
				|  |  |                 STORM_LOG_THROW(!rewardModelName.empty(), storm::exceptions::NotSupportedException, "Reward name has to be specified for Jani-conversion"); |  |  |  | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  |                 opDecl["exp"] = rewardModelName; |  |  |                 opDecl["exp"] = rewardModelName; | 
		
	
		
			
				|  |  |                 opDecl["accumulate"] = modernjson::json(accvec); |  |  |  | 
		
	
		
			
				|  |  |  |  |  |                 if (f.getSubformula().isReachabilityRewardFormula() || f.getSubformula().isCumulativeRewardFormula()) { | 
		
	
		
			
				|  |  |  |  |  |                     opDecl["accumulate"] = modernjson::json(accvec); | 
		
	
		
			
				|  |  |  |  |  |                 } | 
		
	
		
			
				|  |  |             } |  |  |             } | 
		
	
		
			
				|  |  |             return opDecl; |  |  |             return opDecl; | 
		
	
		
			
				|  |  |         } |  |  |         } | 
		
	
	
		
			
				|  | 
 |