solverthread.java

来自「SHOP2 一个人工智能里面关于任务分解和任务规划的系统。JSHOP2是其jav」· Java 代码 · 共 62 行

JAVA
62
字号
package JSHOP2;import java.util.LinkedList;/** The thread that invokes JSHOP2 to solve a planning problem. The only reason *  to have another thread to solve problems rather than using the main thread *  to do so is that, in some platforms, the command line parameters that are *  supposed to change the stack size work only for the threads other than the *  main thread. * *  @author Okhtay Ilghami *  @author <a href="http://www.cs.umd.edu/~okhtay">http://www.cs.umd.edu/~okhtay</a> *  @version 1.0.3*/public class SolverThread extends Thread{  /** The maximum number of plans allowed.  */  private int planNo;  /** The list of plans to be returned.  */  private LinkedList<Plan> plans;  /** The task list to be achieved.  */  private TaskList tl;  /** To initialize this thread.   *   *  @param tlIn   *          the task list to be achieved by this thread.   *  @param planNoIn   *          the maximum number of plans allowed.  */  public SolverThread(TaskList tlIn, int planNoIn)  {    tl = tlIn;    planNo = planNoIn;  }  /** To return the plans found by this thread. This function should be called   *  only after the thread has died.   *   *  @return   *          A <code>LinkedList</code> of plans found by this thread.  */  public LinkedList<Plan> getPlans()  {    return plans;  }  /** The function that is called when this thread is invoked.  */  public void run()  {    //-- Solve the planning problem.    plans = JSHOP2.findPlans(tl, planNo);  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?