110 likes | 361 Views
Debugging Knowledge Fusion(KF) Applications. Jeff Erno GE Global Research 6/5/2008. Overview. Small, Standalone Classes Visualization KF Navigator Print Statements Commenting Code Using KF Debugger Integrated Class Editor (ICE). Standalone Classes. Create small, reusable classes
E N D
Debugging Knowledge Fusion(KF) Applications Jeff Erno GE Global Research 6/5/2008
Overview • Small, Standalone Classes • Visualization • KF Navigator • Print Statements • Commenting Code • Using KF Debugger • Integrated Class Editor (ICE)
Standalone Classes • Create small, reusable classes Run & test stand-alone Integrate into a larger class when ready Easier to debug something small instead of something big
Visualization • Create geometry to visualize • Vector ug_line • Points ug_point (Point) location: ug_curve_askPointOnCurve( curve:, 0.5 ); (Child) location_ug_pt: { class; if Debug: then ug_point else nulldesign; Position; location: ; };
KF Navigator • KF stores instance data structure within part • Tree can be explored for debugging • Show Value on attributes before passing value as parameter to child rule • Missing classes • Child instances of NX objects can be selected for interactive operations Can reduce need for print statements Browse Dependencies…
Print Statements • Main Functions • ug_printValue(Any $value) • ug_printValues (List $value) • ug_printMessage • printValue • Print the refChain so you know which specific instance is printing • ug_printValue( refChain: ) Root:app1:geometry_builder: (Method Any) someMethod:() @{ if( Debug: ) then @{ ug_printValues( {“someMethod in “, refChain: } ); ug_printValue(“Input_value is “ + format(“%f”, input_value:) ); } else doNothing; . . . };
Commenting Code • Comment out failing Child rule(s) • Inspect parameters visually and with KF Navigator • Use on complex features (ug_curve_mesh, etc.) • Create features interactively to rule out code errors Block Comment #+ (Child) surface: { class; ug_curve_mesh; . . . }; #- NullDesign (Child) surface: { class; nulldesign; # ug_curve_mesh; . . . };
KF Debugger Far end of KF Toolbar • Class & Quantity Problems Use for debugging order of operation issues
KF Debugger • Update Sequence Displayed • Update should progress smoothly(no jumping) • If so Browse Dependencies on results • Class & Quantity • Features created before dialog
ICE: KF Integrated Class Editor • New development environment for developing KF Applications • Debug Error Problem Area
Conclusion • Code “stand alone” classes • Add visualization child rules to classes • Use KF Navigator to see what KF has created • Comment out and review created objects used as input • Use KF Debugger to diagnose Class/Quantity and Order problems • Try ICE for faster development and easier debugging