Skip to content

Commit

Permalink
Add examples for burst analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
hellerve committed Mar 27, 2024
1 parent 8657643 commit 37f384a
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/GToolkit-Utility-Algorithms/GtBurstAnalyzer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ GtBurstAnalyzer >> ensureCutoff [
]
]

{ #category : #accessing }
GtBurstAnalyzer >> gtViewBurstIntervalsFor: aView [
<gtView>
^ aView list
title: 'Burst intervals';
priority: 2;
items: [ self run ]
]

{ #category : #accessing }
GtBurstAnalyzer >> gtViewBurstsFor: aView [
<gtView>
Expand Down
53 changes: 53 additions & 0 deletions src/GToolkit-Utility-Algorithms/GtBurstAnalyzerExamples.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Class {
#name : #GtBurstAnalyzerExamples,
#superclass : #Object,
#category : #'GToolkit-Utility-Algorithms-Bursts - Examples'
}

{ #category : #accessing }
GtBurstAnalyzerExamples >> burstAnalyzerWithCustomCutoff [
<gtExample>
| analyzer |
analyzer := self simpleBurstAnalyzer cutoff: 40.

self assert: analyzer run size equals: 2.

^ analyzer
]

{ #category : #accessing }
GtBurstAnalyzerExamples >> simpleBurstAnalyzer [
<gtExample>
| analyzer |
analyzer := GtBurstAnalyzer new timeSeries: self timeSeries.

self assert: analyzer run size equals: 1.

^ analyzer
]

{ #category : #accessing }
GtBurstAnalyzerExamples >> timeSeries [
<gtExample>
^ {1.
2.
3.
4.
50.
55.
5.
3.
6.
4.
9.
10.
70.
50.
3.
5.
2.
4.
3.
9.
8}
]

0 comments on commit 37f384a

Please sign in to comment.