コード例 #1
0
ファイル: literal.php プロジェクト: rolion/taller1
 function getHecho()
 {
     $h = new hecho();
     $h->setValor($this->getValor());
     $h->setEsNumerico($this->getEsNumerico());
     $h->setVariable($this->getVariable());
     return $h;
 }
コード例 #2
0
 public function procesarRespuestas($id)
 {
     $SE = new backwardchain();
     $SE->initBase($id);
     $SE->createRules();
     $meta = new hecho();
     $meta->setVariable('perfil');
     return $SE->bwcr($meta);
 }
コード例 #3
0
ファイル: bh.php プロジェクト: rolion/taller1
 function existeHecho(hecho $hecho)
 {
     foreach ($this->hechos as $i => $h) {
         if (strcmp($hecho->getVariable(), $h->getVariable()) == 0) {
             return $h;
         }
     }
     return NULL;
 }
コード例 #4
0
ファイル: backwardchain.php プロジェクト: rolion/taller1
 private function regla10()
 {
     $hecho1 = new hecho();
     $hecho1->setVariable(self::$RESPUESTA);
     $hecho1->setValor(self::$VALIDA);
     $hecho1->setEsNumerico(FALSE);
     $hecho2 = new hecho();
     $hecho2->setVariable(self::$NRO_PROF_PREF);
     $hecho2->setValor(4);
     $hecho2->setEsNumerico(TRUE);
     $hecho3 = new hecho();
     $hecho3->setVariable(self::$DISCREPANCIA_PROF_PREF);
     $hecho3->setValor(self::$EXISTE);
     $literal1 = new literal();
     $literal1->setHecho($hecho1);
     $literal1->setOprel(literal::$IGUAL);
     $literal2 = new literal();
     $literal2->setHecho($hecho2);
     $literal2->setOprel(literal::$MENOR);
     $literal3 = new literal();
     $literal3->setHecho($hecho3);
     $literal3->setOprel(literal::$IGUAL);
     $consecuente = new hecho();
     $consecuente->setVariable(self::$PERFIL);
     $consecuente->setValor(self::$NO_DEFINIDO);
     $consecuente->setEsNumerico(FALSE);
     $regla = new regla();
     $regla->addLiteral($literal1);
     $regla->addLiteral($literal2);
     $regla->addLiteral($literal3);
     $regla->setConsecuente($consecuente);
     $this->reglas[] = $regla;
 }