Skip to content

Commit 25c4c8e

Browse files
committed
Send game state delta to predictor only if in train mode.
1 parent a2ebf99 commit 25c4c8e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

VSharp.Explorer/AISearcher.fs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ type internal AISearcher(oracle: Oracle, aiAgentTrainingOptions: Option<AIAgentT
102102
let removed = availableStates.Remove state
103103
assert removed
104104
for bb in state._history do bb.Key.AssociatedStates.Remove state |> ignore
105-
105+
106+
let inTrainMode = aiAgentTrainingOptions.IsSome
107+
106108
let pick selector =
107109
if useDefaultSearcher
108110
then
@@ -129,13 +131,13 @@ type internal AISearcher(oracle: Oracle, aiAgentTrainingOptions: Option<AIAgentT
129131
let reward = computeReward lastCollectedStatistics statistics
130132
oracle.Feedback (Feedback.MoveReward reward)
131133
Application.applicationGraphDelta.Clear()
132-
if aiAgentTrainingOptions.IsSome && stepsToPlay = stepsPlayed
134+
if inTrainMode && stepsToPlay = stepsPlayed
133135
then None
134136
else
135137
let toPredict =
136-
if stepsPlayed = 0u<step>
137-
then gameState.Value
138-
else gameStateDelta
138+
if inTrainMode && stepsPlayed > 0u<step>
139+
then gameStateDelta
140+
else gameState.Value
139141
let stateId = oracle.Predict toPredict
140142
afterFirstAIPeek <- true
141143
let state = availableStates |> Seq.tryFind (fun s -> s.internalId = stateId)

0 commit comments

Comments
 (0)