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
{{ message }}
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.
Description
Create an endpoint to solidify the proposed API for composing two models in Petri Net form.
Should not rely on any integration with Catlab or TA2 performers.
The input payload should include:
modelA: a JSON-serialized petri net
modelB: a JSON-serialized petri net
commonStates: a list of pairs of states (one from each model) that should be combined as part of this operation.
An example of what the commonStates input might look like:
[
// In this example, modelA and modelB both contain a state called "p1". The output will merge these two states
{
modelA: “p1”,
modelB: “p1”
},
// In this example, modelA and modelB contain states with two different names("foo" and"bar") that we want to merge despite their differing names.
{
modelA: “foo”,
modelB: “bar”
},
...
]
Behaviour and return value
Assuming there are no errors, this endpoint should return a new JSON-serialized petri net that includes the states from both input petri nets, merges the states listed in commonStates, and preserves the transitions from each input petri net (updating any transitions that involve states that were merged).
Note that since petri net components do not currently have unique IDs, there can be some ambiguity if a model contains multiple states with the same label. For now, it's fine to use the first state you find with the correct label. It's also fine to output a petri net that includes multiple states with the same label.
Edge cases
This work includes writing tests to confirm the endpoint behaves reasonably for cases like:
invalid input formats: return an error
commonStates is empty: preserve all states and transitions from both input models
a pair in commonStates doesn't have keys for both models: return an error
a commonStates pair contains a state label that can't be found in the model: return an error
successfully merge two states with the same name
successfully merge two states with different names
successfully handle an array of commonStates with length > 1
The text was updated successfully, but these errors were encountered:
Description
Create an endpoint to solidify the proposed API for composing two models in Petri Net form.
Should not rely on any integration with Catlab or TA2 performers.
The input payload should include:
An example of what the commonStates input might look like:
Behaviour and return value
Assuming there are no errors, this endpoint should return a new JSON-serialized petri net that includes the states from both input petri nets, merges the states listed in commonStates, and preserves the transitions from each input petri net (updating any transitions that involve states that were merged).
Note that since petri net components do not currently have unique IDs, there can be some ambiguity if a model contains multiple states with the same label. For now, it's fine to use the first state you find with the correct label. It's also fine to output a petri net that includes multiple states with the same label.
Edge cases
This work includes writing tests to confirm the endpoint behaves reasonably for cases like:
The text was updated successfully, but these errors were encountered: