Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

xpRuleGeneric Class Reference

The base class for the rules of the expert system. More...

#include <XPRULE.H>

Inheritance diagram for xpRuleGeneric:

Inheritance graph
[legend]
Collaboration diagram for xpRuleGeneric:

Collaboration graph
[legend]

Public Member Functions

 xpRuleGeneric (xpAgent *MyAgent=NULL)
 xpRuleGeneric (const xpRuleGeneric &xr)
virtual void AddStringToHistory (wxString H="")
virtual void CalculateValue (void)
virtual xpRuleGeneric Fire (void)
virtual wxString GetHistoryString (void) const
virtual wxString GetName (void) const
virtual wxString GetReasoning (void)
virtual wxString GetValueString (void)
virtual wxString GetValueString (const xbool V) const
xpRuleGenericoperator= (xboolean &xb)
xpRuleGenericoperator= (const xpRuleGeneric &xb)
xpRuleGeneric operator! (void)

Static Public Member Functions

bool GetShortcutMode (void)
void SetShortcutMode (bool M)

Protected Attributes

wxString HistoryString
xpAgentAgent
wxString Name

Friends

xpRuleGeneric operator && (const xpRuleGeneric &xrL, const xpRuleGeneric &xrR)
xpRuleGeneric operator|| (const xpRuleGeneric &xrL, const xpRuleGeneric &xrR)

Detailed Description

The base class for the rules of the expert system.

The logical functionality of the generic rule class is identical with that of the xboolean class, inherited from it. In addition, it does make reasoning and does evaluate rules. This class implements also the generic inference engine functionality.


Constructor & Destructor Documentation

xpRuleGeneric::xpRuleGeneric xpAgent MyAgent = NULL  )  [inline]
 

The default constructor. Save the source of information in xpRuleGeneric::Agent.

Parameters:
MyAgent : the agent the rule can use

xpRuleGeneric::xpRuleGeneric const xpRuleGeneric xr  )  [inline]
 

Copy constructor. Copies strings and info source from xr.


Member Function Documentation

virtual void xpRuleGeneric::AddStringToHistory wxString  H = ""  )  [inline, virtual]
 

Contribute to history string. Use parameter H if not empty, otherwise the default is "Name" plus "HistoryString".

Parameters:
H : string to add to history

virtual void xpRuleGeneric::CalculateValue void   )  [inline, virtual]
 

Calculate xpRuleGeneric::value anew via calling Fire(). Stores new value and updates history string.

See also:
Fire

Reimplemented from xboolean.

virtual xpRuleGeneric xpRuleGeneric::Fire void   )  [inline, virtual]
 

Evaluates the rule (the logical expression, comprising rules). Called by CalculateValue().

Returns:
the rule's logical expression, comprising rules
See also:
CalculateValue

Reimplemented in xrIsCarbonXPresent, xrIsCarbonAugerPresent, xrIsRutheniumPresent, xrHasCarbon1sPeak, xrIsCarbon1sPeak, xrDoesSampleContainCarbon, xrDoMarkCarbon1s, xrIsCarbonEnergySeparationOK, xrIsCarbonShirleyTailHigh, xrIsCarbonPostPeakSlopeBiggest, xrIsCarbonAngleRatioBiggest, xrIsCarbonContaminationConsensus, xrIsEnergyBE, xrIsEnergyKE, xrIsXEnergyKnown, xrIsEnergyAvailBE, xrIsEnergyAvailKE, xrIsRegionMeasuredBE, xrIsRegionMeasuredKE, xrIsPeakInRangeBE, xrIsPeakInRangeKE, xrHasPeakInRangeBE, and xrHasPeakInRangeKE.

virtual wxString xpRuleGeneric::GetHistoryString void   )  const [inline, virtual]
 

Return the history corresponding to the current value.

Returns:
the execution history string of the rule

virtual wxString xpRuleGeneric::GetName void   )  const [inline, virtual]
 

Return the name of the rule.

Returns:
the string name of the rule

virtual wxString xpRuleGeneric::GetReasoning void   )  [inline, virtual]
 

Return the rule history in reasoning form. Calls CalculateValue() to make a fresh copy of the value.

Returns:
the reasoning corresponding to the actual value of the rule

bool xpRuleGeneric::GetShortcutMode void   )  [inline, static]
 

Return the evaluation mode: true if 'shortcut' else false

Returns:
true if shortcut mode enabled, false for complete mode

virtual wxString xpRuleGeneric::GetValueString const xbool  V  )  const [inline, virtual]
 

Return the parameter value V in string form.

Parameters:
V: The value to return, or rule's own if empty
Returns:
the value V in string form

virtual wxString xpRuleGeneric::GetValueString void   )  [inline, virtual]
 

Get and return the rule's value in string form

Returns:
the rule's value in string form

Reimplemented from xboolean.

xpRuleGeneric xpRuleGeneric::operator! void   )  [inline]
 

! (negation) operator.Also handles (default) reasoning.

Returns:
result of logical negation for the generic rule

Reimplemented from xboolean.

xpRuleGeneric& xpRuleGeneric::operator= const xpRuleGeneric xb  )  [inline]
 

= (assign) operator

Parameters:
xb : the assigning rule
Returns:
the generic rule, set by the another rule

xpRuleGeneric& xpRuleGeneric::operator= xboolean xb  )  [inline]
 

= (assign) operator

Parameters:
xb : the assigning xboolean
Returns:
the generic rule, set by xboolean

void xpRuleGeneric::SetShortcutMode bool  M  )  [inline, static]
 

Sets the evaluation mode to 'shortcut' or 'complete'

Parameters:
M : if shortcut mode enabled


Friends And Related Function Documentation

xpRuleGeneric operator && const xpRuleGeneric xrL,
const xpRuleGeneric xrR
[friend]
 

&& (logical AND) operator. Also handles (default) reasoning.

Parameters:
xrL the left parameter
xrR the right parameter
Returns:
result of AND for the generic rule

xpRuleGeneric operator|| const xpRuleGeneric xrL,
const xpRuleGeneric xrR
[friend]
 

|| (logical OR) operator. Also handles (default) reasoning.

Parameters:
xrL the left parameter
xrR the right parameter
Returns:
result of OR for the generic rule


Field Documentation

xpAgent* xpRuleGeneric::Agent [protected]
 

Back pointer to the agent.

wxString xpRuleGeneric::HistoryString [protected]
 

The stored execution history string.

wxString xpRuleGeneric::Name [protected]
 

The rule identifying string.


The documentation for this class was generated from the following file:
Generated on Tue Dec 23 10:24:42 2003 for xps4xps by doxygen 1.3.5