Esempio n. 1
0
 function getHecho()
 {
     $h = new hecho();
     $h->setValor($this->getValor());
     $h->setEsNumerico($this->getEsNumerico());
     $h->setVariable($this->getVariable());
     return $h;
 }
Esempio n. 2
0
 function existeHecho(hecho $hecho)
 {
     foreach ($this->hechos as $i => $h) {
         if (strcmp($hecho->getVariable(), $h->getVariable()) == 0) {
             return $h;
         }
     }
     return NULL;
 }
 private function buscarReglas(hecho $hecho)
 {
     $conjunto_conflictivo = array();
     foreach ($this->reglas as $i => $regla) {
         if (strcmp($regla->getConsecuente()->getVariable(), $hecho->getVariable()) == 0) {
             $conjunto_conflictivo[] = $regla;
         }
     }
     return $conjunto_conflictivo;
 }
Esempio n. 4
0
$h6->setEsNumerico(TRUE);
$r2 = new regla();
$r2->addLiteral($l1);
$r2->setConsecuente($h6);
$bwx->setReglas($r2);
$l2 = new literal();
$l2->setHecho($h6);
$l2->setOprel(literal::$IGUAL);
$l3 = new literal();
$l3->setHecho($h4);
$l3->setOprel(literal::$IGUAL);
$r3 = new regla();
$r3->addLiteral($l2);
$r3->addLiteral($l3);
$h7 = new hecho();
$h7->setVariable('m');
$h7->setValor('oscar');
$h7->setEsNumerico(FALSE);
$r3->setConsecuente($h7);
$bwx->setReglas($r3);
$meta = new hecho();
$meta->setVariable('m');
$literal = new literal();
$literal->setHecho($meta);
$literal->setOprel(literal::$IGUAL);
$bwx->bwcr($meta, $bh);
var_dump($bh);
?>
    </body>
</html>