View Javadoc

1   package cz.cuni.amis.pogamut.ut2004.agent.navigation;
2   
3   import cz.cuni.amis.pogamut.base.agent.navigation.IStuckDetector;
4   import cz.cuni.amis.pogamut.base.agent.navigation.PathExecutorState;
5   import cz.cuni.amis.pogamut.base.agent.navigation.impl.BasePathExecutorState;
6   import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.NavPointNeighbourLink;
7   
8   /**
9    * This class is broadcast by {@link UT2004PathExecutor} whenever it gets stuck. It contains detail information about whereabouts of the stuck.
10   * 
11   * @author Jimmy
12   *
13   */
14  public class UT2004PathExecutorStuckState extends BasePathExecutorState {
15  
16  	private boolean globalTimeout = false;
17  	private IStuckDetector stuckDetector = null;
18  	private NavPointNeighbourLink link = null;
19  	
20  	public UT2004PathExecutorStuckState() {
21  		super(PathExecutorState.STUCK);
22  	}
23  
24  	/**
25  	 * Whether it was GLOBAL timeout (imposed by {@link UT2004PathExecutor}) == true, or it was detected by {@link #getStuckDetector()} == false.
26  	 * @return
27  	 */
28  	public boolean isGlobalTimeout() {
29  		return globalTimeout;
30  	}
31  
32  	protected void setGlobalTimeout(boolean globalTimeout) {
33  		this.globalTimeout = globalTimeout;
34  	}
35  
36  	/**
37  	 * If not NULL, contains {@link IStuckDetector} that has reported the stuck ~ why we have stopped the execution.
38  	 * @return
39  	 */
40  	public IStuckDetector getStuckDetector() {
41  		return stuckDetector;
42  	}
43  
44  	protected void setStuckDetector(IStuckDetector stuckDetector) {
45  		this.stuckDetector = stuckDetector;
46  	}
47  
48  	/**
49  	 * If available contains {@link NavPointNeighbourLink} we have failed to traverse.
50  	 * @return
51  	 */
52  	public NavPointNeighbourLink getLink() {
53  		return link;
54  	}
55  
56  	protected void setLink(NavPointNeighbourLink link) {
57  		this.link = link;
58  	}
59  
60  	
61  	
62  }