001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.commons.rng.examples.sampling;
018
019import picocli.CommandLine;
020
021/**
022 * Executes testing utilities for the samplers in the Commons RNG library.
023 *
024 * <p>Functionality includes:</p>
025 *
026 * <ul>
027 *   <li>Creating a PDF approximation using sample data from a distribution
028 *   <li>Sampling from a small range from a distribution to visually inspect sampling density
029 * </ul>
030 */
031public final class ExamplesSamplingApplication {
032    /** No public constructor. */
033    private ExamplesSamplingApplication() {}
034
035    /**
036     * Run the RNG examples stress command line application.
037     *
038     * @param args Application's arguments.
039     */
040    public static void main(String[] args) {
041        // Build the command line manually so we can configure options.
042        final CommandLine cmd = new CommandLine(new ExamplesSamplingCommand())
043                .addSubcommand("density", new ProbabilityDensityApproximationCommand())
044                .addSubcommand("visual", new UniformSamplingVisualCheckCommand())
045                // Call last to apply to all sub-commands
046                .setCaseInsensitiveEnumValuesAllowed(true);
047
048        // Parse the command line and invokes the Callable program
049        cmd.execute(args);
050    }
051}