/** /** * Sets boundary walls of a domain. This method will add 4 solid walls (top left bottom right) to create * a playing field in which the agents can interact. * @param s the state in which the walls should be added * @param w the width of the playing field * @param h the height of the playing field */ public static void setBoundaryWalls(GenericOOState s, int w, int h){ int numV = s.objectsOfClass(CLASS_DIM_V_WALL).size(); int numH = s.objectsOfClass(CLASS_DIM_H_WALL).size(); s.addObject(new GGWall.GGVerticalWall(0, h-1, 0, 0, "h"+numH)) .addObject(new GGWall.GGVerticalWall(0, h-1, w, 0, "h"+(numH+1))) .addObject(new GGWall.GGHorizontalWall(0, w-1, 0, 0, "v"+numV)) .addObject(new GGWall.GGHorizontalWall(0, w-1, h, 0, "v"+(numV+1)) ); }
@Override public GGHorizontalWall copyWithName(String objectName) { return new GGHorizontalWall(e1, e2, pos, type, objectName); }
public static State getTurkeyInitialState(){ GenericOOState s = new GenericOOState( new GGAgent(0, 0, 0, "agent0"), new GGAgent(2, 0, 1, "agent1"), new GGGoal(0, 3, 1, "g0"), new GGGoal(1, 2, 0, "g1"), new GGGoal(2, 3, 2, "g2"), new GGWall.GGHorizontalWall(0, 0, 1, 1, "w0"), new GGWall.GGHorizontalWall(2, 2, 1, 1, "w1") ); setBoundaryWalls(s, 3, 4); return s; }
@Override public GGHorizontalWall copy() { return new GGHorizontalWall(e1, e2, pos, type, name); } }