-
I load charges/premiums as new cells into one of my spaces. However, as part of pricing exercises we might want to iteratively test different sets of charges/premiums. Is there a way to replace or update input cells? |
Beta Was this translation helpful? Give feedback.
Answered by
fumitoh
Jul 27, 2022
Replies: 1 comment 1 reply
-
You can assign input values to cells by For example, import modelx as mx
from modelx import defcells
@defcells
def pv_premiums():
return 0 # dummy
@defcells
def pv_claims():
return 3
@defcells
def net_pv():
return pv_premiums() - pv_claims() and >>> pv_premiums[()] = 4
>>> net_pv()
1
>>> pv_premiums[()] = 3
>>> net_pv()
0 You can write a loop in Python to iterate the assignment operation above. but it's more recommended to refer to a Reference instead of directly assigning values to @defcells
def pv_premiums():
return pv_prem_input >>> mx.Model1.Space1.pv_prem_input = 4
>>> net_pv()
1
>>> mx.Model1.Space1.pv_prem_input = 3
>>> net_pv()
0 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mhumpher
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can assign input values to cells by
[] =
For example,
and
You can write a loop in Python to iterate the assignment operation above. but it's more recommended to refer to a Reference instead of directly assigning values to
pv_premiums
: