mirror of https://github.com/velour/catbase.git
try to force the bridge command to give less deterministic results
This commit is contained in:
parent
bd7cf6be7c
commit
11c4f78bbd
|
@ -862,7 +862,7 @@ func (p *BabblerPlugin) babbleSeedBookends(babblerName string, start, end []stri
|
||||||
closed := map[int64]*searchNode{ startWordNode.NodeId : open[0] }
|
closed := map[int64]*searchNode{ startWordNode.NodeId : open[0] }
|
||||||
goalNodeId := int64(-1)
|
goalNodeId := int64(-1)
|
||||||
|
|
||||||
for i := 0; i < len(open) && i < 250; i++ {
|
for i := 0; i < len(open) && i < 1000; i++ {
|
||||||
cur := open[i]
|
cur := open[i]
|
||||||
|
|
||||||
arcs, err := p.getNextArcs(cur.babblerNodeId)
|
arcs, err := p.getNextArcs(cur.babblerNodeId)
|
||||||
|
@ -880,11 +880,14 @@ func (p *BabblerPlugin) babbleSeedBookends(babblerName string, start, end []stri
|
||||||
|
|
||||||
if arc.ToNodeId == endWordNode.NodeId {
|
if arc.ToNodeId == endWordNode.NodeId {
|
||||||
goalNodeId = cur.babblerNodeId
|
goalNodeId = cur.babblerNodeId
|
||||||
|
//add a little randomization in through maybe searching beyond this solution?
|
||||||
|
if rand.Intn(4) == 0 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if goalNodeId == -1 {
|
if goalNodeId == -1 {
|
||||||
return "", errors.New("couldn't find path")
|
return "", errors.New("couldn't find path")
|
||||||
|
|
Loading…
Reference in New Issue