Skip to content

Commit d3b9f44

Browse files
YingboMaBenChung
authored andcommitted
Throw an error if structural simplification is applied twice
1 parent 32ad023 commit d3b9f44

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/systems/abstractsystem.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,19 @@ end
846846

847847
iscomplete(sys::AbstractSystem) = isdefined(sys, :complete) && getfield(sys, :complete)
848848

849+
function schedule(sys::AbstractSystem)
850+
has_schedule(sys) ? sys : (@set! sys.isscheduled = true)
851+
end
852+
function isscheduled(sys::AbstractSystem)
853+
if has_schedule(sys)
854+
get_schedule(sys) !== nothing
855+
elseif has_isscheduled(sys)
856+
get_isscheduled(sys)
857+
else
858+
false
859+
end
860+
end
861+
849862
"""
850863
$(TYPEDSIGNATURES)
851864

0 commit comments

Comments
 (0)