pub struct ACSet {
pub S: Vec<Specie>,
pub T: Vec<ACSetTransition>,
pub I: Vec<InputArc>,
pub O: Vec<OutputArc>,
}
Fields§
§S: Vec<Specie>
§T: Vec<ACSetTransition>
§I: Vec<InputArc>
§O: Vec<OutputArc>
Implementations§
source§impl ACSet
impl ACSet
sourcepub fn from_file(filepath: &str) -> ACSet
pub fn from_file(filepath: &str) -> ACSet
Equation to Petri net algorithm (taken from https://arxiv.org/pdf/2206.03269.pdf)
M(S) is the set of monomials m: T -> M(S) The ODEs corresponding to a Petri net can be written as follows: \dot{x_i} = \sum_{y} f(i, y)m(y) where f(i, y) are integers such that f(i, y) + e(i, y) is a natural number.
e(i, y): T -> N is a function representing the exponent of species i in monomial corresponding to transition y. For each transition y, draw e(i, y) arrows from specie x_i to transition y. Finally, for each transition y, draw n(i, y) = f(i, y) + e(i, y) arrows from y to x_i.
This function returns a JSON serializable representation of an ACSet for TA2 teams to consume.
sourcepub fn to_graph(&self) -> Graph<PetriNetElement, usize>
pub fn to_graph(&self) -> Graph<PetriNetElement, usize>
Construct a graph object from an ACSet
Trait Implementations§
source§impl<'de> Deserialize<'de> for ACSet
impl<'de> Deserialize<'de> for ACSet
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<ACSet, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ACSet, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl JsonSchema for ACSet
impl JsonSchema for ACSet
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl Ord for ACSet
impl Ord for ACSet
source§impl PartialEq for ACSet
impl PartialEq for ACSet
source§impl PartialOrd for ACSet
impl PartialOrd for ACSet
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for ACSet
impl Serialize for ACSet
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§impl<'__s> ToSchema<'__s> for ACSet
impl<'__s> ToSchema<'__s> for ACSet
impl Eq for ACSet
impl StructuralPartialEq for ACSet
Auto Trait Implementations§
impl RefUnwindSafe for ACSet
impl Send for ACSet
impl Sync for ACSet
impl Unpin for ACSet
impl UnwindSafe for ACSet
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.