コード例 #1
0
ファイル: CalculatorTest.php プロジェクト: n0rthface/Runalyze
 public function testSimpleArray()
 {
     $Calculator = new Calculator(new Trackdata\Object(array(Trackdata\Object::TIME => array(30, 60, 90, 120, 150), Trackdata\Object::DISTANCE => array(0.09, 0.18, 0.3, 0.48, 0.55), Trackdata\Object::CADENCE => array(90, 100, 100, 90, 70))));
     $Calculator->calculate();
     $this->assertEquals(122, $Calculator->average());
     $this->assertEquals(array(100, 90, 120, 200, 100), $Calculator->stridesData());
 }
コード例 #2
0
ファイル: Entity.php プロジェクト: guancio/Runalyze
 protected function calculateStrideLengthArray()
 {
     if (!$this->has(self::STRIDE_LENGTH)) {
         $StridesCalculator = new StrideLength\Calculator($this);
         $StridesCalculator->calculate();
         $this->set(self::STRIDE_LENGTH, $StridesCalculator->stridesData());
     }
 }