Skip to content

Commit 0eed308

Browse files
committed
added QueryableOpinion interface
1 parent 4bf2776 commit 0eed308

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/subjectivelogic/Opinion.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ type Opinion struct {
3737
baseRate float64
3838
}
3939

40+
/*
41+
An interface to query binomial opinions from subjective logic.
42+
Provided to increase compatibility with other SL implementations.
43+
*/
44+
type QueryableOpinion interface {
45+
GetBelief() float64
46+
GetDisbelief() float64
47+
GetUncertainty() float64
48+
GetBaseRate() float64
49+
}
50+
4051
/*
4152
NewOpinion takes four float64 values and outputs an *Opinion as well as an Error.
4253
In case a valid Opinion can be formed, it will be returned and the error will be nil.

0 commit comments

Comments
 (0)