-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSimpleGameNode.java
94 lines (72 loc) · 1.88 KB
/
SimpleGameNode.java
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import java.util.ArrayList;
import java.util.List;
public class SimpleGameNode implements GameNode {
public static final int PLAYER_NATURE = -1;
private final List<GameNode> children;
private final int player;
private final boolean publicVis;
private GameNode parent;
private int cindex;
private Double payoff;
private Double freq;
private InfoSet iset;
public SimpleGameNode() {
this.children = new ArrayList<GameNode>();
this.player = PLAYER_NATURE;
this.publicVis = true;
}
public SimpleGameNode(int player, boolean publicVis) {
this.children = new ArrayList<GameNode>();
this.player = player;
this.publicVis = publicVis;
}
public GameNode getParent() {
return parent;
}
public void setParent(GameNode parent) {
this.parent = parent;
}
public void addChild(GameNode n) {
children.add(n);
n.setChildIndex(children.size() - 1);
n.setParent(this);
}
public int getChildIndex() {
return cindex;
}
public void setChildIndex(int cindex) {
this.cindex = cindex;
}
public List<GameNode> getChildren() {
return children;
}
public Double getPayoff() {
return payoff;
}
public Double setPayoff(Double payoff) {
this.payoff = payoff;
return this.payoff;
}
public Double getFreq() {
return freq;
}
public Double setFreq(Double freq) {
this.freq = freq;
return this.freq;
}
public InfoSet getInfoSet() {
return iset;
}
public void setInfoSet(InfoSet iset) {
this.iset = iset;
}
public int getPlayer() {
return player;
}
public boolean isPublic() {
return publicVis;
}
public String getChildString(int cindex) {
return this.toString();
}
}