- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Interfaces/ProbDistribution.h

    00001 /* File: ProbDistribution.h
    00002
    00003 author:         John Stedl
    00004 date:   10.22.2003
    00005 org:            MERS@MIT
    00006
    00007  ============================================================================ */
    00008
    00009 #ifndef PROB_DISTRIBUTION_H
    00010 #define PROB_DISTRIBUTION_H
    00011
    00012 #include <string>
    00013 #include <Mers/Utils/Lang/Time.h>
    00014
    00029 namespace Mers {
    00030         namespace Interfaces {
    00031
    00032 class ProbDistribution
    00033 {
    00034 public:
    00035
    00036         enum Type { UNIFORM = 1, GAUSSIAN = 2 };
    00037
    00038         // ---------------------- Constructors/Destructor ------------------------
    00039
    00040         // constructor
    00041         ProbDistribution();
    00042         ProbDistribution( std::string input );
    00043         ProbDistribution( std::string type, std::string param1, std::string param2 );
    00044
    00045         // destructor
    00046         ~ProbDistribution();
    00047
    00048         // copy constructor and assignement operator
    00049         ProbDistribution( ProbDistribution const &other );
    00050         ProbDistribution& operator=( ProbDistribution const &other );
    00051
    00052
    00053         // ---------------------------- Accessors ---------------------------------
    00054         std::string get_distributionType() const;
    00055         void set_distributionType( std::string type );
    00056
    00057         // uniform distribution
    00058         Mers::Utils::Lang::Time get_lb() const;
    00059         Mers::Utils::Lang::Time get_ub() const;
    00060         void set_bounds( Mers::Utils::Lang::Time lb_, Mers::Utils::Lang::Time ub_ );
    00061
    00062         // gaussian distribution
    00063         Mers::Utils::Lang::Time get_mean() const;
    00064         void set_mean( Mers::Utils::Lang::Time mean_ );
    00065
    00066         Mers::Utils::Lang::Time get_std_dev() const;
    00067         void set_std_dev( Mers::Utils::Lang::Time std_dev_ );
    00068
    00069 private:
    00070         // -------------------------- Private Variables -----------------------------
    00071         std::string distributionType;   // distribution type ( i.e. uniform or gaussian )
    00072
    00073         // uniform distribution
    00074         Mers::Utils::Lang::Time  lb;    // upper bound on execution time
    00075         Mers::Utils::Lang::Time  ub;  // lower bound on execution time
    00076
    00077         // gaussian distribution
    00078         Mers::Utils::Lang::Time  mean;           // mean execution time
    00079         Mers::Utils::Lang::Time  std_dev;   // standard deviation of execution time
    00080
    00081         // --------------------------- Private Methods -----------------------------
    00082         bool parseDistributionName( std::string input );
    00083         void init();
    00084 };
    00085
    00086         } // namespace Mers
    00087 } // namespace Interfaces
    00088
    00089 #endif  // PROB_DISTRIBUTION_H
    00090