Exemplo n.º 1
0
 /**
  * This constructor initializes the class with the specified parameters.
  *
  * @access public
  * @param Common\Mutable\IMap $blackboard                   the blackboard to be used
  * @param Common\Mutable\IMap $policy                       the policy associated with the task
  */
 public function __construct(Common\Mutable\IMap $blackboard = null, Common\Mutable\IMap $policy = null)
 {
     parent::__construct($blackboard, $policy);
     if (!$this->policy->hasKey('id')) {
         $this->policy->putEntry('id', __CLASS__);
     }
 }
Exemplo n.º 2
0
 /**
  * This constructor initializes the class with the specified parameters.
  *
  * @access public
  * @param Common\Mutable\IMap $blackboard                   the blackboard to be used
  * @param Common\Mutable\IMap $policy                       the policy associated with the task
  */
 public function __construct(Common\Mutable\IMap $blackboard = null, Common\Mutable\IMap $policy = null)
 {
     parent::__construct($blackboard, $policy);
     if (!$this->policy->hasKey('reverse')) {
         // direction
         $this->policy->putEntry('reverse', false);
     }
     if (!$this->policy->hasKey('steps')) {
         $this->policy->putEntry('steps', 1);
     }
 }
Exemplo n.º 3
0
 /**
  * This constructor initializes the class with the specified parameters.
  *
  * @access public
  * @param Common\Mutable\IMap $blackboard                   the blackboard to be used
  * @param Common\Mutable\IMap $policy                       the policy associated with the task
  */
 public function __construct(Common\Mutable\IMap $blackboard = null, Common\Mutable\IMap $policy = null)
 {
     parent::__construct($blackboard, $policy);
     if (!$this->policy->hasKey('callable')) {
         $this->policy->putEntry('callable', 'rand');
         // ['rand', 'mt_rand']
     }
     if (!$this->policy->hasKey('odds')) {
         $this->policy->putEntry('odds', 0.01);
     }
     if (!$this->policy->hasKey('options')) {
         $this->policy->putEntry('options', 100);
     }
 }
Exemplo n.º 4
0
 /**
  * This constructor initializes the class with the specified parameters.
  *
  * @access public
  * @param Common\Mutable\IMap $blackboard                   the blackboard to be used
  * @param Common\Mutable\IMap $policy                       the policy associated with the task
  */
 public function __construct(Common\Mutable\IMap $blackboard = null, Common\Mutable\IMap $policy = null)
 {
     parent::__construct($blackboard, $policy);
     if ($this->policy->hasKey('until')) {
         $until = $this->policy->getValue('until');
         if (is_string($until)) {
             $until = BT\Task\Status::valueOf($until);
         }
         if ($until !== BT\Task\Status::SUCCESS) {
             $until = BT\Task\Status::FAILED;
         }
         $this->policy->putEntry('until', $until);
     } else {
         $this->policy->putEntry('until', BT\Task\Status::SUCCESS);
     }
 }
Exemplo n.º 5
0
 /**
  * This constructor initializes the class with the specified parameters.
  *
  * @access public
  * @param Common\Mutable\IMap $blackboard                   the blackboard to be used
  * @param Common\Mutable\IMap $policy                       the policy associated with the task
  */
 public function __construct(Common\Mutable\IMap $blackboard = null, Common\Mutable\IMap $policy = null)
 {
     parent::__construct($blackboard, $policy);
     if (!$this->policy->hasKey('error')) {
         $this->policy->putEntry('error', false);
     }
     if (!$this->policy->hasKey('inactive')) {
         $this->policy->putEntry('inactive', false);
     }
     if (!$this->policy->hasKey('active')) {
         $this->policy->putEntry('acitve', false);
     }
     if (!$this->policy->hasKey('success')) {
         $this->policy->putEntry('success', true);
     }
 }
Exemplo n.º 6
0
 /**
  * This destructor ensures that any resources are properly disposed.
  *
  * @access public
  */
 public function __destruct()
 {
     parent::__destruct();
     unset($this->counter);
 }
Exemplo n.º 7
0
 /**
  * This destructor ensures that any resources are properly disposed.
  *
  * @access public
  */
 public function __destruct()
 {
     parent::__destruct();
     unset($this->next_time);
 }
Exemplo n.º 8
0
 /**
  * This destructor ensures that any resources are properly disposed.
  *
  * @access public
  */
 public function __destruct()
 {
     parent::__destruct();
     unset($this->calls);
 }
Exemplo n.º 9
0
 /**
  * This destructor ensures that any resources are properly disposed.
  *
  * @access public
  */
 public function __destruct()
 {
     parent::__destruct();
     unset($this->level);
     unset($this->logger);
 }