示例#1
0
 /**
  * Main program.
  *
  * @param array $args Command-line arguments.
  * @return integer Zero on success; non-zero on failure.
  */
 public static function main($args)
 {
     printf("SimpleRV main program.\n");
     $status = 0;
     $rv = new SimpleRV();
     AbstractRandomVariable::test($rv);
     return $status;
 }
示例#2
0
 /**
  * Main program.
  *
  * @param array $args Command-line arguments.
  * @return integer Zero on success; non-zero on failure.
  */
 public static function main($args)
 {
     printf("UniformRV main program.\n");
     $status = 0;
     $rv = new UniformRV(0.0, 100.0);
     AbstractRandomVariable::test($rv);
     return $status;
 }
示例#3
0
 /**
  * Main program.
  *
  * @param array $args Command-line arguments.
  * @return integer Zero on success; non-zero on failure.
  */
 public static function main($args)
 {
     printf("ExponentialRV main program.\n");
     $status = 0;
     $rv = new ExponentialRV(100.0);
     AbstractRandomVariable::test($rv);
     return $status;
 }
    {
        parent::__destruct();
    }
    /**
     * RandomVariable test method.
     *
     * @param object IRandomVariable $rv The random variable to test.
     */
    public static function test(IRandomVariable $rv)
    {
        printf("AbstractRandomVariable test program.\n");
        for ($i = 0; $i < 10; ++$i) {
            printf("%.15f\n", $rv->next());
        }
    }
    /**
     * Main program.
     *
     * @param array $args Command-line arguments.
     * @return integer Zero on success; non-zero on failure.
     */
    public static function main($args)
    {
        printf("AbstractRandomVariable main program.\n");
        $status = 0;
        return $status;
    }
}
if (realpath($argv[0]) == realpath(__FILE__)) {
    exit(AbstractRandomVariable::main(array_slice($argv, 1)));
}