aima.core.agent.impl.aprog.simplerule.NOTCondition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aima-core Show documentation
Show all versions of aima-core Show documentation
AIMA-Java Core Algorithms from the book Artificial Intelligence a Modern Approach 3rd Ed.
The newest version!
package aima.core.agent.impl.aprog.simplerule;
import aima.core.agent.impl.ObjectWithDynamicAttributes;
/**
* Implementation of a NOT condition.
*
* @author Ciaran O'Reilly
*
*/
public class NOTCondition extends Condition {
private Condition con;
public NOTCondition(Condition con) {
assert (null != con);
this.con = con;
}
@Override
public boolean evaluate(ObjectWithDynamicAttributes p) {
return (!con.evaluate(p));
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
return sb.append("![").append(con).append("]").toString();
}
}