Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit 2929993

Browse files
committed
tweak strategy name
1 parent 6b2e883 commit 2929993

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Gym/Blackjack/main.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class BlackjackState {
3434
}
3535

3636
enum SolverType: CaseIterable {
37-
case random, markov, qlearning, thorpe
37+
case random, markov, qlearning, normal
3838
}
3939

4040
class Solver {
@@ -103,7 +103,7 @@ class Solver {
103103
}
104104
}
105105

106-
func getThorpeStrategyLookup(playerSum: Int) -> String {
106+
func getNormalStrategyLookup(playerSum: Int) -> String {
107107
// see figure 11: https://ieeexplore.ieee.org/document/1299399/
108108
switch playerSum {
109109
case 10: return "HHHHHSSHHH"
@@ -122,11 +122,11 @@ class Solver {
122122
}
123123
}
124124

125-
func getThorpeStrategy(observation: BlackjackState) -> Bool {
125+
func getNormalStrategy(observation: BlackjackState) -> Bool {
126126
if observation.playerSum == 0 {
127127
return true
128128
}
129-
let lookupString = getThorpeStrategyLookup(playerSum: observation.playerSum)
129+
let lookupString = getNormalStrategyLookup(playerSum: observation.playerSum)
130130
return Array(lookupString)[observation.dealerCard - 1] == "H"
131131
}
132132

@@ -138,8 +138,8 @@ class Solver {
138138
return getMarkovStrategy(observation: observation)
139139
case .qlearning:
140140
return getQLearningStrategy(observation: observation, iteration: iteration)
141-
case .thorpe:
142-
return getThorpeStrategy(observation: observation)
141+
case .normal:
142+
return getNormalStrategy(observation: observation)
143143
}
144144
}
145145
}

0 commit comments

Comments
 (0)