
examples.split.mlrj2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mlrules Show documentation
Show all versions of mlrules Show documentation
The main project for the external domain-specific modeling
language ML-Rules, which is used to model hierarchical biochemical
reaction networks with nested and attributed species
//constants
k1 : 0.1;
//functions
// count the number of A within the given solution
countA :: sol -> num;
countA [] = 0;
countA x + xs = a + countA(xs) where a = (if (name(x) == 'A') then amount(x) else 0);
// split the given solution into two equally divided parts
split :: sol -> tuple;
split [] = <[],[]>;
split x + xs =
where l = toInt(amount(x)/2.0), // half amount and cut decimal places
r = amount(x) - l,
= split(xs);
//species
Cell()[];
A();
//initial solution
>>INIT[1 Cell[100 A]];
//reaction rules
Cell[sol?]:c -> Cell[a] + Cell[b] @ if (countA(sol?) < 10) then 0 else k1 * #c where = split(sol?);
© 2015 - 2025 Weber Informatics LLC | Privacy Policy