예제 #1
0
 public Payoff(DiscretePayoff payoff)
 {
     Reward = payoff.Reward;
     if (payoff.Outcome.OutcomeString is null)
     {
         throw new ArgumentException(message: "The outcome string should not be empty");
     }
     Outcome = payoff.Outcome.OutcomeString;
 }
예제 #2
0
        public static bool TryParse(string str, out DiscretePayoff?payoff)
        {
            payoff = null;
            str    = str.Trim();
            var i = str.LastIndexOf(':');

            if (i == -1)
            {
                return(false);
            }

            var outcome = str.Substring(0, i);
            var reward  = str.Substring(i + 1);

            if (!Money.TryParse(reward, out var btc) || btc is null)
            {
                return(false);
            }
            payoff = new DiscretePayoff(new DiscreteOutcome(outcome), reward);
            return(true);
        }
예제 #3
0
파일: OfferReview.cs 프로젝트: nicobst/NDLC
 public Payoff(DiscretePayoff payoff)
 {
     Reward  = payoff.Reward;
     IsHash  = payoff.Outcome.OutcomeString is null;
     Outcome = payoff.Outcome.ToString();
 }