• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mlange-42 / ark-tools / 13609263776

01 Mar 2025 10:08PM CUT coverage: 100.0%. First build
13609263776

Pull #1

github

web-flow
Merge 737eee7f4 into 3e01f444a
Pull Request #1: Add App and required resources

343 of 343 new or added lines in 7 files covered. (100.0%)

343 of 343 relevant lines covered (100.0%)

219.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/system/fixed_termination.go
1
package system
2

3
import (
4
        "github.com/mlange-42/ark-tools/resource"
5
        "github.com/mlange-42/ark/ecs"
6
)
7

8
// FixedTermination system.
9
//
10
// Terminates a run after a fixed number of ticks.
11
//
12
// Expects a resource of type [app.Termination].
13
type FixedTermination struct {
14
        Steps   int64 // Number of simulation ticks to run.
15
        termRes ecs.Resource[resource.Termination]
16
        step    int64
17
}
18

19
// Initialize the system
20
func (s *FixedTermination) Initialize(w *ecs.World) {
3✔
21
        s.termRes = ecs.NewResource[resource.Termination](w)
3✔
22
        s.step = 0
3✔
23
}
3✔
24

25
// Update the system
26
func (s *FixedTermination) Update(w *ecs.World) {
230✔
27
        term := s.termRes.Get()
230✔
28

230✔
29
        if s.step+1 >= s.Steps {
233✔
30
                term.Terminate = true
3✔
31
        }
3✔
32
        s.step++
230✔
33
}
34

35
// Finalize the system
36
func (s *FixedTermination) Finalize(w *ecs.World) {}
3✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc