Skip to content

Commit

Permalink
fix sd
Browse files Browse the repository at this point in the history
  • Loading branch information
dk14 committed Aug 3, 2020
1 parent 3dcbeb6 commit 09bdab9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion marlowe-actus/src/Language/Marlowe/ACTUS/Generator.hs
Expand Up @@ -164,6 +164,6 @@ genFsContract terms =
$ if (isNothing pof) then cont
else if r > 0.0 then invoice "party" "counterparty" (UseValue $ payoffAt t) date cont
else invoice "counterparty" "party" (NegValue $ UseValue $ payoffAt t) date cont
where pof = (payoffFs ev terms t (t - 1) (cashCalculationDay cf))
where pof = (payoffFs ev terms t (t - 1) prevDate (cashCalculationDay cf))
scheduleAcc = foldr gen Close $ L.zip6 schedCfs previousDates schedEvents schedDates cfsDirections [1..]
in inititializeStateFs terms scheduleAcc
Expand Up @@ -12,8 +12,8 @@ import Language.Marlowe.ACTUS.Model.POF.PayoffModel (_POF_FP_PAM,
import Language.Marlowe.ACTUS.Ops (YearFractionOps (_y), ActusNum(..), marloweFixedPoint)
import Prelude hiding (Fractional, Num, (*), (+), (-), (/))

payoffFs :: EventType -> ContractTerms -> Integer -> Integer -> Day -> Maybe (Value Observation)
payoffFs ev ContractTerms{..} t t_minus curDate =
payoffFs :: EventType -> ContractTerms -> Integer -> Integer -> Day -> Day -> Maybe (Value Observation)
payoffFs ev ContractTerms{..} t t_minus prevDate curDate =
let __NT = constnt ct_NT
__PDIED = constnt ct_PDIED
__PYTP = enum ct_PYTP
Expand All @@ -34,7 +34,7 @@ payoffFs ev ContractTerms{..} t t_minus curDate =
__fac = useval "fac" t_minus
__ipnr = useval "ipnr" t_minus

y_sd_t = constnt $ _y ct_DCC ct_SD curDate undefined
y_sd_t = constnt $ _y ct_DCC prevDate curDate ct_MD

pof = case contractType of
PAM -> case ev of
Expand Down
Expand Up @@ -62,7 +62,7 @@ stateTransitionFs ev terms@ContractTerms{..} t prevDate curDate continue =
addComment cont = case ev of
IED -> letval "IED" t (constnt 0) cont
MD -> letval "MD" t (constnt 0) cont
IP -> letval ("IP:" ++ (show curDate)) t (constnt 0) cont
IP -> letval ("IP:" ++ (show curDate) ++ (show prevDate)) t (constnt 0) cont
RR -> letval ("RR:" ++ (show curDate)) t (constnt 0) cont
FP -> letval ("FP:" ++ (show curDate)) t (constnt 0) cont
_ -> cont
Expand Down

0 comments on commit 09bdab9

Please sign in to comment.