/** * Toggles whether debug information should be printed * @param printDebug whether to print debug logs or not */ public void toggleDebug(boolean printDebug){ this.printDebug = printDebug; DPrint.toggleCode(this.debugCode, this.printDebug); }
@Override public void toggleDebugPrinting(boolean toggle){ DPrint.toggleCode(debugCode, toggle); }
/** * Sets whether information during learning is printed to the terminal. Will automatically toggle the debug printing * for the underlying MLIRL that runs. * @param printDebug if true, information is printed to the terminal; if false then it is silent. */ public void toggleDebugPrinting(boolean printDebug){ DPrint.toggleCode(this.debugCode, printDebug); this.mlirlInstance.toggleDebugPrinting(printDebug); }
/** * Loads this RLGlue {@link org.rlcommunity.rlglue.codec.AgentInterface} into RLGlue and runs its event loop in a * separate thread. */ public void loadAgent(){ DPrint.toggleCode(debugCode, this.printDebug); final AgentLoader loader = new AgentLoader(this); Thread eventThread = new Thread(new Runnable() { @Override public void run() { loader.run(); } }); eventThread.start(); }
/** * Loads this RLGlue {@link org.rlcommunity.rlglue.codec.AgentInterface} into RLGlue using the specified host address and port * nd runs its event loop in a separate thread. * @param hostAddress the RLGlue host address. * @param portString the port on which to connect to RLGlue. */ public void loadAgent(String hostAddress, String portString){ DPrint.toggleCode(debugCode, this.printDebug); final AgentLoader loader = new AgentLoader(hostAddress, portString, this); Thread eventThread = new Thread(new Runnable() { @Override public void run() { loader.run(); } }); eventThread.start(); }
/** * Sets whether information during learning is printed to the terminal. Will automatically toggle the debug printing * for the underlying valueFunction as well. * @param printDebug if true, information is printed to the terminal; if false then it is silent. */ public void toggleDebugPrinting(boolean printDebug){ DPrint.toggleCode(this.debugCode, printDebug); this.request.getPlanner().toggleDebugPrinting(printDebug); }
DPrint.toggleCode(w.getDebugId(), false);
public static void main(String[] args) { GridGame gg = new GridGame(); OOSGDomain domain = gg.generateDomain(); State s = GridGame.getTurkeyInitialState(); JointRewardFunction jr = new GridGame.GGJointRewardFunction(domain); TerminalFunction tf = new GridGame.GGTerminalFunction(domain); World world = new World(domain, jr, tf, new ConstantStateGenerator(s)); DPrint.toggleCode(world.getDebugId(),false); SGAgent ragent1 = new RandomSGAgent(); SGAgent ragent2 = new RandomSGAgent(); SGAgentType type = new SGAgentType("agent", domain.getActionTypes()); world.join(ragent1); world.join(ragent2); GameEpisode ga = world.runGame(20); System.out.println(ga.maxTimeStep()); String serialized = ga.serialize(); System.out.println(serialized); GameEpisode read = GameEpisode.parse(serialized); System.out.println(read.maxTimeStep()); System.out.println(read.state(0).toString()); }
DPrint.toggleCode(w.getDebugId(), false);
DPrint.toggleCode(w.getDebugId(), false);
DPrint.toggleCode(w.getDebugId(), false); w.addWorldObserver(this.plotter); int id = 0;