1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
use Debug;
// user interface agents for real human to play with
// simple reference implementation agents
use crate;
/// Represents the state visible to a single agent
/// Represents a possible decision that an agent can make
///
/// Make a decision based on the given gamestate, which is how many chips to add to the pot.
///
/// This framing is generic, in that it can represent any action:
///
/// 1. Check: return 0 when there is no bet made
/// 2. Fold: return 0 when there is a bet made
/// 3. Bet: return 'num' chips when no bet was made
/// 4. Call: return 'num' chips when there is a bet made of exactly 'num' chips
/// 5. Raise: return 'num' chips when there is a bet made of less than 'num' chips
///
/// However, this must be validated to prevent cases where the agent returns 0 when they are actually required to bet, or if they return a larger amount than they have in their bankroll, or if there is a specific betting policy that must be followed (such as multiple of 5s, etc).
///
/// Right now, that causes a hard failure. But this is bad for interactive applications and user input. WIP
///
/// TODO: allow for 'intent' returns, i.e. TexasAgentAction::Check ? And hide this behind a 'strict' mode?