コード例 #1
0
ファイル: strategy.go プロジェクト: ready-steady/adapt
// NewStrategy creates a basic strategy.
func NewStrategy(inputs, outputs uint, guide Guide, minLevel, maxLevel uint,
	scoreError float64) *Strategy {

	return &Strategy{
		ni: inputs,
		no: outputs,

		guide: guide,

		lmin: minLevel,
		lmax: maxLevel,
		εs:   scoreError,

		unique: internal.NewUnique(inputs),
	}
}
コード例 #2
0
ファイル: strategy.go プロジェクト: ready-steady/adapt
// NewStrategy creates a basic strategy.
func NewStrategy(inputs, outputs uint, guide Guide, minLevel, maxLevel uint,
	absoluteError, relativeError, scoreError float64) *Strategy {

	return &Strategy{
		ni: inputs,
		no: outputs,

		guide: guide,

		lmin: minLevel,
		lmax: maxLevel,
		εs:   scoreError,

		active:    internal.NewActive(inputs),
		threshold: internal.NewThreshold(outputs, absoluteError, relativeError),
		hash:      internal.NewHash(inputs),
		unique:    internal.NewUnique(inputs),

		lndexer: make(map[string]uint),
		indexer: make(map[string]uint),
	}
}