当前位置: 首页>>代码示例>>C++>>正文


C++ MemberRules类代码示例

本文整理汇总了C++中MemberRules的典型用法代码示例。如果您正苦于以下问题:C++ MemberRules类的具体用法?C++ MemberRules怎么用?C++ MemberRules使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了MemberRules类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ArgumentRule

/** Return member rules (no members) */
const MemberRules& ParallelMcmcmc::getMemberRules(void) const {
    
    static MemberRules memberRules;
    static bool rulesSet = false;
    
    if ( !rulesSet ) {
        memberRules.push_back( new ArgumentRule("model", true, Model::getClassTypeSpec() ) );
        memberRules.push_back( new ArgumentRule("monitors", true, WorkspaceVector<Monitor>::getClassTypeSpec() ) );
        memberRules.push_back( new ArgumentRule("moves", true, WorkspaceVector<Move>::getClassTypeSpec() ) );
        memberRules.push_back( new ArgumentRule("numChains", true, Natural::getClassTypeSpec(), new Natural(4) ) );
        memberRules.push_back( new ArgumentRule("numProcessors", true, Natural::getClassTypeSpec(), new Natural(4) ) );
        memberRules.push_back( new ArgumentRule("swapInterval", true, Natural::getClassTypeSpec(), new Natural(100)) );
        memberRules.push_back( new ArgumentRule("deltaHeat", true, Real::getClassTypeSpec(), new Real(0.2) ) );
        memberRules.push_back( new ArgumentRule("sigmaHeat", true, Real::getClassTypeSpec(), new Real(1.0) ) );
        memberRules.push_back( new ArgumentRule("startHeat", true, Real::getClassTypeSpec(), new Real(1.0)) );
        
        std::vector<RlString> options;
        options.push_back( RlString("sequential") );
        options.push_back( RlString("random") );
        options.push_back( RlString("single") );
        
        memberRules.push_back( new OptionRule( "moveschedule", new RlString( "random" ), options ) );
        
        rulesSet = true;
    }
    
    return memberRules;
}
开发者ID:SylerWang,项目名称:RevBayes,代码行数:29,代码来源:RlParallelMcmcmc.cpp

示例2: ArgumentRule

/** 
 * Get the member rules used to create the constructor of this object.
 *
 * The member rules of the diversity-dependent pure-birth process are:
 * (1) the initial speciation rate lambda which must be a positive real.
 * (2) the carrying capacity that must be a natural number.
 * (3) all member rules specified by BirthDeathProcess.
 *
 * \return The member rules.
 */
const MemberRules& Dist_divDepYuleProcess::getMemberRules(void) const 
{
    
    static MemberRules distcBirthDeathMemberRules;
    static bool rulesSet = false;
    
    if ( !rulesSet ) 
    {
        distcBirthDeathMemberRules.push_back( new ArgumentRule( "lambda"  , true, RealPos::getClassTypeSpec() ) );
        distcBirthDeathMemberRules.push_back( new ArgumentRule( "capacity", true, Natural::getClassTypeSpec() ) );
        distcBirthDeathMemberRules.push_back( new ArgumentRule( "origin", true, RealPos::getClassTypeSpec() ) );
        std::vector<RlString> optionsCondition;
        optionsCondition.push_back( RlString("time") );
        optionsCondition.push_back( RlString("survival") );
        optionsCondition.push_back( RlString("nTaxa") );
        distcBirthDeathMemberRules.push_back( new OptionRule( "condition", new RlString("survival"), optionsCondition ) );
        distcBirthDeathMemberRules.push_back( new ArgumentRule( "nTaxa"  , true, Natural::getClassTypeSpec() ) );
        distcBirthDeathMemberRules.push_back( new ArgumentRule( "names"  , true, ModelVector<RlString>::getClassTypeSpec() ) );
        distcBirthDeathMemberRules.push_back( new ArgumentRule( "constraints"  , true, ModelVector<Clade>::getClassTypeSpec(), new ModelVector<Clade>() ) );

        // add the rules from the base class
        const MemberRules &parentRules = TypedDistribution<TimeTree>::getMemberRules();
        distcBirthDeathMemberRules.insert(distcBirthDeathMemberRules.end(), parentRules.begin(), parentRules.end());
        
        rulesSet = true;
    }
    
    return distcBirthDeathMemberRules;
}
开发者ID:SylerWang,项目名称:RevBayes,代码行数:39,代码来源:Dist_divDepYuleProcess.cpp

示例3: ArgumentRule

/** Return member rules (no members) */
const MemberRules& Dist_offsetExponential::getMemberRules(void) const {
    
    static MemberRules distExpMemberRules;
    static bool rulesSet = false;
    
    if ( !rulesSet ) {
        distExpMemberRules.push_back( new ArgumentRule( "lambda", true, RealPos::getClassTypeSpec()   , new RealPos(1.0) ) );
        distExpMemberRules.push_back( new ArgumentRule( "offset", true, Real::getClassTypeSpec()  ) );
        
        rulesSet = true;
    }
    
    return distExpMemberRules;
}
开发者ID:SylerWang,项目名称:RevBayes,代码行数:15,代码来源:Dist_offsetExponential.cpp

示例4: ArgumentRule

/**
 * Get the member rules used to create the constructor of this object.
 *
 * The member rules of the scale move are:
 * (1) the variable which must be a positive real.
 * (2) the tuning parameter lambda that defines the size of the proposal (positive real)
 * (3) a flag whether auto-tuning should be used.
 *
 * \return The member rules.
 */
const MemberRules& Move_NodeCharacterHistoryRejectionSample::getMemberRules(void) const
{
    
    static MemberRules nodeChrsMoveMemberRules;
    static bool rulesSet = false;
    
    if ( !rulesSet )
    {
        nodeChrsMoveMemberRules.push_back( new ArgumentRule( "ctmc", false, AbstractDiscreteCharacterData::getClassTypeSpec() ) );
        nodeChrsMoveMemberRules.push_back( new ArgumentRule( "qmap", false, RateMap::getClassTypeSpec() ) );
        nodeChrsMoveMemberRules.push_back( new ArgumentRule( "tree", false, TimeTree::getClassTypeSpec() ) );
        nodeChrsMoveMemberRules.push_back( new ArgumentRule( "lambda", true, Probability::getClassTypeSpec() , new Probability(1.0) ) );
//        nodeChrsMoveMemberRules.push_back( new ArgumentRule( "type", true, RlString::getClassTypeSpec(), new RlString("std") ) );
        std::vector<RlString> options;
        options.push_back( RlString("std") );
        options.push_back( RlString("biogeo") );
        nodeChrsMoveMemberRules.push_back( new OptionRule( "type", new RlString("std"), options ) );
        
        /* Inherit weight from Move, put it after variable */
        const MemberRules& inheritedRules = Move::getMemberRules();
        nodeChrsMoveMemberRules.insert( nodeChrsMoveMemberRules.end(), inheritedRules.begin(), inheritedRules.end() );
        
        rulesSet = true;
    }
    
    return nodeChrsMoveMemberRules;
}
开发者ID:SylerWang,项目名称:RevBayes,代码行数:37,代码来源:Move_NodeCharacterHistoryRejectionSample.cpp

示例5: ArgumentRule

/** Return member rules (no members) */
const MemberRules& Clade::getParameterRules(void) const {
    
    static MemberRules modelMemberRules;
    static bool rulesSet = false;
    
    if ( !rulesSet ) {
        modelMemberRules.push_back( new ArgumentRule("taxonName", RlString::getClassTypeSpec(), ArgumentRule::BY_VALUE ) );
        modelMemberRules.push_back( new Ellipsis(RlString::getClassTypeSpec() ) );
        
        rulesSet = true;
    }
    
    return modelMemberRules;
}
开发者ID:wrightaprilm,项目名称:revbayes,代码行数:15,代码来源:RlClade.cpp

示例6: ArgumentRule

/** Return member rules (no members) */
const MemberRules& Dist_bernoulli::getParameterRules(void) const {
    
    static MemberRules distBernMemberRules;
    static bool rulesSet = false;
    
    if ( !rulesSet ) 
    {
        distBernMemberRules.push_back( new ArgumentRule( "p", Probability::getClassTypeSpec(), ArgumentRule::BY_CONSTANT_REFERENCE ) );
        
        rulesSet = true;
    }
    
    return distBernMemberRules;
}
开发者ID:wrightaprilm,项目名称:revbayes,代码行数:15,代码来源:Dist_bernoulli.cpp

示例7: ArgumentRule

/** Return member rules (no members) */
const MemberRules& Dist_mvtnorm::getMemberRules(void) const {
    
    static MemberRules distExpMemberRules;
    static bool rulesSet = false;
    
    if ( !rulesSet ) {
        distExpMemberRules.push_back( new ArgumentRule( "mean", true, ModelVector<Real>::getClassTypeSpec() ) );
        distExpMemberRules.push_back( new ArgumentRule( "precision", true, RealSymmetricMatrix::getClassTypeSpec() ) );
        
        rulesSet = true;
    }
    
    return distExpMemberRules;
}
开发者ID:SylerWang,项目名称:RevBayes,代码行数:15,代码来源:Dist_mvtnorm.cpp

示例8: ArgumentRule

/** Return member rules (no members) */
const MemberRules& Dist_exponentialOffset::getParameterRules(void) const {
    
    static MemberRules distExpMemberRules;
    static bool rulesSet = false;
    
    if ( !rulesSet ) {
        distExpMemberRules.push_back( new ArgumentRule( "lambda", RealPos::getClassTypeSpec(), ArgumentRule::BY_CONSTANT_REFERENCE, ArgumentRule::ANY ) );
        distExpMemberRules.push_back( new ArgumentRule( "offset", Real::getClassTypeSpec()   , ArgumentRule::BY_CONSTANT_REFERENCE, ArgumentRule::ANY ) );
        
        rulesSet = true;
    }
    
    return distExpMemberRules;
}
开发者ID:wrightaprilm,项目名称:revbayes,代码行数:15,代码来源:Dist_exponentialOffset.cpp

示例9: ArgumentRule

/** 
 * Get the member rules used to create the constructor of this object.
 *
 * The member rules of the homogeneous birth-death process are:
 * (1) time of the process since the origin.
 * (2) time of the process since the rootAge.
 * (3) the sampling probability.
 * (4) the sampling strategy.
 * (5) the condition.
 * (6) the number of taxa.
 * (7) the taxon names.
 * (8) the clade constraints.
 *
 * \return The member rules.
 */
const MemberRules& BirthDeathProcess::getMemberRules(void) const 
{
    
    static MemberRules distcBirthDeathMemberRules;
    static bool rulesSet = false;
    
    if ( !rulesSet ) 
    {
        distcBirthDeathMemberRules.push_back( new ArgumentRule( "origin" , RealPos::getClassTypeSpec()    , ArgumentRule::BY_CONSTANT_REFERENCE, ArgumentRule::ANY, NULL ) );
        distcBirthDeathMemberRules.push_back( new ArgumentRule( "rootAge", RealPos::getClassTypeSpec()    , ArgumentRule::BY_CONSTANT_REFERENCE, ArgumentRule::ANY, NULL ) );
        distcBirthDeathMemberRules.push_back( new ArgumentRule( "rho"    , Probability::getClassTypeSpec(), ArgumentRule::BY_CONSTANT_REFERENCE, ArgumentRule::ANY, new Probability(1.0) ) );
        std::vector<std::string> optionsStrategy;
        optionsStrategy.push_back( "uniform" );
        optionsStrategy.push_back( "diversified" );
        distcBirthDeathMemberRules.push_back( new OptionRule( "samplingStrategy", new RlString("uniform"), optionsStrategy ) );
        std::vector<std::string> optionsCondition;
        optionsCondition.push_back( "time" );
        optionsCondition.push_back( "survival" );
        optionsCondition.push_back( "nTaxa" );
        distcBirthDeathMemberRules.push_back( new OptionRule( "condition", new RlString("survival"), optionsCondition ) );
        distcBirthDeathMemberRules.push_back( new ArgumentRule( "nTaxa"  , Natural::getClassTypeSpec(), ArgumentRule::BY_VALUE ) );
        distcBirthDeathMemberRules.push_back( new ArgumentRule( "names"  , ModelVector<RlString>::getClassTypeSpec(), ArgumentRule::BY_VALUE ) );
        distcBirthDeathMemberRules.push_back( new ArgumentRule( "constraints", ModelVector<Clade>::getClassTypeSpec(), ArgumentRule::BY_VALUE, ArgumentRule::ANY, new ModelVector<Clade>() ) );
        
        rulesSet = true;
    }
    
    return distcBirthDeathMemberRules;
}
开发者ID:vivianaayus,项目名称:revbayes,代码行数:44,代码来源:RlBirthDeathProcess.cpp

示例10: ArgumentRule

/** Return member rules (no members) */
const MemberRules& Taxon::getMemberRules(void) const {
    
    static MemberRules modelMemberRules;
    static bool rulesSet = false;
    
    if ( !rulesSet ) {
        modelMemberRules.push_back( new ArgumentRule("taxonName", true, RlString::getClassTypeSpec() ) );
        modelMemberRules.push_back( new ArgumentRule("speciesName", true, RlString::getClassTypeSpec() ) );
      //  modelMemberRules.push_back( new ArgumentRule("date", true, RlDate::getClassTypeSpec() ) );
                
        rulesSet = true;
    }
    
    return modelMemberRules;
}
开发者ID:SylerWang,项目名称:RevBayes,代码行数:16,代码来源:RlTaxon.cpp

示例11: ArgumentRule

/**
 * Get the member rules used to create the constructor of this object.
 *
 * The member rules of the Poisson distribution are:
 * (1) the rate lambda which must be a positive real between 0 and 1 (= a probability).
 *
 * \return The member rules.
 */
const MemberRules& Dist_poisson::getParameterRules(void) const
{

    static MemberRules distPoisMemberRules;
    static bool rulesSet = false;

    if ( !rulesSet )
    {
        distPoisMemberRules.push_back( new ArgumentRule( "lambda", RealPos::getClassTypeSpec(), ArgumentRule::BY_CONSTANT_REFERENCE ) );

        rulesSet = true;
    }

    return distPoisMemberRules;
}
开发者ID:wrightaprilm,项目名称:revbayes,代码行数:23,代码来源:Dist_poisson.cpp

示例12: ArgumentRule

/** Return member rules (no members) */
const MemberRules& Dist_dirichlet::getParameterRules(void) const
{
    
    static MemberRules memberRules;
    static bool rulesSet = false;
    
    if ( !rulesSet )
    {
        memberRules.push_back( new ArgumentRule( "alpha", ModelVector<RealPos>::getClassTypeSpec(), "The concentration parameter.", ArgumentRule::BY_CONSTANT_REFERENCE, ArgumentRule::ANY ) );
        
        rulesSet = true;
    }
    
    return memberRules;
}
开发者ID:hscarter,项目名称:revbayes,代码行数:16,代码来源:Dist_dirichlet.cpp

示例13: ArgumentRule

/**
 * Get the member rules used to create the constructor of this object.
 *
 * The member rules of the geometric distribution are:
 * (1) the rate lambda which must be a positive real between 0 and 1 (= a probability).
 *
 * \return The member rules.
 */
const MemberRules& Dist_geom::getMemberRules(void) const
{

    static MemberRules distGeomMemberRules;
    static bool rulesSet = false;

    if ( !rulesSet )
    {
        distGeomMemberRules.push_back( new ArgumentRule( "p", true, Probability::getClassTypeSpec() ) );

        rulesSet = true;
    }

    return distGeomMemberRules;
}
开发者ID:bredelings,项目名称:RevBayes,代码行数:23,代码来源:Dist_geom.cpp

示例14: ArgumentRule

/**
 * Get the member rules used to create the constructor of this object.
 *
 * The member rules of the Multispecies Coalescent process are:
 * (1) Species tree rooted triplet distribution.
 * (2) Whether we use species names or taxons.
 *
 * \return The member rules.
 */
const MemberRules& Dist_MPEST::getMemberRules(void) const
{
    
    static MemberRules MPESTMemberRules;
    static bool rulesSet = false;
    
    if ( !rulesSet )
    {
        MPESTMemberRules.push_back( new ArgumentRule( "speciesTree", RootedTripletDistribution::getClassTypeSpec(), ArgumentRule::BY_CONSTANT_REFERENCE ) );
        //MPESTMemberRules.push_back( new ArgumentRule( "geneTrees", RootedTripletDistribution::getClassTypeSpec(), ArgumentRule::BY_CONSTANT_REFERENCE ) );
        MPESTMemberRules.push_back( new ArgumentRule( "useSpecies", RlBoolean::getClassTypeSpec(), ArgumentRule::BY_VALUE ) );
        rulesSet = true;
    }
    
    return MPESTMemberRules;
}
开发者ID:wrightaprilm,项目名称:revbayes,代码行数:25,代码来源:Dist_MPEST.cpp

示例15: ArgumentRule

/** Return member rules (no members) */
const MemberRules& Dist_offsetLnorm::getMemberRules(void) const {
    
    static MemberRules distLnormMemberRules;
    static bool rulesSet = false;
    
    if ( !rulesSet ) 
    {
        distLnormMemberRules.push_back( new ArgumentRule( "mean",   true, Real::getClassTypeSpec(),    new Real(0.0) ) );
        distLnormMemberRules.push_back( new ArgumentRule( "sd"  ,   true, RealPos::getClassTypeSpec(), new RealPos(1.0) ) );
        distLnormMemberRules.push_back( new ArgumentRule( "offset", true, Real::getClassTypeSpec() ) );
        
        rulesSet = true;
    }
    
    return distLnormMemberRules;
}
开发者ID:SylerWang,项目名称:RevBayes,代码行数:17,代码来源:Dist_offsetLnorm.cpp


注:本文中的MemberRules类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。