| java.lang.Object org.mandarax.util.LogicFactorySupport org.mandarax.examples.crm.DiscountCalculator
DiscountCalculator | public class DiscountCalculator extends LogicFactorySupport (Code) | | The rule based disount calculator. Internally, the discount is calculated by issuing a query
to the inference engine. This class encapsulates the inference engine and most of
the mandarax logic, in a EJB context this would be a classic session bean.
author: Jens Dietrich version: 3.4 <7 March 05> since: 1.2 |
DiscountCalculator | public DiscountCalculator()(Code) | | Constructor.
|
calculateDiscount | public void calculateDiscount(Customer c, KnowledgeBase kb)(Code) | | Calculate the discount for a customer c using the knowledge base kb.
Parameters: c - the customer Parameters: kb - the knowledge base |
getDerivation | public Derivation getDerivation()(Code) | | Get the derivation used to calculate the result
the derivation used to calculate the discount |
getDiscount | public Discount getDiscount()(Code) | | Get the calculated discount
the calculated discount |
reset | public void reset()(Code) | | Reset the calculator. Should be used between queries if the same instance is used
for multiple queries.
|
Methods inherited from org.mandarax.util.LogicFactorySupport | public ConstantTerm cons(Object obj, Class type)(Code)(Java Doc) public ComplexTerm cplx(Function function, Object[] objs)(Code)(Java Doc) public ComplexTerm cplx(Function function, Object obj1)(Code)(Java Doc) public ComplexTerm cplx(Function function, Object obj1, Object obj2)(Code)(Java Doc) public ComplexTerm cplx(Function function, Object obj1, Object obj2, Object obj3)(Code)(Java Doc) public ComplexTerm cplx(Function function, Object obj1, Object obj2, Object obj3, Object obj4)(Code)(Java Doc) public Prerequisite cut()(Code)(Java Doc) public Fact fact(Predicate predicate, Object[] objs)(Code)(Java Doc) public Fact fact(Predicate predicate, Object obj)(Code)(Java Doc) public Fact fact(Predicate predicate, Object obj1, Object obj2)(Code)(Java Doc) public Fact fact(Predicate predicate, Object obj1, Object obj2, Object obj3)(Code)(Java Doc) public Fact fact(Predicate predicate, Object obj1, Object obj2, Object obj3, Object obj4)(Code)(Java Doc) public Prerequisite fact2prereq(Fact fact)(Code)(Java Doc) public Rule orRule(Fact prerequisite1, Fact prerequisite2, Fact conclusion)(Code)(Java Doc) public Rule orRule(Fact prerequisite1, Fact prerequisite2, Fact prerequisite3, Fact conclusion)(Code)(Java Doc) public Rule orRule(Fact prerequisite1, Fact prerequisite2, Fact prerequisite3, Fact prerequisite4, Fact conclusion)(Code)(Java Doc) public Rule orRule(Prerequisite prerequisite1, Prerequisite prerequisite2, Fact conclusion)(Code)(Java Doc) public Rule orRule(Prerequisite prerequisite1, Prerequisite prerequisite2, Prerequisite prerequisite3, Fact conclusion)(Code)(Java Doc) public Rule orRule(Prerequisite prerequisite1, Prerequisite prerequisite2, Prerequisite prerequisite3, Prerequisite prerequisite4, Fact conclusion)(Code)(Java Doc) public Prerequisite prereq(Predicate predicate, Object[] objs)(Code)(Java Doc) public Prerequisite prereq(Predicate predicate, Object obj)(Code)(Java Doc) public Prerequisite prereq(Predicate predicate, Object obj1, Object obj2)(Code)(Java Doc) public Prerequisite prereq(Predicate predicate, Object obj1, Object obj2, Object obj3)(Code)(Java Doc) public Prerequisite prereq(Predicate predicate, Object obj1, Object obj2, Object obj3, Object obj4)(Code)(Java Doc) public Prerequisite prereq(Predicate predicate, Object[] objs, boolean negatedAF)(Code)(Java Doc) public Prerequisite prereq(Predicate predicate, Object obj, boolean negatedAF)(Code)(Java Doc) public Prerequisite prereq(Predicate predicate, Object obj1, Object obj2, boolean negatedAF)(Code)(Java Doc) public Prerequisite prereq(Predicate predicate, Object obj1, Object obj2, Object obj3, boolean negatedAF)(Code)(Java Doc) public Prerequisite prereq(Predicate predicate, Object obj1, Object obj2, Object obj3, Object obj4, boolean negatedAF)(Code)(Java Doc) public Query query(Fact fact, String name)(Code)(Java Doc) public Query query(Fact fact1, Fact fact2, String name)(Code)(Java Doc) public Query query(Fact fact1, Fact fact2, Fact fact3, String name)(Code)(Java Doc) public Query query(Fact[] facts, String name)(Code)(Java Doc) public Rule rule(List body, Fact conclusion)(Code)(Java Doc) public Rule rule(Fact conclusion)(Code)(Java Doc) public Rule rule(Fact prerequisite, Fact conclusion)(Code)(Java Doc) public Rule rule(Fact prerequisite1, Fact prerequisite2, Fact conclusion)(Code)(Java Doc) public Rule rule(Fact prerequisite1, Fact prerequisite2, Fact prerequisite3, Fact conclusion)(Code)(Java Doc) public Rule rule(Fact prerequisite1, Fact prerequisite2, Fact prerequisite3, Fact prerequisite4, Fact conclusion)(Code)(Java Doc) public Rule rule(Prerequisite prerequisite, Fact conclusion)(Code)(Java Doc) public Rule rule(Prerequisite prerequisite1, Prerequisite prerequisite2, Fact conclusion)(Code)(Java Doc) public Rule rule(Prerequisite prerequisite1, Prerequisite prerequisite2, Prerequisite prerequisite3, Fact conclusion)(Code)(Java Doc) public Rule rule(Prerequisite prerequisite1, Prerequisite prerequisite2, Prerequisite prerequisite3, Prerequisite prerequisite4, Fact conclusion)(Code)(Java Doc) public Term variable(String name, Class clazz)(Code)(Java Doc) public Term variable(String name)(Code)(Java Doc)
|
|
|