Skip to content

Commit

Permalink
Fixed regnet bug (#833)
Browse files Browse the repository at this point in the history
## Summary of Changes
There was a bug for too many src's and tgt's for certain equations.
Fixed it.

### Related issues

Resolves ???

Co-authored-by: Justin <[email protected]>
  • Loading branch information
Free-Quarks and Justin authored Feb 28, 2024
1 parent 8840780 commit 608ea86
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions skema/skema-rs/mathml/src/acset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -980,11 +980,6 @@ impl From<Vec<FirstOrderODE>> for RegNet {
if term.exp_states.len() > 1 {
let mut output = [term.dyn_state.clone()].to_vec();
let mut input = term.exp_states.clone();
for state in term.exp_states.iter() {
if *state != term.dyn_state {
output.push(state.clone());
}
}

let param_len = term.parameters.len();

Expand All @@ -999,6 +994,16 @@ impl From<Vec<FirstOrderODE>> for RegNet {
output.sort();
output.dedup();

if input.clone().len() > 1 {
let old_input = input.clone();
input = [].to_vec();
for term in old_input.clone().iter() {
if *term != output[0] {
input.push(term.clone());
}
}
}

let trans = RegTransition {
id: format!("s{}", i.clone()),
source: Some(input.clone()),
Expand Down

0 comments on commit 608ea86

Please sign in to comment.