diff options
Diffstat (limited to 'docs/doxygen/nel/bool__operator_8cpp-source.html')
-rw-r--r-- | docs/doxygen/nel/bool__operator_8cpp-source.html | 349 |
1 files changed, 349 insertions, 0 deletions
diff --git a/docs/doxygen/nel/bool__operator_8cpp-source.html b/docs/doxygen/nel/bool__operator_8cpp-source.html new file mode 100644 index 00000000..676bf609 --- /dev/null +++ b/docs/doxygen/nel/bool__operator_8cpp-source.html @@ -0,0 +1,349 @@ +<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> +<HTML> +<HEAD> + <TITLE>nevrax.org : docs</TITLE> + <LINK REL=stylesheet TYPE="text/css" HREF="http://www.nevrax.org/inc/css/nevrax.css"> + <link href="doxygen.css" rel="stylesheet" type="text/css"> +</HEAD> +<BODY MARGINHEIGHT="0" MARGINWIDTH="0"> + +<!-- uplinks --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0> + <TR> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD WIDTH=140 BGCOLOR=#dddddd><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=http://www.nevrax.org><b>Home</B></FONT></A> </TD> + <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=http://www.nevrax.com><b>nevrax.com</B></FONT></A> </TD> + </TR> +</TABLE> + +<!-- banner Nevrax --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%> + <TR><TD BGCOLOR="#000000" BACKGROUND="http://www.nevrax.org/inc/img/black_banner.jpg"><A HREF="http://www.nevrax.org"><IMG SRC="http://www.nevrax.org/inc/img/nevrax.gif" WIDTH="170" HEIGHT="45" BORDER=0 ALT="Nevrax" ></A></TD></TR> +</TABLE> + +<!-- main table --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 height=100%> + <TR> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD> + <TD WIDTH=140 BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT=""> + + <!------ Begin Box ------> + <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=black><TR><TD><TABLE border=0 cellspacing=2 cellpadding=0 width=120><tr><TD ALIGN=middle bgcolor=black> + <FONT COLOR=white FACE="sans-serif"><B>Nevrax.org</B></FONT></TD></TR><tr><td colspan=2 bgcolor=#FFFFFF> + <TABLE cellspacing=0 cellpadding=1 border=0> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="Rubrique news"><img width=13 height=15 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-news.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="News">News</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Rubrique mail"><img width=15 height=11 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-mail.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Rubrique docs"><img width=14 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-docs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Documentation">Documentation</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="Rubrique cvs"><img width=13 height=17 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-cvs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="CVS Web">CVS</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Rubrique bugs"><img width=20 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-bugs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Bugtracking">Bugs</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="Rubrique license"><img width=18 height=12 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-gpl.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="License">License</a></td></tr> + </TABLE> + </TD></TR></TABLE></TD></TR></TABLE> + <!------ End Box ------> + + </TD> + <TD WIDTH=15><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD ALIGN=left valign=top><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT=""> + +<!-- title --> +<TABLE background="http://www.nevrax.org/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td> +<A HREF="http://www.nevrax.org/docs/"><img src="http://www.nevrax.org/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A> +</td><td><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT=""> +</td></tr></table> + + +<!-- block --> +<TABLE bgcolor="#dddddd" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td width=1% valign=middle><img width=6 height=14 hspace=2 vspace=2 src="http://www.nevrax.org/inc/img/reddots.gif"></TD> + <TD><B>Documentation</B></TD> + <TD ALIGN=RIGHT> </td> +</tr></table> +<!-- Generated by Doxygen 1.2.14 --> +<center> +<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> <a class="qindexRef" doxygen="_cgi:http://www.nevrax.org/cgi-bin/nel-search.cgi" href="http://www.nevrax.org/cgi-bin/nel-search.cgi">Search</a> </center> +<hr><h1>bool_operator.cpp</h1><a href="bool__operator_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">/* Copyright, 2000 Nevrax Ltd.</font> +00002 <font class="comment"> *</font> +00003 <font class="comment"> * This file is part of NEVRAX <MODULE_NAME>.</font> +00004 <font class="comment"> * NEVRAX <MODULE_NAME> is free software; you can redistribute it and/or modify</font> +00005 <font class="comment"> * it under the terms of the GNU General Public License as published by</font> +00006 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font> +00007 <font class="comment"> * any later version.</font> +00008 <font class="comment"></font> +00009 <font class="comment"> * NEVRAX <MODULE_NAME> is distributed in the hope that it will be useful, but</font> +00010 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font> +00011 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font> +00012 <font class="comment"> * General Public License for more details.</font> +00013 <font class="comment"></font> +00014 <font class="comment"> * You should have received a copy of the GNU General Public License</font> +00015 <font class="comment"> * along with NEVRAX <MODULE_NAME>; see the file COPYING. If not, write to the</font> +00016 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font> +00017 <font class="comment"> * MA 02111-1307, USA.</font> +00018 <font class="comment"> */</font> +00019 +00020 <font class="preprocessor">#include "<a class="code" href="bool__operator_8h.html">nel/ai/logic/bool_operator.h</a>"</font> +00021 <font class="preprocessor">#include "<a class="code" href="fact_8h.html">nel/ai/logic/fact.h</a>"</font> +00022 +00023 <font class="keyword">namespace </font>NLAILOGIC +00024 { +00025 <font class="keyword">using</font> <font class="keyword">namespace </font>NLAIAGENT; +00026 +<a name="l00027"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a0">00027</a> CBoolOperator::CBoolOperator() +00028 { +00029 } +00030 +<a name="l00031"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a1">00031</a> CBoolOperator::CBoolOperator(<font class="keywordtype">char</font> *c) : IBaseOperator(c) +00032 { +00033 } +00034 +<a name="l00035"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a2">00035</a> CBoolOperator::CBoolOperator(CBoolOperator &c) : IBaseOperator(c) +00036 { +00037 } +00038 +<a name="l00039"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a6">00039</a> <font class="keywordtype">bool</font> CBoolOperator::isTrue()<font class="keyword"> const </font> +00040 <font class="keyword"> </font>{ +00041 <font class="keywordflow">for</font> (sint32 i = 0; i < (sint32) <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n2">_Conds</a>.size(); i++ ) +00042 { +00043 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#o1">_CondsVal</a>[i] != <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n2">_Conds</a>[i]->isTrue() ) +00044 <font class="keywordflow">return</font> <font class="keyword">false</font>; +00045 } +00046 <font class="keywordflow">return</font> <font class="keyword">true</font>; +00047 } +00048 +<a name="l00049"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a7">00049</a> <a class="code" href="classstd_1_1list.html">std::list<CFact *></a> *CBoolOperator::backward(<a class="code" href="classstd_1_1list.html">std::list<IBaseAssert *></a> &conds, <a class="code" href="classstd_1_1list.html">std::list<bool></a> &vals) +00050 { +00051 <a class="code" href="classstd_1_1list.html">std::list<CFact *></a> *result = <font class="keyword">new</font> <a class="code" href="classstd_1_1list.html">std::list<CFact *></a>; +00052 <font class="keywordflow">for</font> ( sint32 i = 0; i < (sint32) <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n2">_Conds</a>.size(); i++ ) +00053 { +00054 CFact *tmp = <font class="keyword">new</font> CFact (<a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n2">_Conds</a>[i], <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#o1">_CondsVal</a>[i] ); +00055 result->push_back( tmp ); +00056 } +00057 <font class="keywordflow">return</font> result; +00058 } +00059 +<a name="l00060"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a12">00060</a> <font class="keywordtype">void</font> CBoolOperator::save(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &os) +00061 { +00062 IBaseOperator::save( os ); +00063 +00064 sint32 i; +00065 sint32 size = <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n2">_Conds</a>.size(); +00066 os.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( size ); +00067 <font class="keywordflow">for</font> ( i = 0; i < size; i++ ) +00068 { +00069 <font class="keywordtype">bool</font> ct = <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#o1">_CondsVal</a>[i]; +00070 os.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( (<font class="keywordtype">bool</font> &) ct ); +00071 } +00072 +00073 size = <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n3">_Concs</a>.size(); +00074 os.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( size ); +00075 <font class="keywordflow">for</font> ( i = 0; i < size; i++ ) +00076 { +00077 <font class="keywordtype">bool</font> <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#a0">test</a> = <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#o2">_ConcsVal</a>[i]; +00078 os.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#a0">test</a> ); +00079 } +00080 } +00081 +<a name="l00082"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a13">00082</a> <font class="keywordtype">void</font> CBoolOperator::load(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &is) +00083 { +00084 sint32 i; +00085 sint32 nb_vals; +00086 +00087 is.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( nb_vals ); +00088 <font class="keywordflow">for</font> ( i = 0; i < nb_vals; i++ ) +00089 { +00090 <font class="keywordtype">bool</font> val; +00091 is.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( val ); +00092 <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#o1">_CondsVal</a>.push_back( val ); +00093 } +00094 +00095 is.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( nb_vals ); +00096 <font class="keywordflow">for</font> ( i = 0; i < nb_vals; i++ ) +00097 { +00098 <font class="keywordtype">bool</font> val; +00099 is.<a class="code" href="classNLMISC_1_1IStream.html#a5">serial</a>( val ); +00100 <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#o2">_ConcsVal</a>.push_back( val ); +00101 } +00102 +00103 } +00104 +<a name="l00105"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a8">00105</a> <font class="keywordtype">bool</font> CBoolOperator::isValid(CFactBase *) +00106 { +00107 <font class="keywordflow">return</font> <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a6">isTrue</a>(); +00108 } +00109 +<a name="l00110"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a3">00110</a> <font class="keywordtype">void</font> CBoolOperator::addPrecondition(IBaseAssert *a, <font class="keywordtype">bool</font> <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>) +00111 { +00112 <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n2">_Conds</a>.push_back( a ); +00113 a->incRef(); +00114 a->addOutput( <font class="keyword">this</font> ); +00115 <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#o1">_CondsVal</a>.push_back( <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> ); +00116 } +00117 +<a name="l00118"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a4">00118</a> <font class="keywordtype">void</font> CBoolOperator::addPostcondition(IBaseAssert *a, <font class="keywordtype">bool</font> <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>) +00119 { +00120 <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n3">_Concs</a>.push_back( a ); +00121 a->incRef(); +00122 a->addInput( <font class="keyword">this</font> ); +00123 <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#o2">_ConcsVal</a>.push_back( <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> ); +00124 } +00125 +<a name="l00126"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a10">00126</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CBoolOperator::clone()<font class="keyword"> const</font> +00127 <font class="keyword"> </font>{ +00128 <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a0">CBoolOperator</a> *<a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a10">clone</a> = <font class="keyword">new</font> <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a0">CBoolOperator</a>; +00129 sint32 i; +00130 <font class="keywordflow">for</font> (i = 0; i < (sint32) <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n2">_Conds</a>.size(); i++ ) +00131 { +00132 <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a10">clone</a>->addPrecondition( <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n2">_Conds</a>[i], <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#o1">_CondsVal</a>[i] ); +00133 } +00134 +00135 <font class="keywordflow">for</font> (i = 0; i < (sint32) <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n3">_Concs</a>.size(); i++ ) +00136 { +00137 <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a10">clone</a>->addPrecondition( <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n3">_Concs</a>[i], <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#o2">_ConcsVal</a>[i] ); +00138 } +00139 <font class="keywordflow">return</font> <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a10">clone</a>; +00140 } +00141 +<a name="l00142"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a11">00142</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1IBasicType.html">NLAIC::IBasicType</a> *CBoolOperator::newInstance()<font class="keyword"> const</font> +00143 <font class="keyword"> </font>{ +00144 <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a0">CBoolOperator</a> *instance = <font class="keyword">new</font> <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a0">CBoolOperator</a>(); +00145 <font class="keywordflow">return</font> instance; +00146 } +00147 +<a name="l00148"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a14">00148</a> <font class="keywordtype">void</font> CBoolOperator::getDebugString(std::string &text)<font class="keyword"> const</font> +00149 <font class="keyword"> </font>{ +00150 text += <font class="stringliteral">"<CBoolOperator>\n -Preconditions:\n"</font>; +00151 +00152 sint32 i; +00153 <font class="keywordflow">for</font> ( i = 0; i < (sint32) <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n2">_Conds</a>.size() ; i++ ) +00154 { +00155 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#o1">_CondsVal</a>[i] ) +00156 text += <font class="stringliteral">" "</font>; +00157 <font class="keywordflow">else</font> +00158 text += <font class="stringliteral">" !"</font>; +00159 text += <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n2">_Conds</a>[i]->getName().getString(); +00160 +00161 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#o1">_CondsVal</a>[i] == <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n2">_Conds</a>[i]->isTrue() ) +00162 text += <font class="stringliteral">" (true)\n"</font>; +00163 <font class="keywordflow">else</font> +00164 text += <font class="stringliteral">" (false)\n"</font>; +00165 } +00166 +00167 text += <font class="stringliteral">" -Postconditions:\n"</font>; +00168 <font class="keywordflow">for</font> ( i = 0; i < (sint32) <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n3">_Concs</a>.size() ; i++ ) +00169 { +00170 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#o2">_ConcsVal</a>[i] ) +00171 text += <font class="stringliteral">" "</font>; +00172 <font class="keywordflow">else</font> +00173 text += <font class="stringliteral">" !"</font>; +00174 text += <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n3">_Concs</a>[i]->getName().getString(); +00175 text += <font class="stringliteral">"\n"</font>; +00176 } +00177 } +00178 +<a name="l00179"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a15">00179</a> <font class="keywordtype">bool</font> <a class="code" href="chain_8cpp.html#a2">CBoolOperator::isEqual</a>(<font class="keyword">const</font> CBoolOperator &a)<font class="keyword"> const</font> +00180 <font class="keyword"> </font>{ +00181 <font class="keywordflow">return</font> a.isTrue() == <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a6">isTrue</a>(); +00182 } +00183 +<a name="l00184"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a17">00184</a> <font class="keywordtype">bool</font> <a class="code" href="chain_8cpp.html#a2">CBoolOperator::isEqual</a>(<font class="keyword">const</font> IBasicObjectIA &a)<font class="keyword"> const</font> +00185 <font class="keyword"> </font>{ +00186 <font class="keywordflow">return</font> <font class="keyword">false</font>; +00187 } +00188 +<a name="l00189"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a9">00189</a> <font class="keyword">const</font> <a class="code" href="classNLAIC_1_1CIdentType.html">NLAIC::CIdentType</a> &CBoolOperator::getType()<font class="keyword"> const</font> +00190 <font class="keyword"> </font>{ +00191 <font class="keywordflow">return</font> <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#p0">IdBoolOperator</a>; +00192 } +00193 +<a name="l00194"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a18">00194</a> <font class="keywordtype">float</font> CBoolOperator::truthValue()<font class="keyword"> const</font> +00195 <font class="keyword"> </font>{ +00196 <font class="keywordflow">if</font> ( <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a6">isTrue</a>() ) +00197 <font class="keywordflow">return</font> 1.0; +00198 <font class="keywordflow">else</font> +00199 <font class="keywordflow">return</font> 0.0; +00200 } +00201 +<a name="l00202"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a19">00202</a> <a class="code" href="classstd_1_1list.html">std::list<CFact *></a> *CBoolOperator::backward(<a class="code" href="classstd_1_1list.html">std::list<CFact *></a> &facts) +00203 { +00204 <font class="keywordflow">return</font> NULL; +00205 } +00206 +<a name="l00207"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a20">00207</a> <a class="code" href="classstd_1_1list.html">std::list<CFact *></a> *CBoolOperator::forward(<a class="code" href="classstd_1_1list.html">std::list<CFact *></a> &facts) +00208 { +00209 <font class="keywordflow">return</font> <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a21">propagate</a>( facts ); +00210 } +00211 +<a name="l00212"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a21">00212</a> <a class="code" href="classstd_1_1list.html">std::list<CFact *></a> *CBoolOperator::propagate(<a class="code" href="classstd_1_1list.html">std::list<CFact *></a> &facts) +00213 { +00214 <a class="code" href="classstd_1_1list.html">std::list<CFact *></a> *result = <font class="keyword">new</font> <a class="code" href="classstd_1_1list.html">std::list<CFact *></a>; +00215 +00216 <font class="keywordtype">bool</font> *<a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#a0">test</a>= <font class="keyword">new</font> <font class="keywordtype">bool</font>[ <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n2">_Conds</a>.size() ]; +00217 sint32 i; +00218 std::list<CFact *>::iterator it_f = facts.begin(); +00219 <font class="keywordflow">while</font> ( it_f != facts.end() ) +00220 { +00221 <font class="keywordflow">for</font> ( i = 0; i < (sint32) <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n2">_Conds</a>.size(); i++ ) +00222 { +00223 <font class="keywordflow">if</font> ( (*<a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n2">_Conds</a>[i]) == (*it_f)->getAssert() ) +00224 <font class="keywordflow">if</font> ( ((CBoolType *)(*it_f)->getValue(0))->isTrue() == <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#o1">_CondsVal</a>[i] ) +00225 <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#a0">test</a>[i] = <font class="keyword">true</font>; +00226 <font class="keywordflow">else</font> +00227 <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#a0">test</a>[i] = <font class="keyword">false</font>; +00228 } +00229 it_f++; +00230 } +00231 +00232 <font class="keywordflow">for</font> ( i = 0; i < (sint32) <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n2">_Conds</a>.size(); i++ ) +00233 { +00234 <font class="keywordflow">if</font> ( !<a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#a0">test</a>[i] ) +00235 { +00236 <font class="keyword">delete</font> <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#a0">test</a>; +00237 <font class="keywordflow">return</font> result; +00238 } +00239 } +00240 <font class="keyword">delete</font> <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#a0">test</a>; +00241 +00242 <font class="keywordflow">for</font> (i = 0; i < (sint32) <a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n3">_Concs</a>.size(); i++ ) +00243 { +00244 CFact *tmp = <font class="keyword">new</font> CFact (<a class="code" href="classNLAILOGIC_1_1IBaseOperator.html#n3">_Concs</a>[i], <a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#o2">_ConcsVal</a>[i] ); +00245 result->push_back( tmp ); +00246 } +00247 <font class="keywordflow">return</font> result; +00248 } +00249 +<a name="l00250"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a16">00250</a> <font class="keyword">const</font> IObjectIA::CProcessResult &CBoolOperator::run() +00251 { +00252 <font class="keywordflow">return</font> IObjectIA::ProcessRun; +00253 } +00254 +<a name="l00255"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a22">00255</a> <font class="keywordtype">float</font> CBoolOperator::priority()<font class="keyword"> const</font> +00256 <font class="keyword"> </font>{ +00257 <font class="keywordflow">return</font> 0.0; +00258 } +00259 +<a name="l00260"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a23">00260</a> <font class="keywordtype">void</font> CBoolOperator::success() +00261 { +00262 } +00263 +<a name="l00264"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a24">00264</a> <font class="keywordtype">void</font> CBoolOperator::failure() +00265 { +00266 } +00267 +<a name="l00268"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a25">00268</a> <font class="keywordtype">void</font> CBoolOperator::success(IBaseOperator *) +00269 { +00270 } +00271 +<a name="l00272"></a><a class="code" href="classNLAILOGIC_1_1CBoolOperator.html#a26">00272</a> <font class="keywordtype">void</font> CBoolOperator::failure(IBaseOperator *) +00273 { +00274 } +00275 } +</pre></div> + +<!-- footer --> +<BR><FONT Size=+5> </FONT> +</TD> +<TD WIDTH=15><IMG SRC=http://www.nevrax.org/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD> +</TR> +</TABLE> +</BODY> +</HTML> |