autopilot/interface+externalscoreattach: define ScoreSettable
ScoreSettable is an interface that let caller set external scores for the heuristic. The ExternalScoreAttachment and WeightedCombAttachment heuristics implement this interface.
This commit is contained in:
3 files changed
+24
-3
No files matched your search
@@ -23,8 +23,9 @@ func NewExternalScoreAttachment() *ExternalScoreAttachment {
|
||||
}
|
||||
|
||||
// A compile time assertion to ensure ExternalScoreAttachment meets the
|
||||
// AttachmentHeuristic interface.
|
||||
// AttachmentHeuristic and ScoreSettable interfaces.
|
||||
var _ AttachmentHeuristic = (*ExternalScoreAttachment)(nil)
|
||||
var _ ScoreSettable = (*ExternalScoreAttachment)(nil)
|
||||
|
||||
// Name returns the name of this heuristic.
|
||||
//
|
||||
@@ -38,6 +39,8 @@ func (s *ExternalScoreAttachment) Name() string {
|
||||
// of the targeted heuristic, to allow recursively target specific
|
||||
// sub-heuristics. The returned boolean indicates whether the targeted
|
||||
// heuristic was found.
|
||||
//
|
||||
// NOTE: This is a part of the ScoreSettable interface.
|
||||
func (s *ExternalScoreAttachment) SetNodeScores(targetHeuristic string,
|
||||
newScores map[NodeID]float64) (bool, error) {
|
||||
|
||||
|
||||
Reference in new issue
Block a user