我正在尝试从GAMUT java 库生成 Polymatrix Games。
try {
PolymatrixGame polyGame = new PolymatrixGame();
polyGame.setParameter("players", nbOfPlayers); //nbOfPlayers = 3L;
polyGame.setParameter("actions", nbOfActions); //nbOfActions is a Vector<String> with three entries: each equal "2".
polyGame.setParameter("graph", "RandomGraph");
polyGame.setParameter("graph_params", new ParamParser(new String[] {"-nodes", "" + nbOfPlayers, "-edges", "" + 3, "-sym_edges", "1", "-reflex_ok", "0"}));
polyGame.setParameter("subgame", "Chicken");
polyGame.setParameter("subgame_params", new ParamParser());
polyGame.initialize();
polyGame.doGenerate();
} catch (Exception e) {
e.printStackTrace();
}
我收到以下错误:
致命错误:无法生成多矩阵游戏(子游戏鸡)
java.lang.NullPointerException
我一直在挖掘源代码,但找不到错误的根源。错误消息本身也不是很有用。
最终,我试图生成一个随机的 Polymatrix 游戏,其中包含给定数量的玩家和给定数量的每个玩家的动作。