|
1 | | -import DynamicalSystemsBase: get_state, set_state! |
| 1 | +import DynamicalSystemsBase: get_state, set_state!, current_parameters |
2 | 2 | import JSON |
3 | 3 | import SciMLBase |
4 | 4 | import StructUtils |
5 | 5 |
|
6 | 6 | using AbstractTrees: Leaves, PostOrderDFS |
7 | 7 | using AutoHashEquals: @auto_hash_equals |
8 | | -using DynamicalSystemsBase: ArbitrarySteppable, current_parameters, initial_state |
| 8 | +using DynamicalSystemsBase: ArbitrarySteppable, initial_state |
9 | 9 | using Graphs: AbstractGraph, SimpleDiGraph, add_edge!, add_vertex!, ne |
10 | 10 | using HerbConstraints: DomainRuleNode, Forbidden, Ordered, Unique, VarNode, addconstraint! |
11 | 11 | using HerbCore: AbstractGrammar, RuleNode, get_rule |
@@ -555,6 +555,10 @@ function set_state!(qn::QN, entity::Symbol, value::Integer) |
555 | 555 | set_state!(qn, EntityName(entity), value) |
556 | 556 | end |
557 | 557 |
|
| 558 | +function set_state!(qn::QN, values) |
| 559 | + set_state!.((qn,), entities(qn), values) |
| 560 | +end |
| 561 | + |
558 | 562 | """ |
559 | 563 | $(TYPEDSIGNATURES) |
560 | 564 |
|
|
630 | 634 |
|
631 | 635 | extract_state(model::QN) = model.state |
632 | 636 | extract_parameters(model::QN) = model.graph |
| 637 | +current_parameters(model::QN) = model.graph |
633 | 638 | reset_model!(model::QN, u, _) = model.state .= u |
634 | 639 |
|
635 | 640 | function SciMLBase.reinit!( |
@@ -658,7 +663,7 @@ function create_qn_system(qn::QN) |
658 | 663 | extract_state, |
659 | 664 | extract_parameters, |
660 | 665 | reset_model!, |
661 | | - isdeterministic = false, |
| 666 | + isdeterministic = get_schedule(qn) == Synchronous(), |
662 | 667 | ) |
663 | 668 | end |
664 | 669 |
|
|
0 commit comments