[[.:..:start|Powrót do samurai:start]] ====== Loan Processor ====== * {{.:lp-talk.pdf|Prezentation}} * {{.:lp-datalog.txt|Wersja w datalogu}} - 6 reguł * {{.:lp-graph.svg|}} * {{.:lp-prolog.pl|Wersja w Prologu (by KKR)}} ===== Model in CLIPS ===== * Model 1: {{.:lp-clips.clp|}} * Rules: 8 * Uwagi: * The datalog example uses backward chaining * The forward chaining version of the case must provide more data types of which facts are generated by rules in order to activate another rules. * It is necessary to set fact duplication to false (set-fact-duplication FALSE) in order to avoid rematching rules ''riskBrancher1'' and ''riskBrancher2'' ===== Model in Jess ===== * Model 1: {{.:lp-jess.clp|}} * Rules: 8 * Uwagi: * Jess does not allow for using '(range)' construct within ''slot'' definition - the domain of slots can be set by using ''(allowed-values)''. However listing of all values from range e.g. [18, 120] is inefficient. * Jess does not allow for fact duplication - such behavior is necessary for this model. ===== Model in Drools ===== * Model 1: {{.:lp-drools.drl|}} * Rules: 9 (including initial rules that asserts facts) * Uwagi: * Drools allows for fact duplication default. Thus rules ''riskBrancher1'' and ''riskBrancher2'' requires additional condition that checks if a given ''Rating/MatchingAssessor'' already exists: rule "riskBrancher1" when RiskBrancher($clientname : Client, $risklevel : RiskLevel) LoanRequest(Client == $clientname, $amountask : AmountAsk, AmountAsk < $risklevel) not(MatchingAssessor(Client == $clientname, AmountAsk == $amountask)) then insert(new MatchingAssessor($clientname, $amountask)); //System.out.println("For client " + $clientname + ": The asked amount is less than risk level: asked = " + $amountask + ", risk = " + $risklevel); end rule "riskBrancher2" when RiskBrancher($clientname : Client, $risklevel : RiskLevel, $ratingmin : RatingMin) LoanRequest(Client == $clientname, $amountask : AmountAsk, AmountAsk >= $risklevel) not(RatingAssessor(Client == $clientname, AmountAsk == $amountask, RatingMin == $ratingmin)) then insert(new RatingAssessor($clientname, $amountask, $ratingmin)); //System.out.println("For client " + $clientname + ": The asked amount is greater or equal than/to risk level: asked = " + $amountask + ", risk = " + $risklevel); end ===== Model in XTT2 ===== * Model 1: {{.:lp-xtt.hml|}} {{.:lp-hmr.pl|}} * Rules: 9 * Uwagi: