/**
  * @dataProvider dataProviderForCDF
  */
 public function testCDF($z, $cdf)
 {
     $μ = 0;
     $σ = 1;
     $this->assertEquals($cdf, StandardNormal::CDF($z), '', 0.0001);
     $this->assertEquals(Normal::CDF($z, $μ, $σ), StandardNormal::CDF($z));
 }
Example #2
0
 /**
  * Checks if the value is a file.
  * @return ValidationState 
  */
 public function validation()
 {
     parent::validation();
     if ($this->validationState->getError($this->fieldName) == null && !is_file(\Pvik\Core\Path::realPath($this->getPOST()))) {
         $this->validationState->setError($this->fieldName, 'Must be a valid file.');
     }
     return $this->validationState;
 }
Example #3
0
 public function testMean()
 {
     $μ = 5;
     $σ = 1.5;
     $this->assertEquals($μ, Normal::mean($μ, $σ));
 }
Example #4
0
                    return false;
                }
            } else {
                if ($this->ultPrecio != 1 and $this->ultLinea != $linea and 1 > $hora - $this->ultHora) {
                    if ($this->saldo > 1) {
                        $this->saldo = $this->saldo - 1;
                        $this->ultPrecio = 1;
                        $this->ultLinea = $linea;
                        $this->ultHora = $hora;
                        $this->viajes[] = new viaje($linea, $hora, 1);
                        //echo "Viaje realizado con exito en la linea "."$linea"." a la hora "."$hora"."<br>";
                        return true;
                    } else {
                        //echo "El viaje no se pudo realizar tienes $". "$this->saldo". " en tu tarjeta"." y necesitas $2.50 <br>";
                        return false;
                    }
                }
            }
        }
    }
}
$miTarjeta = new Normal();
$miTarjeta->recarga(20);
$miTarjeta->pagarBoleto(141, 20.3);
$miTarjeta->pagarBoleto(142, 20.31);
$miTarjeta->pagarBoleto(143, 20.32);
$miTarjeta->pagarBoleto(144, 20.33);
$miTarjeta->viajesRealizados();
?>
 
 public function __construct($fieldName, \Pvik\Database\ORM\Entity $entity, \Pvik\Web\Request $request, \Pvik\Utils\ValidationState $validationState)
 {
     parent::__construct($fieldName, $entity, $request, $validationState);
     $this->configurationHelper->setValue($fieldName, 'Disabled', true);
     $this->configurationHelper->setValue($fieldName, 'Nullable', true);
 }