aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAiden Woodruff <woodra@rpi.edu>2025-11-19 23:53:03 -0500
committerAiden Woodruff <woodra@rpi.edu>2025-11-19 23:53:03 -0500
commitfbc1f58bd202ae2fff80e20f874812d5351b5318 (patch)
treecd21e015d725dcd4d29f5a842404353a5601c377 /src
parentbdf08f745ed7373431b8d911449fd77068258abe (diff)
downloadtipping-points-fbc1f58bd202ae2fff80e20f874812d5351b5318.tar.gz
tipping-points-fbc1f58bd202ae2fff80e20f874812d5351b5318.tar.bz2
tipping-points-fbc1f58bd202ae2fff80e20f874812d5351b5318.zip
fix update_memory
- src/NameGame.cc (NameGame::update_memory): fixed update_memory not updating memory vectors. - needed to get reference to node data. - shortened update sequence and avoided using another auto reference. Signed-off-by: Aiden Woodruff <woodra@rpi.edu>
Diffstat (limited to 'src')
-rw-r--r--src/NameGame.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/NameGame.cc b/src/NameGame.cc
index 3fc314e..e18d419 100644
--- a/src/NameGame.cc
+++ b/src/NameGame.cc
@@ -124,11 +124,10 @@ int NameGame::best_move(int nId) const {
124} 124}
125 125
126void NameGame::update_memory(int nId, int strategy) { 126void NameGame::update_memory(int nId, int strategy) {
127 auto d = graph.GetNDat(nId); 127 auto& d = graph.GetNDat(nId);
128 if (!d.Val1) { 128 if (!d.Val1) {
129 auto& mem = d.Val2; 129 d.Val2.Ins(0, strategy);
130 mem.Ins(0, strategy); 130 d.Val2.Trunc(memlen);
131 mem.Trunc(memlen);
132 } 131 }
133} 132}
134 133