예제 #1
0
 public function testGetKey()
 {
     $state = new SituationSet();
     $ruleA = new Rule();
     $ruleA->setId(12);
     $ruleB = new Rule();
     $ruleB->setId(13);
     $state->add(new Situation(new Table(), $ruleA, 1));
     $state->add(new Situation(new Table(), $ruleB, 2));
     $this->assertEquals('12.1|13.2', $state->getKey());
     $this->assertEquals('12.1|13.2', $state->getKey());
 }
예제 #2
0
 /**
  * @param SituationSet $situationSet
  *
  * @return \Jungle\SLR\State
  */
 public function addState(SituationSet $situationSet)
 {
     $key = $situationSet->getKey();
     if (!isset($this->states[$key])) {
         $this->states[$key] = new State($situationSet);
         $this->stateQueue->enqueue($this->states[$key]);
     }
     return $this->states[$key];
 }