domainelement.java
来自「SHOP2 一个人工智能里面关于任务分解和任务规划的系统。JSHOP2是其jav」· Java 代码 · 共 65 行
JAVA
65 行
package JSHOP2;/** This abstract class implements the basic common functionality of the all * possible elements (i.e., methods, operators, and axioms) of a domain at * run time. * * @author Okhtay Ilghami * @author <a href="http://www.cs.umd.edu/~okhtay">http://www.cs.umd.edu/~okhtay</a> * @version 1.0.3*/public abstract class DomainElement{ /** Every element has a head, which is a predicate. */ private Predicate head; /** To initialize the domain element. * * @param headIn * head of the domain element. */ public DomainElement(Predicate headIn) { head = headIn; } /** This function returns the head of this domain element. * * @return * the head of this element, which is a predicate. */ public Predicate getHead() { return head; } /** This abstract function returns a handle that can be used to calculate, * one by one, the bindings that satisfy the precondition of this domain * element in a given state of the world with respect to a given binding. * * @param binding * current binding. * @param which * which precondition to use (ignored if this element is an * operator, since operators have only one precondition). * @return * an object of type Precondition which can be used later on to get * the bindings one by one. */ public abstract Precondition getIterator(Term[] binding, int which); /** This function returns the substitution that unifies the head of this * element with a given predicate. * * @param p * input predicate * @return * an array that shows with what each variable should be substituted. */ public Term[] unify(Predicate p) { return head.findUnifier(p.getParam()); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?