1 package cz.cuni.amis.pogamut.base.agent.navigation; 2 3 /** 4 * First - read javadoc for {@link IPathPlanner} and {@link IPathExecutor}. 5 * <p><p> 6 * Done? Ok, continue... 7 * <p><p> 8 * So, the {@link IPathPlanner} should get us the path and {@link IPathExecutor} should follow it. 9 * This is nice isn't it? It allows you to configure different path planners (for instance one for 10 * planning retreat paths, other one planning attack paths) and you may use a single executor 11 * or instantiate different one and pick one that suits your needs. Ok, nice, but such scenario 12 * requires you to mediate communication bqetween planner and executor and handle executor failures. 13 * Sometimes it might be nice to have executor stuffed with planner that it can use to replan the 14 * path in the case of failures. Voila - this interface pops out. 15 * <p><p> 16 * This interface serves for executors that contains planners they can use in the case of path failure. 17 * Whenever the executor fails to reach the path, it should use the injected path planner 18 * (via {@link IPathExecutorWithPlanner#setPathPlanner(IPathPlanner)}) to obtain the new path and try that. 19 * <p><p> 20 * EXPERIMENTAL INTERFACE - might be revisited in future releases (I'm aware that the interface 21 * is faulty due to ignore other path-planning/execution concerns such as "how to determine that 22 * the executre really really stuck"). 23 * <p><p> 24 * Note that implementation of this interface will the most likely be so specific, that it is 25 * always a good idea to setup own timeout counter and halt the path executor manually if 26 * the counter reaches zero. I mean, it probably won't be a flawless implementation that 27 * can solve all encountered situations. (Or just use {@link IPathExecutorWithPlanner#runTo(Object, double)}.) 28 * 29 * @author Jimmy 30 * 31 * @param <PATH_ELEMENT> 32 */ 33 public interface IPathExecutorWithPlanner<PATH_ELEMENT> extends IPathExecutor<PATH_ELEMENT> { 34 35 public void runTo(PATH_ELEMENT to); 36 37 public void runTo(PATH_ELEMENT to, double globalTimeout); 38 39 public void setPathPlanner(IPathPlanner<PATH_ELEMENT> pathPlanner); 40 41 }