Skip to content

Commit

Permalink
use a deque to implement a stack
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainFranceschini committed Apr 24, 2020
1 parent 878f013 commit 18713e3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.2.0

- **(breaking-change)** State refactor ([#15](https://github.com/RomainFranceschini/quartz/pull/15))
- `state_var : Type = value` replaced by `state { var : Type = value }`
- State variables are no longer part of the model, the model now has a reference to its companion class `State`.

# 0.1.0

- First version
6 changes: 3 additions & 3 deletions src/quartz/processor_allocator.cr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Quartz
class ProcessorAllocationError < Exception; end

@simulation : Simulation
@stack : Array(Coordinator)
@stack : Deque(Coordinator)
@root_model : CoupledModel?

@root_coordinator : Coordinator?
Expand All @@ -15,11 +15,11 @@ module Quartz
end

def initialize(@simulation, @root_model)
@stack = Array(Coordinator).new
@stack = Deque(Coordinator).new
end

def initialize(@simulation, parent_processor : Coordinator)
@stack = Array(Coordinator).new
@stack = Deque(Coordinator).new
@stack.push parent_processor
end

Expand Down

0 comments on commit 18713e3

Please sign in to comment.