{"action":"created","issue":{"url":"https://api.github.com/repos/SanchoGGP/ggp-base/issues/324","labels_url":"https://api.github.com/repos/SanchoGGP/ggp-base/issues/324/labels{/name}","comments_url":"https://api.github.com/repos/SanchoGGP/ggp-base/issues/324/comments","events_url":"https://api.github.com/repos/SanchoGGP/ggp-base/issues/324/events","html_url":"https://github.com/SanchoGGP/ggp-base/issues/324","id":93346676,"number":324,"title":"Still something wrong with factor saving/loading","user":{"login":"arr28","id":3194913,"avatar_url":"https://avatars.githubusercontent.com/u/3194913?v=3","gravatar_id":"","url":"https://api.github.com/users/arr28","html_url":"https://github.com/arr28","followers_url":"https://api.github.com/users/arr28/followers","following_url":"https://api.github.com/users/arr28/following{/other_user}","gists_url":"https://api.github.com/users/arr28/gists{/gist_id}","starred_url":"https://api.github.com/users/arr28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arr28/subscriptions","organizations_url":"https://api.github.com/users/arr28/orgs","repos_url":"https://api.github.com/users/arr28/repos","events_url":"https://api.github.com/users/arr28/events{/privacy}","received_events_url":"https://api.github.com/users/arr28/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SanchoGGP/ggp-base/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/SanchoGGP/ggp-base/labels/P1","name":"P1","color":"000000"}],"state":"open","locked":false,"assignee":{"login":"arr28","id":3194913,"avatar_url":"https://avatars.githubusercontent.com/u/3194913?v=3","gravatar_id":"","url":"https://api.github.com/users/arr28","html_url":"https://github.com/arr28","followers_url":"https://api.github.com/users/arr28/followers","following_url":"https://api.github.com/users/arr28/following{/other_user}","gists_url":"https://api.github.com/users/arr28/gists{/gist_id}","starred_url":"https://api.github.com/users/arr28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arr28/subscriptions","organizations_url":"https://api.github.com/users/arr28/orgs","repos_url":"https://api.github.com/users/arr28/repos","events_url":"https://api.github.com/users/arr28/events{/privacy}","received_events_url":"https://api.github.com/users/arr28/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/SanchoGGP/ggp-base/milestones/1","html_url":"https://github.com/SanchoGGP/ggp-base/milestones/IGGPC15","labels_url":"https://api.github.com/repos/SanchoGGP/ggp-base/milestones/1/labels","id":1141800,"number":1,"title":"IGGPC15","description":"","creator":{"login":"arr28","id":3194913,"avatar_url":"https://avatars.githubusercontent.com/u/3194913?v=3","gravatar_id":"","url":"https://api.github.com/users/arr28","html_url":"https://github.com/arr28","followers_url":"https://api.github.com/users/arr28/followers","following_url":"https://api.github.com/users/arr28/following{/other_user}","gists_url":"https://api.github.com/users/arr28/gists{/gist_id}","starred_url":"https://api.github.com/users/arr28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arr28/subscriptions","organizations_url":"https://api.github.com/users/arr28/orgs","repos_url":"https://api.github.com/users/arr28/repos","events_url":"https://api.github.com/users/arr28/events{/privacy}","received_events_url":"https://api.github.com/users/arr28/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":25,"state":"open","created_at":"2015-05-31T17:49:24Z","updated_at":"2015-07-08T21:05:56Z","due_on":"2015-07-26T23:00:00Z","closed_at":null},"comments":2,"created_at":"2015-07-06T18:41:07Z","updated_at":"2015-07-08T22:07:08Z","closed_at":null,"body":"base.connect4simultaneous works fine when starting from scratch, but then fails on the next game.  Must be something wrong with saving/loading.\r\n\r\n```\r\n19:35:38.094 ! Exception in player during meta-gaming\r\njava.lang.NullPointerException\r\n\tat org.ggp.base.util.statemachine.implementation.propnet.forwardDeadReckon.ForwardDeadReckonPropnetStateMachine.getNextState(ForwardDeadReckonPropnetStateMachine.java:2940) ~[bin/:?]\r\n\tat org.ggp.base.player.gamer.statemachine.sancho.TreeNode.expandInternal(TreeNode.java:3330) ~[bin/:?]\r\n\tat org.ggp.base.player.gamer.statemachine.sancho.TreeNode.expand(TreeNode.java:2590) ~[bin/:?]\r\n\tat org.ggp.base.player.gamer.statemachine.sancho.MCTSTree.setRootState(MCTSTree.java:796) ~[bin/:?]\r\n\tat org.ggp.base.player.gamer.statemachine.sancho.GameSearcher.startSearch(GameSearcher.java:951) ~[bin/:?]\r\n\tat org.ggp.base.player.gamer.statemachine.sancho.Sancho.stateMachineMetaGame(Sancho.java:1133) ~[bin/:?]\r\n\tat org.ggp.base.player.gamer.statemachine.StateMachineGamer.metaGame(StateMachineGamer.java:208) [bin/:?]\r\n\tat org.ggp.base.player.request.grammar.StartRequest.process(StartRequest.java:70) [bin/:?]\r\n\tat org.ggp.base.player.GamePlayer.run(GamePlayer.java:111) [bin/:?]\r\n```"},"comment":{"url":"https://api.github.com/repos/SanchoGGP/ggp-base/issues/comments/119745658","html_url":"https://github.com/SanchoGGP/ggp-base/issues/324#issuecomment-119745658","issue_url":"https://api.github.com/repos/SanchoGGP/ggp-base/issues/324","id":119745658,"user":{"login":"arr28","id":3194913,"avatar_url":"https://avatars.githubusercontent.com/u/3194913?v=3","gravatar_id":"","url":"https://api.github.com/users/arr28","html_url":"https://github.com/arr28","followers_url":"https://api.github.com/users/arr28/followers","following_url":"https://api.github.com/users/arr28/following{/other_user}","gists_url":"https://api.github.com/users/arr28/gists{/gist_id}","starred_url":"https://api.github.com/users/arr28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arr28/subscriptions","organizations_url":"https://api.github.com/users/arr28/orgs","repos_url":"https://api.github.com/users/arr28/repos","events_url":"https://api.github.com/users/arr28/events{/privacy}","received_events_url":"https://api.github.com/users/arr28/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T22:07:08Z","updated_at":"2015-07-08T22:07:08Z","body":"Okay - so this is wacky in a way that I don't have time to understand tonight.\r\n\r\nWhen the Factors are first created (by full analysis), each factor gets **2 copies of all the moves** in that factor.  Factor.dump() prints out the following (manually sorted).\r\n\r\n```\r\nDEBUG Factor                         Factor moves:\r\nDEBUG Factor                           ( drop 1 1 )\r\nDEBUG Factor                           ( drop 1 1 )\r\nDEBUG Factor                           ( drop 2 1 )\r\nDEBUG Factor                           ( drop 2 1 )\r\nDEBUG Factor                           ( drop 3 1 )\r\nDEBUG Factor                           ( drop 3 1 )\r\nDEBUG Factor                           ( drop 4 1 )\r\nDEBUG Factor                           ( drop 4 1 )\r\nDEBUG Factor                           ( drop 5 1 )\r\nDEBUG Factor                           ( drop 5 1 )\r\nDEBUG Factor                           ( drop 6 1 )\r\nDEBUG Factor                           ( drop 6 1 )\r\nDEBUG Factor                           ( drop 7 1 )\r\nDEBUG Factor                           ( drop 7 1 )\r\nDEBUG Factor                           ( drop 8 1 )\r\nDEBUG Factor                           ( drop 8 1 )\r\n```\r\n\r\nAnd when serialized to file, there are two copies of each move in the serialized representation.  See the end of the following...\r\n\r\n```\r\nINFO  RuntimeGameCharacteristics     Factor: v1~( true ( cell 3 2 1 red ) ),( true ( cell 7 1 1 black ) ),( true ( cell 4 1 1 black ) ),( true ( cell 1 6 1 red ) ),( true ( cell 2 6 1 red ) ),( true ( cell 8 3 1 black ) ),( true ( cell 2 1 1 black ) ),( true ( cell 7 3 1 red ) ),( true ( cell 8 4 1 red ) ),( true ( cell 8 3 1 red ) ),( true ( cell 4 5 1 red ) ),( true ( cell 4 6 1 black ) ),( true ( cell 7 6 1 red ) ),( true ( cell 1 3 1 red ) ),( true ( cell 1 1 1 black ) ),( true ( cell 8 1 1 red ) ),( true ( cell 5 2 1 red ) ),( true ( cell 2 2 1 red ) ),( true ( cell 5 4 1 black ) ),( true ( cell 2 4 1 red ) ),( true ( cell 1 5 1 black ) ),( true ( cell 1 4 1 black ) ),( true ( cell 5 4 1 red ) ),( true ( cell 3 6 1 black ) ),( true ( cell 1 3 1 black ) ),( true ( cell 2 5 1 red ) ),( true ( cell 3 5 1 red ) ),( true ( cell 6 1 1 black ) ),( true ( cell 5 5 1 red ) ),( true ( cell 6 5 1 black ) ),( true ( cell 2 2 1 black ) ),( true ( cell 5 6 1 black ) ),( true ( cell 4 4 1 black ) ),( true ( cell 4 4 1 red ) ),( true ( cell 3 6 1 red ) ),( true ( cell 4 2 1 black ) ),( true ( cell 1 2 1 red ) ),( true ( cell 6 1 1 red ) ),( true ( cell 3 4 1 red ) ),( true ( cell 1 6 1 black ) ),( true ( cell 2 6 1 black ) ),( true ( cell 4 3 1 red ) ),( true ( cell 4 3 1 black ) ),( true ( cell 2 3 1 black ) ),( true ( cell 1 5 1 red ) ),( true ( cell 8 1 1 black ) ),( true ( cell 7 5 1 red ) ),( true ( cell 1 2 1 black ) ),( true ( cell 7 4 1 black ) ),( true ( cell 5 3 1 red ) ),( true ( cell 5 6 1 red ) ),( true ( cell 7 2 1 black ) ),( true ( cell 8 2 1 red ) ),( true ( cell 8 2 1 black ) ),( true ( cell 6 3 1 red ) ),( true ( cell 2 1 1 red ) ),( true ( cell 4 1 1 red ) ),( true ( cell 5 1 1 black ) ),( true ( cell 2 3 1 red ) ),( true ( cell 6 3 1 black ) ),( true ( cell 8 6 1 red ) ),( true ( cell 6 6 1 black ) ),( true ( cell 3 5 1 black ) ),( true ( cell 8 5 1 black ) ),( true ( cell 7 3 1 black ) ),( true ( cell 3 3 1 red ) ),( true ( cell 3 1 1 black ) ),( true ( cell 4 2 1 red ) ),( true ( cell 1 1 1 red ) ),( true ( cell 5 5 1 black ) ),( true ( cell 6 4 1 red ) ),( true ( cell 7 6 1 black ) ),( true ( cell 7 2 1 red ) ),( true ( cell 2 4 1 black ) ),( true ( cell 4 5 1 black ) ),( true ( cell 8 5 1 red ) ),( true ( cell 7 5 1 black ) ),( true ( cell 5 2 1 black ) ),( true ( cell 5 1 1 red ) ),( true ( cell 7 4 1 red ) ),( true ( cell 6 6 1 red ) ),( true ( cell 1 4 1 red ) ),( true ( cell 4 6 1 red ) ),( true ( cell 6 4 1 black ) ),( true ( cell 2 5 1 black ) ),( true ( cell 3 2 1 black ) ),( true ( cell 3 4 1 black ) ),( true ( cell 6 2 1 red ) ),( true ( cell 6 2 1 black ) ),( true ( cell 7 1 1 red ) ),( true ( cell 3 3 1 black ) ),( true ( cell 3 1 1 red ) ),( true ( cell 8 4 1 black ) ),( true ( cell 5 3 1 black ) ),( true ( cell 6 5 1 red ) ),( true ( cell 8 6 1 black ) )~( drop 2 1 ),( drop 6 1 ),( drop 5 1 ),( drop 4 1 ),( drop 3 1 ),( drop 7 1 ),( drop 2 1 ),( drop 6 1 ),( drop 4 1 ),( drop 5 1 ),( drop 1 1 ),( drop 1 1 ),( drop 3 1 ),( drop 8 1 ),( drop 8 1 ),( drop 7 1 )\r\n```\r\n\r\nAfter reloading, we only have 1 of each move in the `Set<ForwardDeadReckonLegalMoveInfo> mMoveInfos`.  That's not surprising.  If the `String` representation was the same (and it was) for two underlying `ForwardDeadReckonLegalMoveInfo`s then the deserialization code will pick the same one twice.  On insertion into the Set, the second insert attempt will be ignored.\r\n\r\nSo, the key problem is either that we have two (nearly) identical FDRLMIs or, more likely, the we can't differentiate them by their string representation.\r\n\r\nI wonder what the difference is?  Perhaps associated with the FDRLMI is not only the move itself but also which role the move belongs to?\r\n\r\nAssuming it's something along these lines then the fix is to create a more verbose `toString` method for FDRLMI (either by actually updating `toString` or, if that will affect other parts of the code, by creating a parallel method for use in serialization / deserialization).  And if the difference between the apparently identical moves is the role they're associated with then care will be required to ensure that the game still reloads correctly when we're playing the other role.  (So using role names instead of the role index might be necessary.  At the very least, we'd need to use the raw role index, not the mapped version that we use in most places.)"}}