コード例 #1
0
function ejecutaModuloDifuso($obj)
{
    if (!empty($obj)) {
        if (strrpos($obj->idCapa, "agricola")) {
            $wm = new WorkingMemory();
            /*Agergacion de objeto a memoria de trabajo*/
            $wm->insert($obj);
            /*****/
            $rr = new RuleReader();
            /*leer archivo de reglas*/
            $rs = new RuleSession($rr->parseFile("../base_de_conocimiento/reglas_difusas.srl"), $wm);
            /******/
            $rs->verbosity = 1;
            /*correr reglas para este objeto*/
            $rs->fireAll();
            /**/
            $obj->escorrentia->defuzificarEscorrentia();
        }
    }
}
コード例 #2
0
ファイル: index.php プロジェクト: CICC-RG/tictactoe
<?php

session_start();
//session_unset();
require_once 'objectlevel/views/view_board.php';
require_once 'objectlevel/controllers/reasoner.php';
require_once 'karina/objectlevel/objectlevel.php';
require_once 'karina/memory/memory.php';
$working_memory = new WorkingMemory();
$working_memory->setMentalState(new State('is_system_started', true));
$working_memory->setMentalState(new State('is_perceived', false));
$working_memory->setMentalState(new State('is_board_modified', false));
$working_memory->setMentalState(new State('is_player_winner_verified', false));
$working_memory->setMentalState(new State('is_player_turn_changed', false));
$working_memory->setMentalState(new State('is_machine_played', false));
$working_memory->setMentalState(new State('is_machine_winner_verified', false));
$working_memory->setMentalState(new State('is_machine_turn_changed', false));
$working_memory->setMentalState(new State('is_world_shown', false));
//require_once 'objectlevel/models/models.php';
//call controller
$reasoner = new Reasoner();
if (isset($_GET['reset'])) {
    $reasoner->reset();
}
echo "perception<br>";
if ($reasoner->perception()) {
    echo "planning<br>";
    $reasoner->planning();
    echo "execute plan<br>";
    $reasoner->run();
}
コード例 #3
0
ファイル: reasoner.php プロジェクト: CICC-RG/tictactoe
 public function showBoard()
 {
     $working_memory = new WorkingMemory();
     ViewBoard::showBoard($working_memory->getModelOfTheWorld()->getBoard()->getCells(), []);
 }
コード例 #4
0
                 }
                 $poblacion->setSistemaTratamientoResidual($str);
                 $arrFuentesContaminacion[] = $poblacion;
             } else {
                 if ($obj_php[$i]->idCapa == 'rio') {
                     $rio->setCaudal($obj_php[$i]->caudal);
                     //echo 'caudal '.$rio->getCaudal();
                 }
             }
         }
     }
     //echo 'caudal '.$obj_php[$i]->idCapa;
 }
 foreach ($arrFuentesContaminacion as $obj) {
     ejecutaModuloDifuso($obj);
     $wm = new WorkingMemory();
     /*Agergacion de objeto a memoria de trabajo*/
     $wm->insert($obj);
     /*****/
     $rr = new RuleReader();
     /*leer archivo de reglas*/
     $rs = new RuleSession($rr->parseFile("../base_de_conocimiento/reglas.srl"), $wm);
     /******/
     $rs->verbosity = 1;
     /*correr reglas para este objeto*/
     $rs->fireAll();
     /**/
 }
 $datos_resultado = '';
 $cadActividadAgricola = '';
 $cadActividadGanadera = '';