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

mlange-42 / arche-model / 4746982157

19 Apr 2023 07:06PM CUT coverage: 97.196%. Remained the same
4746982157

push

github

GitHub
Use official Coveralls action/app (#41)

520 of 535 relevant lines covered (97.2%)

99.41 hits per line

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

100.0
/reporter/print.go
1
package reporter
2

3
import (
4
        "fmt"
5

6
        "github.com/mlange-42/arche-model/observer"
7
        "github.com/mlange-42/arche/ecs"
8
)
9

10
// Print reporter to print a table row per time step.
11
type Print struct {
12
        Observer       observer.Row // Observer to get data from.
13
        UpdateInterval int          // Update/print interval in model ticks.
14
        header         []string
15
        step           int64
16
}
17

18
// Initialize the system
19
func (s *Print) Initialize(w *ecs.World) {
1✔
20
        s.Observer.Initialize(w)
1✔
21
        s.header = s.Observer.Header()
1✔
22
        s.step = 0
1✔
23
}
1✔
24

25
// Update the system
26
func (s *Print) Update(w *ecs.World) {
20✔
27
        s.Observer.Update(w)
20✔
28
        if s.step%int64(s.UpdateInterval) == 0 {
22✔
29
                values := s.Observer.Values(w)
2✔
30
                fmt.Printf("%v\n%v\n", s.header, values)
2✔
31
        }
2✔
32
        s.step++
20✔
33
}
34

35
// Finalize the system
36
func (s *Print) Finalize(w *ecs.World) {}
1✔
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