Skip to content

Commit cd23fbf

Browse files
committed
feat: Add sending of steps count
1 parent a8e64b7 commit cd23fbf

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

VSharp.ML.GameServer.Runner/Main.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ let ws port outputDirectory (webSocket: WebSocket) (context: HttpContext) =
239239
GameOver(
240240
explorationResult.ActualCoverage,
241241
explorationResult.TestsCount,
242+
explorationResult.StepsCount,
242243
explorationResult.ErrorsCount
243244
)
244245
)

VSharp.ML.GameServer/Messages.fs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,13 @@ type GameOverMessageBody =
109109
interface IRawOutgoingMessageBody
110110
val ActualCoverage: uint<percent>
111111
val TestsCount: uint32<test>
112+
val StepsCount: uint32<step>
112113
val ErrorsCount: uint32<error>
113114

114-
new(actualCoverage, testsCount, errorsCount) =
115+
new(actualCoverage, testsCount, stepsCount, errorsCount) =
115116
{ ActualCoverage = actualCoverage
116117
TestsCount = testsCount
118+
StepsCount = stepsCount
117119
ErrorsCount = errorsCount }
118120

119121
[<Struct>]
@@ -371,7 +373,7 @@ type IncorrectPredictedStateIdMessageBody =
371373
new(stateId) = { StateId = stateId }
372374

373375
type OutgoingMessage =
374-
| GameOver of uint<percent> * uint32<test> * uint32<error>
376+
| GameOver of uint<percent> * uint32<test> * uint32<step> * uint32<error>
375377
| MoveReward of Reward
376378
| IncorrectPredictedStateId of uint<stateId>
377379
| ReadyForNextStep of GameState
@@ -397,8 +399,8 @@ let deserializeInputMessage (messageData: byte[]) =
397399

398400
let serializeOutgoingMessage (message: OutgoingMessage) =
399401
match message with
400-
| GameOver(actualCoverage, testsCount, errorsCount) ->
401-
RawOutgoingMessage("GameOver", box (GameOverMessageBody(actualCoverage, testsCount, errorsCount)))
402+
| GameOver(actualCoverage, testsCount, stepsCount, errorsCount) ->
403+
RawOutgoingMessage("GameOver", box (GameOverMessageBody(actualCoverage, testsCount, stepsCount, errorsCount)))
402404
| MoveReward reward -> RawOutgoingMessage("MoveReward", reward)
403405
| IncorrectPredictedStateId stateId ->
404406
RawOutgoingMessage("IncorrectPredictedStateId", IncorrectPredictedStateIdMessageBody stateId)

0 commit comments

Comments
 (0)