Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicated template names after stratification #348

Closed
mwdchang opened this issue Aug 6, 2024 · 0 comments · Fixed by #349
Closed

Duplicated template names after stratification #348

mwdchang opened this issue Aug 6, 2024 · 0 comments · Fixed by #349

Comments

@mwdchang
Copy link

mwdchang commented Aug 6, 2024

When running the following code snippet with the attached model

f = open("shawn/sierdh.json")
amr = json.load(f)
mmt = model_from_json(amr)

mmt2 = stratify(mmt,
    key="vax",
    strata=[
        "u",
        "v"
    ],
    concepts_to_stratify = ["S", "E", "I"],
    # params_to_stratify = ["r_{IH}", "r_{IR}"], 
    cartesian_control = True,
    structure = None,
    param_renaming_uses_strata_names = True               
);

It looks like the template names are duplicated in the resulting mmt2, should we expect template names to be unique within a single model?

for t in mmt2.templates:
    print(t.name)

When transforming back into a petrinet amr, the rates (semantics.ode.rates) are likewise duplicated:

testAmr = template_model_to_petrinet_json(mmt2)

for r in testAmr["semantics"]["ode"]["rates"]:
    print(r["target"], " = ", r["expression"])
...snipped
t0_u_v  =  I_v*S_u*β_u_v
t0_v_u  =  I_u*S_v*β_v_u
t0_u_v  =  S_u*p_u_v
t0_v_u  =  S_v*p_v_u
...snipped

sierdh.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant