/************************************************************************\ |* gtf is a framework for analyzing two-player zero-sum games *| |* Copyright (C) 2005 Troels Bjerre Sorensen *| |* *| |* This program is free software; you can redistribute it and/or modify *| |* it under the terms of the GNU General Public License as published by *| |* the Free Software Foundation; either version 2 of the License, or *| |* (at your option) any later version. *| |* *| |* This program is distributed in the hope that it will be useful, but *| |* WITHOUT ANY WARRANTY; without even the implied warranty of *| |* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *| |* General Public License for more details. *| |* *| |* You should have received a copy of the GNU General Public License *| |* along with this program; if not, write to the *| |* Free Software Foundation, Inc., 59 Temple Place - Suite 330, *| |* Boston, MA 02111-1307, USA. *| \************************************************************************/ package gtf.examples; import gtf.game.*; public class KollerMegiddoStengel extends ExtensiveForm { public GameTree generateTree() { return new RandomNode() .addChild("a", 1, new PlayerNode(1) .addChild("l", new GameLeaf(5)) .addChild("r", new PlayerNode(2) .addChild("", "p", new PlayerNode(1) .addChild("L", new GameLeaf(10)) .addChild("R", new GameLeaf(15))) .addChild("", "q", new PlayerNode(1) .addChild("L", new GameLeaf(20)) .addChild("R", new GameLeaf(-5))))) .addChild("b", 1, new PlayerNode(1) .addChild("c", new GameLeaf(10)) .addChild("d", new GameLeaf(20))) .addChild("b", 1, new PlayerNode(1) .addChild("c", "", new PlayerNode(2) .addChild("s", new GameLeaf(20)) .addChild("t", new GameLeaf(50))) .addChild("d", "", new PlayerNode(2) .addChild("s", new GameLeaf(30)) .addChild("t", new GameLeaf(15)))) .addChild("c", 2, new GameLeaf(5)); } }