You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suggest a warning message for users when an IPM has attributes and symbols that are not used within the edges. Joe and I discussed this in a meeting. The code below should show an example where gamma is an attribute with the y symbol but it's not used in the edges so having a warning message or alert of some kind in a scenario like this is the idea.
defconstruct_ipm():
symbols=create_symbols(
compartments=[
compartment('S'),
compartment('I'),
compartment('R'),
compartment('H'),
],
attributes=[
AttributeDef('beta', type=float, shape=Shapes.TxN,
comment='infectivity'),
AttributeDef('gamma', type=float, shape=Shapes.TxN,
comment='infectivity'),
AttributeDef('xi', type=float, shape=Shapes.TxN,
comment='progression from recovered to susceptible'),
AttributeDef('h_rate', type=float, shape=Shapes.TxN,
comment='progression from infected to hospitalized'),
AttributeDef('h_recovery', type=float, shape=Shapes.TxN,
comment='progression from hospitalized to recovered'),
AttributeDef('h_prob', type=float, shape=Shapes.TxN,
comment='probablity for hospital versus recovered'),
])
[S, I, R, H] =symbols.compartment_symbols
[β, y, ξ, h_rate, h_rec, h_prob] =symbols.attribute_symbolsN=Max(1, S+I+R)
returncreate_model(
symbols=symbols,
transitions=[
edge(S, I, rate=β*S*I/N),
fork(
edge(I, H, rate=h_rate*I*h_prob),
edge(I, R, rate=h_rate*I* (1-h_prob)),
),
edge(H, R, rate=h_rec*H),
edge(R, S, rate=ξ*R)
])
SIRH_ipm=construct_ipm() # store hospitalization ipm
The text was updated successfully, but these errors were encountered:
Suggest a warning message for users when an IPM has attributes and symbols that are not used within the edges. Joe and I discussed this in a meeting. The code below should show an example where gamma is an attribute with the y symbol but it's not used in the edges so having a warning message or alert of some kind in a scenario like this is the idea.
The text was updated successfully, but these errors were encountered: