Hoa central
Bag.php
Go to the documentation of this file.
1 <?php
2 
37 namespace Hoa\Realdom;
38 
39 use Hoa\Math;
40 
49 class Bag extends Realdom
50 {
56  const NAME = 'bag';
57 
63  protected $_arguments = …;
64 
65 
66 
73  protected function _predicate($q)
74  {
75  $out = false;
76 
77  foreach ($this->getArguments() as $domain) {
78  $out = $out || $domain->predicate($q);
79  }
80 
81  return $out;
82  }
83 
90  protected function _sample(Math\Sampler $sampler)
91  {
92  return
93  $this
94  ->arguments[$sampler->getInteger(0, count($this) - 1)]
95  ->sample($sampler);
96  }
97 }
_predicate($q)
Definition: Bag.php:73
_sample(Math\Sampler $sampler)
Definition: Bag.php:90
const NAME
Definition: Bag.php:56