01: package org.osbl.agent.model;
02:
03: /**
04: * Condition are the first of the two important key aspects of a Rule.
05: *
06: * When a Rule is run, all Conditions are evaluated in turn to test the applicability
07: * of the Rule.
08: *
09: * For that purpose, implementing classes should return true or false in {@link #evaluate evaluate}
10: * according to its class definition and purpose.
11: *
12: * If the Conditions are all met, only then the Actions are executed.
13: *
14: * @see Rule
15: * @see Action
16: * @author Sebastian Nozzi.
17: */
18: public interface Condition {
19:
20: /**
21: * Implementing classes can perform an evaluation of some conditional potentially
22: * taking information from context into account.
23: *
24: * @param context the RuleContext, in which, among other things, implementing
25: * classes can find the target instance.
26: *
27: * @return true, if the evaluation is to be taken as successfull.
28: */
29: public boolean evaluate(RuleContext context);
30:
31: /**
32: * Equals.
33: *
34: * @param anotherCondition the another condition
35: *
36: * @return true, if successful
37: */
38: public boolean equals(Object anotherCondition);
39:
40: }
|