/// <summary> /// Visits the <paramref name="formula." /> /// </summary> public override void VisitRewardFormula(RewardFormula formula) { var referenceFormula = _referenceFormula as RewardFormula; if (referenceFormula == null) { IsEqual = false; } else { throw new NotImplementedException(); } }
/// <summary> /// Visits the <paramref name="formula." /> /// </summary> public override void VisitRewardFormula(RewardFormula formula) { if (formula is CalculateExpectedAccumulatedRewardFormula || formula is CalculateLongRunExpectedRewardFormula) { IsFormulaReturningBoolValue = false; } else if (formula is ExpectedAccumulatedRewardFormula || formula is LongRunExpectedRewardFormula) { IsFormulaReturningBoolValue = true; } else { throw new Exception("Not supported, yet"); } }
/// <summary> /// Visits the <paramref name="formula." /> /// </summary> public override void VisitRewardFormula(RewardFormula formula) { if (formula is CalculateLongRunExpectedRewardFormula) { throw new Exception("Not supported, yet"); } else if (formula is CalculateExpectedAccumulatedRewardFormula) { throw new Exception("Not supported, yet"); } else if (formula is ExpectedAccumulatedRewardFormula) { throw new Exception("Not supported, yet"); } else if (formula is LongRunExpectedRewardFormula) { throw new Exception("Not supported, yet"); } else { throw new Exception("Not supported, yet"); } }
/// <summary> /// Visits the <paramref name="formula." /> /// </summary> public override void VisitRewardFormula(RewardFormula formula) { if (formula is CalculateLongRunExpectedRewardFormula) { _builder.Append(" LongRunReward(?,"); _builder.Append(formula.RewardRetriever.Label); _builder.Append(" )"); } else if (formula is CalculateExpectedAccumulatedRewardFormula) { _builder.Append(" ExpectedAccumulatedReward(?,"); _builder.Append(formula.RewardRetriever.Label); _builder.Append(" )"); } else if (formula is ExpectedAccumulatedRewardFormula) { var expectedAccumulated = (ExpectedAccumulatedRewardFormula)formula; var lowerBound = expectedAccumulated.LowerBound.ToString(CultureInfo.InvariantCulture); var upperBound = expectedAccumulated.UpperBound.ToString(CultureInfo.InvariantCulture); _builder.Append($"ExpectedAccumulatedReward({lowerBound}, {upperBound}, "); _builder.Append(formula.RewardRetriever.Label); _builder.Append(")"); } else if (formula is LongRunExpectedRewardFormula) { var longRunExpected = (LongRunExpectedRewardFormula)formula; var lowerBound = longRunExpected.LowerBound.ToString(CultureInfo.InvariantCulture); var upperBound = longRunExpected.UpperBound.ToString(CultureInfo.InvariantCulture); _builder.Append($"LongRunReward({lowerBound}, {upperBound}, "); _builder.Append(formula.RewardRetriever.Label); _builder.Append(")"); } else { Assert.NotReached("Not supported, yet"); } }
/// <summary> /// Visits the <paramref name="formula." /> /// </summary> public override void VisitRewardFormula(RewardFormula formula) { throw new InvalidOperationException("Only state formulas can be evaluated."); }
/// <summary> /// Visits the <paramref name="formula." /> /// </summary> public override void VisitRewardFormula(RewardFormula formula) { Assert.NotReached("Rewards are currently not supported"); }
/// <summary> /// Visits the <paramref name="formula." /> /// </summary> public override void VisitRewardFormula(RewardFormula formula) { }
/// <summary> /// Visits the <paramref name="formula." /> /// </summary> public override void VisitRewardFormula(RewardFormula formula) { MaximalNestedOnceInside = 0; IsCompilable = false; }
/// <summary> /// Visits the <paramref name="formula." /> /// </summary> public override void VisitRewardFormula(RewardFormula formula) { IsNormalizable = false; MaximalNestedOnceInside = 0; }
/// <summary> /// Visits the <paramref name="formula." /> /// </summary> public override void VisitRewardFormula(RewardFormula formula) { IsCompilable = false; }
/// <summary> /// Visits the <paramref name="formula." /> /// </summary> public override void VisitRewardFormula(RewardFormula formula) { _containsInvalidOperators = true; }
/// <summary> /// Visits the <paramref name="formula." /> /// </summary> public override void VisitRewardFormula(RewardFormula formula) { throw new NotImplementedException(); }