コード例 #1
0
ファイル: Semaphore.php プロジェクト: bluesnowman/Chimera
 /**
  * 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__);
     }
 }
コード例 #2
0
ファイル: Iterator.php プロジェクト: bluesnowman/Chimera
 /**
  * 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);
     }
 }
コード例 #3
0
ファイル: Gambler.php プロジェクト: bluesnowman/Chimera
 /**
  * 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);
     }
 }
コード例 #4
0
ファイル: Repeater.php プロジェクト: bluesnowman/Chimera
 /**
  * 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);
     }
 }
コード例 #5
0
ファイル: Failer.php プロジェクト: bluesnowman/Chimera
 /**
  * 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);
     }
 }
コード例 #6
0
ファイル: Counter.php プロジェクト: bluesnowman/Chimera
 /**
  * This destructor ensures that any resources are properly disposed.
  *
  * @access public
  */
 public function __destruct()
 {
     parent::__destruct();
     unset($this->counter);
 }
コード例 #7
0
ファイル: Ticker.php プロジェクト: bluesnowman/Chimera
 /**
  * This destructor ensures that any resources are properly disposed.
  *
  * @access public
  */
 public function __destruct()
 {
     parent::__destruct();
     unset($this->next_time);
 }
コード例 #8
0
ファイル: Limiter.php プロジェクト: bluesnowman/Chimera
 /**
  * This destructor ensures that any resources are properly disposed.
  *
  * @access public
  */
 public function __destruct()
 {
     parent::__destruct();
     unset($this->calls);
 }
コード例 #9
0
ファイル: Logger.php プロジェクト: bluesnowman/Chimera
 /**
  * This destructor ensures that any resources are properly disposed.
  *
  * @access public
  */
 public function __destruct()
 {
     parent::__destruct();
     unset($this->level);
     unset($this->logger);
 }