Skip to content

Commit 7a75d75

Browse files
committed
fixing small error in SimulatedAnnealingSearch
1 parent cbb470c commit 7a75d75

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/main/scala/aima/core/search/local/SimulatedAnnealingSearch.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ object SimulatedAnnealingSearch {
6767
}
6868
}
6969

70-
final case class StateValueNode(state: State, value: Double) extends State
70+
final case class StateValueNode(state: State, value: Double)
7171

7272
def apply(stateToValue: State => Double, problem: Problem): Try[State] =
7373
apply(stateToValue, problem, BasicSchedule.schedule)
@@ -94,7 +94,7 @@ object SimulatedAnnealingSearch {
9494
successor
9595
}
9696

97-
def recurse(current: StateValueNode, t: TimeStep): Try[State] = {
97+
def recurse(current: StateValueNode, t: TimeStep): Try[StateValueNode] = {
9898
import time.TimeStep.Implicits._
9999
val T = schedule(t)
100100

@@ -123,6 +123,6 @@ object SimulatedAnnealingSearch {
123123

124124
}
125125

126-
recurse(makeNode(problem.initialState), TimeStep.start)
126+
recurse(makeNode(problem.initialState), TimeStep.start).map(_.state)
127127
}
128128
}

0 commit comments

Comments
 (0)