Refactoring not done yet, still need to do RSassert

This commit is contained in:
elvis
2025-08-24 02:01:24 +02:00
parent 8a492c7b8a
commit 3a4c4d43c2
18 changed files with 705 additions and 747 deletions

View File

@ -3,9 +3,11 @@
//! Allows to define the 'classical' mechanism to compute in a Reaction System
//! (RS) Framework.
use std::hash::Hash;
use serde::{Deserialize, Serialize};
use std::hash::Hash;
use super::set::Set;
use super::translator::{Translator, PrintableWithTranslator, Formatter};
/// Basic structure for a reaction.
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)]
@ -149,3 +151,16 @@ impl Default for Reaction {
Reaction::new()
}
}
impl PrintableWithTranslator for Reaction {
fn print(&self, f: &mut std::fmt::Formatter, translator: &Translator)
-> std::fmt::Result {
write!(
f,
"(r: {}, i: {}, p: {})",
Formatter::from(translator, &self.reactants),
Formatter::from(translator, &self.inhibitors),
Formatter::from(translator, &self.products)
)
}
}