[rules-users] PMML - Exception excuting consequence for rule xxx in yyy: java.lang.NullPointerException : using KnowledgeAgent

smilk sunghee.bae at meritz.co.kr
Wed Jul 17 20:57:06 EDT 2013


rule "Eval Tree Node RPart_Model - 12 - Down"
salience $children.size() - $children.indexOf( $child )

when
    $node : TreeNode( context == "RPart_Model", $id : id == "12", $children
: children, children.size > 0 )
    $tok  : RPart_ModelTreeToken( context == "RPart_Model", current == "12",
$trail : trail,
                                 ( ( mCOV_CD_RE == false && vCOV_CD_RE in (
"group0" ) ) || ( ( mAC_COT_DAY == true  ) && ( ( mAC_COT_DAY == false &&
vAC_COT_DAY < 275.5 ) || ( ( mFDS_AC_YN == true  ) && ( ( mFDS_AC_YN ==
false && vFDS_AC_YN in ( "1" ) ) || ( ( mAGE_GRD == true  ) && ( ( mAGE_GRD
== false && vAGE_GRD in ( "20대" ) ) ) ) ) ) ) ) ) || ( visitMode ==
"AGGREGATE_NODES" && ( ( ( mCOV_CD_RE == true  ) ) || ( ( mFDS_AC_YN == true 
) ) || ( ( mAGE_GRD == true  ) ) || ( ( mAC_COT_DAY == true  ) ) ) ) )
    $child : String( this not memberOf $trail ) from $children
then
    System.out.println( "Visiting node 12, going down to " + $child );
    modify ( $tok ) {
        getTrail().add( $child ),
        setDownward( true ),
        setCurrent( $child );
    }
end


rule "Eval Tree Node RPart_Model - 12 - True"
salience 3
no-loop
when
    $node : TreeNode( context == "RPart_Model", $id : id == "12", $out :
outcome,
                      children.size == 0, $conf : confidence, $tot :
recordCount )
    $tok  : RPart_ModelTreeToken( context == "RPart_Model", current == "12",
$baseConf : confidence,
                                 $res : results, results.keySet not contains
"12",
                                 visitMode != "AGGREGATE_NODES",
                                 ( mCOV_CD_RE == false && vCOV_CD_RE in (
"group0" ) ) || ( ( mAC_COT_DAY == true  ) && ( ( mAC_COT_DAY == false &&
vAC_COT_DAY < 275.5 ) || ( ( mFDS_AC_YN == true  ) && ( ( mFDS_AC_YN ==
false && vFDS_AC_YN in ( "1" ) ) || ( ( mAGE_GRD == true  ) && ( ( mAGE_GRD
== false && vAGE_GRD in ( "20대" ) ) ) ) ) ) ) )
                               )
then
    System.out.println( "TRUE Solution found at 12 !!!! " );
    modify( $tok ) {
       setConfidence( $baseConf * ( $conf.containsKey( $out ) ? (Double)
$conf.get( $out ) : 1.0 ) ),
       setTotalCount( $tot ),
       setOutcome( $out ),
       setCurrent( "null" );
    }
end


rule "Eval Tree Node RPart_Model - 12 - Unknown Weighted"
salience 3
when
    $node : TreeNode( context == "RPart_Model", $id : id == "12", $out :
outcome )
    $tok  : RPart_ModelTreeToken( context == "RPart_Model", current == "12",
                                 visitMode == "WEIGHTED_CONFIDENCE" || ==
"LAST_PREDICTION" || == "NULL_PREDICTION",
                                 results.keySet not contains "12",
                                 ( ( mCOV_CD_RE == true  ) ) || ( (
mFDS_AC_YN == true  ) ) || ( ( mAGE_GRD == true  ) ) || ( ( mAC_COT_DAY ==
true  ) ) )
then
    System.out.println( "UNKNOWN found at 12, collecting for later
evaluation !!!! " );
    modify ( $tok ) { getResults().put( "12", $out ); }
end


rule "Eval Tree Node RPart_Model - 12 - Default Child"
salience 3
when
    $node : TreeNode( context == "RPart_Model", $id : id == "12", $def :
defaultChld != "null" && != null )
    $tok  : RPart_ModelTreeToken( context == "RPart_Model", current == "12",
visitMode == "DEFAULT_CHILD", downward == true,
                                 results.keySet not contains "12", $conf :
confidence,
                                 ( ( mCOV_CD_RE == true  ) ) || ( (
mFDS_AC_YN == true  ) ) || ( ( mAGE_GRD == true  ) ) || ( ( mAC_COT_DAY ==
true  ) ) )
then
    System.out.println( "UNKNOWN found at 12 !!!!, JUMPING TO Default Child
" + $def );
    modify ( $tok ) {
        setConfidence( $conf * 1.0 ),
        setCurrent( $def );
    }
end


rule "Eval Tree Node RPart_Model - 12 - Default Child Undo Jump"
salience 5
no-loop
when
    $node : TreeNode( context == "RPart_Model", $id : id == "12", $def :
defaultChld != "null" && != null )
    $tok  : RPart_ModelTreeToken( context == "RPart_Model", current == "12",
visitMode == "DEFAULT_CHILD", downward == false, $conf : confidence,
                                 ( ( mCOV_CD_RE == true  ) ) || ( (
mFDS_AC_YN == true  ) ) || ( ( mAGE_GRD == true  ) ) || ( ( mAC_COT_DAY ==
true  ) ) )
then
    System.out.println( "UNKNOWN found at 12 !!!!, UNDOING JUMP penalty " +
$def );
    modify ( $tok ) {
        setConfidence( $conf / 1.0 );
    }
end


rule "Eval Tree Node RPart_Model - 25 - Down"
salience $children.size() - $children.indexOf( $child )

when
    $node : TreeNode( context == "RPart_Model", $id : id == "25", $children
: children, children.size > 0 )
    $tok  : RPart_ModelTreeToken( context == "RPart_Model", current == "25",
$trail : trail,
                                 ( ( mAC_STAT_CD_RE == false &&
vAC_STAT_CD_RE in ( "group1", "group2" ) ) ) || ( visitMode ==
"AGGREGATE_NODES" && ( ( mAC_STAT_CD_RE == true  ) ) ) )
    $child : String( this not memberOf $trail ) from $children
then
    System.out.println( "Visiting node 25, going down to " + $child );
    modify ( $tok ) {
        getTrail().add( $child ),
        setDownward( true ),
        setCurrent( $child );
    }
end


rule "Eval Tree Node RPart_Model - 25 - True"
salience 3
no-loop
when
    $node : TreeNode( context == "RPart_Model", $id : id == "25", $out :
outcome,
                      children.size == 0, $conf : confidence, $tot :
recordCount )
    $tok  : RPart_ModelTreeToken( context == "RPart_Model", current == "25",
$baseConf : confidence,
                                 $res : results, results.keySet not contains
"25",
                                 visitMode != "AGGREGATE_NODES",
                                 ( mAC_STAT_CD_RE == false && vAC_STAT_CD_RE
in ( "group1", "group2" ) )
                               )
then
    System.out.println( "TRUE Solution found at 25 !!!! " );
    modify( $tok ) {
       setConfidence( $baseConf * ( $conf.containsKey( $out ) ? (Double)
$conf.get( $out ) : 1.0 ) ),
       setTotalCount( $tot ),
       setOutcome( $out ),
       setCurrent( "null" );
    }
end


rule "Eval Tree Node RPart_Model - 25 - Unknown Weighted"
salience 3
when
    $node : TreeNode( context == "RPart_Model", $id : id == "25", $out :
outcome )
    $tok  : RPart_ModelTreeToken( context == "RPart_Model", current == "25",
                                 visitMode == "WEIGHTED_CONFIDENCE" || ==
"LAST_PREDICTION" || == "NULL_PREDICTION",
                                 results.keySet not contains "25",
                                 ( mAC_STAT_CD_RE == true  ) )
then
    System.out.println( "UNKNOWN found at 25, collecting for later
evaluation !!!! " );
    modify ( $tok ) { getResults().put( "25", $out ); }
end



--
View this message in context: http://drools.46999.n3.nabble.com/PMML-Exception-excuting-consequence-for-rule-xxx-in-yyy-java-lang-NullPointerException-using-Knowledt-tp4024963p4025011.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list