예제 #1
0
 public static bool TryParse(string str, out DiscreteOutcome?outcome)
 {
     outcome = null;
     if (str == null)
     {
         throw new ArgumentNullException(nameof(str));
     }
     if (str.StartsWith("MSG:"))
     {
         outcome = new DiscreteOutcome(str.Substring(4));
         return(true);
     }
     else if (str.StartsWith("SHA256:"))
     {
         try
         {
             outcome = new DiscreteOutcome(Encoders.Hex.DecodeData(str.Substring(7)));
             return(true);
         }
         catch
         {
             return(false);
         }
     }
     return(false);
 }
예제 #2
0
 public DiscretePayoff(DiscreteOutcome outcome, Money reward)
 {
     if (outcome.OutcomeString is null)
     {
         throw new ArgumentException("OutcomeString is not available", nameof(outcome));
     }
     Reward  = reward;
     Outcome = outcome;
 }
예제 #3
0
 public DLCExecution(Transaction cET, DiscreteOutcome outcome)
 {
     CET     = cET;
     Outcome = outcome;
 }
예제 #4
0
 public bool TryGetValue(DiscreteOutcome outcome, out Money payout)
 {
     return(_Rewards.TryGetValue(outcome, out payout));
 }
예제 #5
0
 public void Add(DiscreteOutcome outcome, Money reward)
 {
     this.Add(new DiscretePayoff(outcome, reward));
 }
예제 #6
0
 public DiscretePayoff(DiscreteOutcome outcome, Money reward)
 {
     Reward  = reward;
     Outcome = outcome;
 }